1## Process this file with automake to generate Makefile.in
2##
3##   Copyright (C) 2012-2024 Free Software Foundation, Inc.
4##
5## This file is free software; you can redistribute it and/or modify
6## it under the terms of the GNU General Public License as published by
7## the Free Software Foundation; either version 3 of the License, or
8## (at your option) any later version.
9##
10## This program is distributed in the hope that it will be useful,
11## but WITHOUT ANY WARRANTY; without even the implied warranty of
12## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13## GNU General Public License for more details.
14##
15## You should have received a copy of the GNU General Public License
16## along with this program; see the file COPYING3.  If not see
17## <http://www.gnu.org/licenses/>.
18##
19
20DOCFILES = \
21          %D%/aoutx.texi \
22          %D%/archive.texi \
23          %D%/archures.texi \
24          %D%/bfdio.texi \
25          %D%/bfdt.texi \
26          %D%/bfdver.texi \
27          %D%/bfdwin.texi \
28          %D%/cache.texi \
29          %D%/coffcode.texi \
30          %D%/corefile.texi \
31          %D%/elfcode.texi \
32          %D%/elf.texi \
33          %D%/format.texi \
34          %D%/hash.texi \
35          %D%/libbfd.texi \
36          %D%/linker.texi \
37          %D%/mmo.texi \
38          %D%/opncls.texi \
39          %D%/reloc.texi \
40          %D%/section.texi \
41          %D%/syms.texi \
42          %D%/targets.texi
43
44# SRCDOC, SRCPROT, SRCIPROT only used to sidestep Sun Make bug in interaction
45# between VPATH and suffix rules.  If you use GNU Make, perhaps other Makes,
46# you don't need these three:
47SRCDOC = \
48          $(srcdir)/aoutx.h $(srcdir)/archive.c \
49          $(srcdir)/archures.c $(srcdir)/bfd.c \
50          $(srcdir)/bfdio.c $(srcdir)/bfdwin.c \
51          $(srcdir)/cache.c $(srcdir)/coffcode.h \
52          $(srcdir)/corefile.c $(srcdir)/elf.c \
53          $(srcdir)/elfcode.h $(srcdir)/format.c \
54          $(srcdir)/libbfd.c $(srcdir)/opncls.c \
55          $(srcdir)/reloc.c $(srcdir)/section.c \
56          $(srcdir)/syms.c $(srcdir)/targets.c \
57          $(srcdir)/hash.c $(srcdir)/linker.c \
58          $(srcdir)/mmo.c
59
60SRCPROT = $(srcdir)/archive.c $(srcdir)/archures.c \
61          $(srcdir)/bfd.c $(srcdir)/coffcode.h $(srcdir)/corefile.c \
62          $(srcdir)/format.c $(srcdir)/libbfd.c \
63          $(srcdir)/bfdio.c $(srcdir)/bfdwin.c \
64          $(srcdir)/opncls.c $(srcdir)/reloc.c \
65          $(srcdir)/section.c $(srcdir)/syms.c \
66          $(srcdir)/targets.c
67
68SRCIPROT = $(srcdir)/cache.c $(srcdir)/libbfd.c \
69          $(srcdir)/bfdio.c $(srcdir)/bfdwin.c \
70          $(srcdir)/reloc.c $(srcdir)/cpu-h8300.c \
71          $(srcdir)/archures.c
72
73TEXIDIR = $(srcdir)/../texinfo/fsf
74
75info_TEXINFOS = %D%/bfd.texi
76%C%_bfd_TEXINFOS = $(DOCFILES) %D%/bfdsumm.texi
77
78AM_MAKEINFOFLAGS = --no-split -I "$(srcdir)/%D%" -I %D%
79TEXI2DVI = texi2dvi -I "$(srcdir)/%D%" -I %D%
80
81MKDOC = %D%/chew$(EXEEXT_FOR_BUILD)
82
83$(MKDOC): %D%/chew.stamp ; @true
84%D%/chew.stamp: $(srcdir)/%D%/chew.c %D%/$(am__dirstamp)
85          $(AM_V_CCLD)$(CC_FOR_BUILD) -o %D%/chw$$$$$(EXEEXT_FOR_BUILD) $(CFLAGS_FOR_BUILD) \
86            $(CPPFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) \
87            -I. -I$(srcdir) -I%D% -I$(srcdir)/../include -I$(srcdir)/../intl -I../intl \
88            $(srcdir)/%D%/chew.c && \
89          $(SHELL) $(srcdir)/../move-if-change \
90            %D%/chw$$$$$(EXEEXT_FOR_BUILD) $(MKDOC) && \
91          touch $@
92
93# We can't replace these rules with an implicit rule, because
94# makes without VPATH support couldn't find the .h files in `..'.
95
96# We do not depend on chew directly so that we can distribute the info
97# files, and permit people to rebuild them, without requiring the makeinfo
98# program.  If somebody tries to rebuild info, but none of the .texi files
99# have changed, then nothing will be rebuilt.
100
101REGEN_TEXI = \
102          ( \
103          set -e; \
104          $(MKDOC) -f $(srcdir)/%D%/doc.str < $< > $@.tmp; \
105          texi=$@; \
106          texi=$${texi%.stamp}.texi; \
107          test -e $$texi || test ! -f $(srcdir)/$$texi || $(LN_S) $(srcdir)/$$texi .; \
108          $(SHELL) $(srcdir)/../move-if-change $@.tmp $$texi; \
109          touch $@; \
110          )
111
112.PRECIOUS: %D%/%.stamp
113%D%/%.texi: %D%/%.stamp ; @true
114%D%/%.stamp: $(srcdir)/%.c $(srcdir)/%D%/doc.str $(MKDOC) %D%/$(am__dirstamp)
115          $(AM_V_GEN)$(REGEN_TEXI)
116%D%/%.stamp: $(srcdir)/%.h $(srcdir)/%D%/doc.str $(MKDOC) %D%/$(am__dirstamp)
117          $(AM_V_GEN)$(REGEN_TEXI)
118
119# Avoid the %.stamp generating a builddir/bfd.texi that overrides the
120# srcdir/ as well as regenerating doc/bfd.info for each make run.
121%D%/bfd.stamp: $(srcdir)/%D%/bfd.texi ; $(AM_V_at)touch $@
122
123# We use bfdt.texi, rather than bfd.texi, to avoid conflicting with
124# bfd.texi on an 8.3 filesystem.
125%D%/bfdt.stamp: $(srcdir)/bfd.c $(srcdir)/%D%/doc.str $(MKDOC) %D%/$(am__dirstamp)
126          @echo "NOT REBUILDING $@"
127NetBSD_DISABLED_bfdt.stamp:
128          $(AM_V_GEN)$(REGEN_TEXI)
129
130%D%/bfdver.texi: $(srcdir)/Makefile.in
131          @echo "NOT REBUILDING $@"
132NetBSD_DISABLED_bfdver.texi:
133          $(AM_V_GEN)\
134          $(MKDIR_P) $(@D); \
135          echo "@set VERSION $(VERSION)" > $@; \
136          if test -n "$(PKGVERSION)"; then \
137            echo "@set VERSION_PACKAGE $(PKGVERSION)" >> $@; \
138          fi; \
139          echo "@set UPDATED `date '+%B %Y'`" >> $@; \
140          if test -n "$(REPORT_BUGS_TEXI)"; then \
141            echo "@set BUGURL $(REPORT_BUGS_TEXI)" >> $@; \
142          fi
143
144noinst_TEXINFOS = %D%/bfdint.texi
145
146MOSTLYCLEANFILES += $(MKDOC) %D%/*.o %D%/*.stamp
147
148DISTCLEANFILES += %D%/bfd.?? %D%/bfd.??? texput.log
149
150MAINTAINERCLEANFILES += $(DOCFILES)
151
152html-local: %D%/bfd/index.html
153%D%/bfd/index.html: %D%/bfd.texi $(bfd_TEXINFOS) %D%/$(am__dirstamp)
154          $(AM_V_at)$(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
155            --split=node -o %D%/bfd $(srcdir)/%D%/bfd.texi
156
157MAINTAINERCLEANFILES += %D%/bfd.info
158