c875c9ab401f1b32c1ca64b07bad518e882210b6
[external/binutils.git] / binutils / Makefile.in
1 # Makefile for GNU binary-file utilities
2 # Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
3
4 # This file is part of GNU binutils.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 VPATH = @srcdir@
21 srcdir = @srcdir@
22
23 target_alias = @target_alias@
24 prefix = @prefix@
25
26 program_transform_name = @program_transform_name@
27 exec_prefix = @exec_prefix@
28 bindir = $(exec_prefix)/bin
29 libdir = $(exec_prefix)/lib
30 tooldir = $(exec_prefix)/$(target_alias)
31
32 datadir = $(prefix)/lib
33 mandir = $(prefix)/man
34 man1dir = $(mandir)/man1
35 man2dir = $(mandir)/man2
36 man3dir = $(mandir)/man3
37 man4dir = $(mandir)/man4
38 man5dir = $(mandir)/man5
39 man6dir = $(mandir)/man6
40 man7dir = $(mandir)/man7
41 man8dir = $(mandir)/man8
42 man9dir = $(mandir)/man9
43 infodir = $(prefix)/info
44 includedir = $(prefix)/include
45 docdir = $(datadir)/doc
46
47 SHELL = /bin/sh
48
49 INSTALL = `cd $(srcdir)/..;pwd`/install.sh -c
50 INSTALL_PROGRAM = $(INSTALL)
51 INSTALL_DATA = $(INSTALL) -m 644
52 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
53 INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 -m 644
54
55 AR = ar
56 AR_FLAGS = rc
57 CC = @CC@
58 CFLAGS = @CFLAGS@
59 LDFLAGS = @LDFLAGS@
60 HLDFLAGS = @HLDFLAGS@
61 RPATH_ENVVAR = @RPATH_ENVVAR@
62 MAKEINFO = makeinfo
63 TEXI2DVI = texi2dvi
64 RANLIB = ranlib
65 BISONFLAGS = -d
66 TEXI2ROFF=texi2roff
67 MAKEOVERRIDES=
68 CC_FOR_BUILD = @CC_FOR_BUILD@
69 NM_FOR_TARGET = nm
70 NM = $(NM_FOR_TARGET)
71 SYMLINK = ln -s
72
73 BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
74 # Comment these out if using lex.
75 LEX_OPTIONS = -I -Cem 
76 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
77
78 # Distribution version
79 VERSION=cygnus-2.6
80 # Distribution name
81 DIST_NAME=binutils-${VERSION}
82
83 # Where to find texinfo.tex to format docn with TeX
84 TEXIDIR = $(srcdir)/../texinfo
85
86 #CC=gcc -Wall
87 CC=cc
88 # these two are almost the same program
89 AR_PROG=ar
90 RANLIB_PROG=ranlib
91
92 # objcopy and strip should be the same program
93 OBJCOPY_PROG=objcopy
94 STRIP_PROG=strip.new
95
96 STRINGS_PROG=strings
97
98 # These should all be the same program too.
99 SIZE_PROG=size
100 NM_PROG=nm.new
101 OBJDUMP_PROG=objdump
102
103 # This is the demangler, as a standalone program.
104 # Note: This one is used as the installed name too, unlike the above.
105 DEMANGLER_PROG=c++filt
106
107 NLMCONV_PROG=nlmconv
108 DLLTOOL_PROG=dlltool
109
110 SRCONV_PROG=srconv sysdump coffdump 
111
112 MANPAGES= ar nm objdump ranlib size strings strip objcopy nlmconv
113
114 PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRINGS_PROG) $(STRIP_PROG) $(RANLIB_PROG) $(DEMANGLER_PROG) $(OBJCOPY_PROG) @BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@
115 STAGESTUFF = $(PROGS) *.o
116 # Files that can be generated, but should be in the distribution.
117 # Don't build $(DEMANGLER_PROG).1, since its name may vary with the
118 # configuration.
119 DISTSTUFF=arparse.c arparse.h arlex.c nlmheader.c sysinfo.c sysinfo.h syslex.c
120
121 # Stuff that goes in tooldir/ if appropriate
122 TOOL_PROGS = nm.new strip.new ar ranlib $(DLLTOOL_PROG)
123
124 BASEDIR = $(srcdir)/..
125 BFDDIR = $(BASEDIR)/bfd
126 INCDIR  = $(BASEDIR)/include
127 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
128 DEP = mkdep
129
130 ALL_CFLAGS = $(INCLUDES) @HDEFINES@ $(CFLAGS)
131
132 HFILES = arsup.h bucomm.h budbg.h coffgrok.h debug.h nlmconv.h
133
134 GENERATED_HFILES = arparse.h sysroff.h sysinfo.h defparse.h
135
136 CFILES = ar.c arsup.c bucomm.c coffdump.c coffgrok.c debug.c dlltool.c \
137         filemode.c ieee.c is-ranlib.c is-strip.c maybe-ranlib.c \
138         maybe-strip.c nlmconv.c nm.c not-ranlib.c not-strip.c \
139         objcopy.c objdump.c prdbg.c rddbg.c size.c srconv.c stabs.c \
140         strings.c sysdump.c version.c
141
142 GENERATED_CFILES = \
143         underscore.c arparse.c arlex.c sysroff.c sysinfo.c syslex.c \
144         defparse.c deflex.c nlmheader.c
145
146 .c.o:
147         $(CC) -c $(ALL_CFLAGS) $<
148
149 DEBUG_OBJS = rddbg.o debug.o stabs.o ieee.o
150
151 LIBIBERTY = ../libiberty/libiberty.a
152
153 # Code shared by all the binutils.
154 BULIBS = bucomm.o version.o filemode.o
155
156 BFDLIB_DEP = ../bfd/libbfd.a
157 BFDLIB = @BFDLIB@
158
159 OPCODES_DEP = ../opcodes/libopcodes.a
160 OPCODES = @OPCODES@
161
162 ADDL_DEPS = $(BULIBS) $(BFDLIB_DEP) $(LIBIBERTY)
163 ADDL_LIBS = $(BULIBS) $(BFDLIB) $(LIBIBERTY) 
164
165 EXPECT = `if [ -f $$r/../expect/expect ] ; then \
166           echo $$r/../expect/expect ; \
167           else echo expect ; fi`
168 RUNTEST = `if [ -f ${srcdir}/../dejagnu/runtest ] ; then \
169            echo ${srcdir}/../dejagnu/runtest ; \
170            else echo runtest ;  fi`
171 RUNTESTFLAGS =
172
173 CC_FOR_TARGET = ` \
174   if [ -f $$r/../gcc/xgcc ] ; then \
175     if [ -f $$r/../newlib/Makefile ] ; then \
176       echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
177     else \
178       echo $$r/../gcc/xgcc -B$$r/../gcc/; \
179     fi; \
180   else \
181     if [ "@host@" = "@target@" ] ; then \
182       echo $(CC); \
183     else \
184       echo gcc | sed '$(program_transform_name)'; \
185     fi; \
186   fi`
187
188 FLAGS_TO_PASS = \
189         "CC=$(CC)" \
190         "CFLAGS=$(CFLAGS)" \
191         "RUNTEST=$(RUNTEST)" \
192         "RUNTESTFLAGS=$(RUNTESTFLAGS)"
193 #\f
194 ## The rules
195
196 all: $(ADDL_DEPS) $(PROGS)
197
198 # These targets are for the dejagnu testsuites. The file site.exp 
199 # contains global variables that all the testsuites will use.
200
201 site.exp: ./config.status Makefile
202         @echo "Making a new config file..."
203         @rm -f ./tmp?
204         @touch site.exp
205         @mv site.exp site.bak
206         @echo "## variables are automatically generated by make ##" > ./tmp0
207         @echo "# Do not edit here. If you wish to override these" >> ./tmp0
208         @echo "# values, add them to the last section" >> ./tmp0
209         @echo "# HOST AND TARGET INFO" >> ./tmp0
210         @echo "set host_os @host_os@" >> ./tmp0
211         @echo "set host_alias @host_alias@" >> ./tmp0
212         @echo "set host_cpu @host_cpu@" >> ./tmp0
213         @echo "set host_vendor @host_vendor@" >> ./tmp0
214         @echo "set target_os @target_os@" >> ./tmp0
215         @echo "set target_alias @target_alias@" >> ./tmp0
216         @echo "set target_cpu @target_cpu@" >> ./tmp0
217         @echo "set target_vendor @target_vendor@" >> ./tmp0
218         @echo "set host_triplet @host@" >> ./tmp0
219         @echo "set target_triplet @target@" >> ./tmp0
220         @echo "# DIRECTORY INFO" >> ./tmp0
221         @echo "set objdir `pwd`" >> ./tmp0
222         @echo "" >> ./tmp0      
223         @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
224         @cat ./tmp0 > site.exp
225         @cat site.bak | sed \
226                         -e '1,/^## Variables generated by.*##/ d' >> site.exp
227         -@rm -f ./tmp?
228
229 check: site.exp
230         r=`pwd`; export r ; \
231         srcroot=`cd ${srcdir}; pwd` ; export srcroot ; \
232         EXPECT=${EXPECT} ; export EXPECT ; \
233         $(RPATH_ENVVAR)=$$r/../bfd:$$r/../opcodes:$$$(RPATH_ENVVAR); \
234         export $(RPATH_ENVVAR); \
235         if [ -f $$r/../expect/expect ] ; then  \
236            TCL_LIBRARY=$${srcroot}/../tcl/library ; \
237            export TCL_LIBRARY ; else true; fi ; \
238         $(RUNTEST) --tool binutils --srcdir $(srcdir)/testsuite \
239           $(RUNTESTFLAGS) CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)"
240
241 installcheck:
242         /bin/sh $(srcdir)/sanity.sh $(bindir)
243
244 info: binutils.info
245
246 dvi: binutils.dvi
247
248 $(SIZE_PROG): $(ADDL_DEPS) size.o
249         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(EXTRALIBS)
250
251 $(OBJCOPY_PROG): $(ADDL_DEPS) objcopy.o not-strip.o $(DEBUG_OBJS)
252         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o not-strip.o $(DEBUG_OBJS) $(ADDL_LIBS) $(EXTRALIBS)
253
254 $(STRINGS_PROG): $(ADDL_DEPS) strings.o
255         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(STRINGS_PROG) strings.o $(ADDL_LIBS) $(EXTRALIBS)
256
257 $(STRIP_PROG): $(ADDL_DEPS) objcopy.o is-strip.o $(DEBUG_OBJS)
258         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(STRIP_PROG) objcopy.o is-strip.o $(DEBUG_OBJS) $(ADDL_LIBS) $(EXTRALIBS)
259
260 $(NM_PROG): $(ADDL_DEPS) nm.o
261         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(EXTRALIBS)
262
263 $(OBJDUMP_PROG): $(ADDL_DEPS) objdump.o prdbg.o $(DEBUG_OBJS) $(OPCODES_DEP)
264         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJDUMP_PROG) objdump.o prdbg.o $(DEBUG_OBJS) $(OPCODES) $(ADDL_LIBS) $(EXTRALIBS)
265
266 underscore.c: stamp-under ; @true
267
268 stamp-under: Makefile
269         echo '/*WARNING: This file is automatically generated!*/' >underscore.t
270         echo "int prepends_underscore = @UNDERSCORE@;" >>underscore.t
271         $(srcdir)/../move-if-change underscore.t underscore.c
272         touch stamp-under
273
274 version.o: version.c Makefile
275         $(CC) -DVERSION='"$(VERSION)"' $(ALL_CFLAGS) -c $(srcdir)/version.c
276
277 cplus-dem.o: $(BASEDIR)/libiberty/cplus-dem.c $(INCDIR)/getopt.h
278         $(CC) -c -DMAIN -DVERSION='"$(VERSION)"' $(ALL_CFLAGS) $(BASEDIR)/libiberty/cplus-dem.c
279
280 $(DEMANGLER_PROG): cplus-dem.o $(LIBIBERTY) underscore.o $(DEMANGLER_PROG).1
281         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(DEMANGLER_PROG) cplus-dem.o $(LIBIBERTY) $(EXTRALIBS) underscore.o
282
283 arparse.c: arparse.y
284         $(BISON) $(BISONFLAGS)  $(srcdir)/arparse.y
285         mv -f y.tab.c arparse.c
286         mv -f y.tab.h arparse.h
287
288 # Separate from arparse.c so that a parallel make doesn't try to build
289 # both arparse.c and arparse.h simultaneously.
290 arparse.h: arparse.c
291
292 arlex.c: arlex.l
293         $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l
294         mv lex.yy.c arlex.c
295
296 $(AR_PROG): $(ADDL_DEPS) ar.o arparse.o arlex.o not-ranlib.o arsup.o
297         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
298
299 $(RANLIB_PROG): $(ADDL_DEPS) ar.o is-ranlib.o arparse.o arlex.o arsup.o
300         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
301
302 # This rule creates a single binary that switches between ar and ranlib
303 # by looking at argv[0].  Use this kludge to save some disk space.
304 # However, you have to install things by hand.
305 # (That is after 'make install', replace the installed ranlib by a link to ar.)
306
307 # Alternatively, you can install ranlib.sh as ranlib.
308
309 ar_with_ranlib: $(ADDL_DEPS) ar.o maybe-ranlib.o
310         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(EXTRALIBS)
311         -rm -f $(RANLIB_PROG)
312         -ln $(AR_PROG) $(RANLIB_PROG)
313
314 # objcopy and strip in one binary that uses argv[0] to decide its action.
315
316 objcopy_with_strip: $(ADDL_DEPS) objcopy.o maybe-strip.o
317         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(OBJCOPY_PROG) objcopy.o maybe-strip.o $(ADDL_LIBS) $(EXTRALIBS)
318         -rm -f $(STRIP_PROG)
319         -ln $(OBJCOPY_PROG) $(STRIP_PROG)
320
321 sysroff.c: sysinfo sysroff.info 
322         ./sysinfo -c <$(srcdir)/sysroff.info >sysroff.c
323         ./sysinfo -i <$(srcdir)/sysroff.info >>sysroff.c
324         ./sysinfo -g <$(srcdir)/sysroff.info >>sysroff.c
325
326 sysroff.h: sysinfo sysroff.info
327         ./sysinfo -d <$(srcdir)/sysroff.info >sysroff.h 
328
329 # Depend upon arparse.c to avoid building both arparse.c and sysinfo.c
330 # simultaneously.
331 sysinfo.c: sysinfo.y arparse.c
332         $(BISON) -tvd $(srcdir)/sysinfo.y
333         rm -f sysinfo.c
334         mv -f y.tab.c sysinfo.c
335         mv -f y.tab.h sysinfo.h
336
337 # Separate from sysinfo.c so that a parallel make doesn't try to build
338 # both sysinfo.c and sysinfo.h simultaneously.
339 sysinfo.h: sysinfo.c
340
341 syslex.c : syslex.l
342         $(LEX) $(LEX_OPTIONS) $(srcdir)/syslex.l
343         mv lex.yy.c syslex.c
344
345 sysinfo: sysinfo.o syslex.o
346         $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o 
347
348 syslex.o: syslex.c sysinfo.h
349         if [ -r syslex.c ]; then \
350           $(CC_FOR_BUILD) -c -I. $(CFLAGS)  syslex.c  ; \
351         else \
352           $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
353         fi
354
355 sysinfo.o: sysinfo.c
356         if [ -r sysinfo.c ]; then \
357           $(CC_FOR_BUILD) -c -I. $(CFLAGS)  sysinfo.c  ; \
358         else \
359           $(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
360         fi
361
362 srconv: srconv.o coffgrok.o $(ADDL_DEPS)
363         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ srconv.o coffgrok.o $(ADDL_LIBS) $(EXTRALIBS)
364
365 dlltool: dlltool.o defparse.o deflex.o cplus-dem.o $(ADDL_DEPS)
366         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ dlltool.o defparse.o deflex.o $(ADDL_LIBS) $(EXTRALIBS)
367
368 defparse.c:defparse.y
369         $(BISON)  $(BISONFLAGS)  $(srcdir)/defparse.y
370         mv -f y.tab.c defparse.c
371         mv -f y.tab.h defparse.h
372
373 defparse.h: defparse.c
374
375 deflex.c:deflex.l
376         $(LEX) $(LEX_OPTIONS) $(srcdir)/deflex.l
377         mv lex.yy.c deflex.c
378
379 dlltool.o:dlltool.c
380         $(CC) -c @DLLTOOL_DEFS@ $(ALL_CFLAGS) $(srcdir)/dlltool.c
381
382 coffdump: coffdump.o coffgrok.o $(ADDL_DEPS)
383         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@  coffdump.o coffgrok.o $(ADDL_LIBS) $(EXTRALIBS)
384
385 sysdump: sysdump.o $(ADDL_DEPS)
386         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ sysdump.o $(ADDL_LIBS) $(EXTRALIBS)
387
388 # Depend upon sysinfo.c to avoid building both nlmheader.c and sysinfo.c
389 # simultaneously.
390 nlmheader.c: nlmheader.y sysinfo.c
391         $(BISON) $(srcdir)/nlmheader.y
392         rm -f nlmheader.c
393         mv -f y.tab.c nlmheader.c
394
395 # coff/sym.h and coff/ecoff.h won't be found by the automatic dependency
396 # scripts, since they are only included conditionally.
397 nlmconv.o: nlmconv.c $(INCDIR)/coff/sym.h $(INCDIR)/coff/ecoff.h
398         ldname=`echo ld | sed '$(program_transform_name)'`; \
399         $(CC) -c -DLD_NAME="\"$${ldname}\"" @NLMCONV_DEFS@ $(ALL_CFLAGS) $(srcdir)/nlmconv.c
400
401 $(NLMCONV_PROG): nlmconv.o nlmheader.o $(ADDL_DEPS)
402         $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ nlmconv.o nlmheader.o $(ADDL_LIBS) $(EXTRALIBS)
403
404 # Targets to rebuild dependencies in this Makefile.
405 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
406 .dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
407         rm -f .dep1
408         $(MAKE) DEP=$(DEP) .dep1
409         sed -f dep.sed <.dep1 >.dep
410
411 # This rule really wants a mkdep that runs "gcc -MM".
412 .dep1: $(CFILES) $(GENERATED_CFILES)
413         rm -f .dep2
414         echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
415         $(DEP) -f .dep2 $(ALL_CFLAGS) $?
416         $(srcdir)/../move-if-change .dep2 .dep1
417
418 dep.sed: dep-in.sed config.status
419         sed <$(srcdir)/dep-in.sed >dep.sed      \
420                 -e 's!@INCDIR@!$(INCDIR)!'      \
421                 -e 's!@SRCDIR@!$(srcdir)!'
422
423 dep: .dep
424         sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
425         cat .dep >> tmp-Makefile
426         $(srcdir)/../move-if-change tmp-Makefile Makefile
427
428 dep-in: .dep
429         sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
430         cat .dep >> tmp-Makefile.in
431         $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
432
433 .PHONY: dep dep-in
434
435 ###
436 # DOCUMENTATION TARGETS
437 config.texi: Makefile
438         rm -f config.texi
439         echo '@set VERSION $(VERSION)' > config.texi
440 # TeX output
441 binutils.dvi: $(srcdir)/binutils.texi config.texi
442         TEXINPUTS=$(TEXIDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/binutils.texi
443
444 # info file for online browsing
445 binutils.info: $(srcdir)/binutils.texi config.texi
446         $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi
447
448 $(DEMANGLER_PROG).1: cxxfilt.man Makefile
449         sed -e 's/@PROGRAM@/$(DEMANGLER_PROG)/' < $(srcdir)/cxxfilt.man \
450                 > $(DEMANGLER_PROG).1
451
452 #   different targets for -ms, -mm, -me
453 # Try to use a recent texi2roff.  v2 was put on prep in jan91.
454 # If you want an index, see texi2roff doc for postprocessing 
455 # and add -i to texi2roff invocations below.
456 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
457 #    corresponding -e lines when later texi2roff's are current)
458 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
459 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
460 # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
461 # + @alphaenumerate is ridiculously new, turned into @enumerate
462
463 # roff output (-ms)
464 binutils.ms: $(srcdir)/binutils.texi
465         sed -e '/\\input texinfo/d' \
466                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
467                 -e '/^@ifinfo/,/^@end ifinfo/d' \
468                 -e '/^@c/d' \
469                 -e 's/{.*,,/{/' \
470                 -e 's/@ / /g' \
471                 -e 's/^@alphaenumerate/@enumerate/g' \
472                 -e 's/^@end alphaenumerate/@end enumerate/g' \
473                 $(srcdir)/binutils.texi | \
474         $(TEXI2ROFF) -ms | \
475         sed -e 's/---/\\(em/g' \
476         >binutils.ms 
477
478 # roff output (-mm)
479 # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, 
480 #   try leaving them in
481 binutils.mm: $(srcdir)/binutils.texi
482         sed -e '/\\input texinfo/d' \
483                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
484                 -e '/^@ifinfo/,/^@end ifinfo/d' \
485                 -e '/^@c/d' \
486                 -e 's/{.*,,/{/' \
487                 -e '/@noindent/d' \
488                 -e 's/@ / /g' \
489                 -e 's/^@alphaenumerate/@enumerate/g' \
490                 -e 's/^@end alphaenumerate/@end enumerate/g' \
491                 $(srcdir)/binutils.texi | \
492         $(TEXI2ROFF) -mm | \
493         sed -e 's/---/\\(em/g' \
494                 >binutils.mm
495
496 # roff output (-me)
497 binutils.me: $(srcdir)/binutils.texi
498         sed -e '/\\input texinfo/d' \
499                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
500                 -e '/^@ifinfo/,/^@end ifinfo/d' \
501                 -e '/^@c/d' \
502                 -e 's/{.*,,/{/' \
503                 -e 's/@ / /g' \
504                 -e 's/^@alphaenumerate/@enumerate/g' \
505                 -e 's/^@end alphaenumerate/@end enumerate/g' \
506                 $(srcdir)/binutils.texi | \
507         $(TEXI2ROFF) -me | \
508         sed -e 's/---/\\(em/g' \
509         >binutils.me 
510
511
512 ###
513
514 mostlyclean:
515         -rm -f *.o *~ \#* core binutils.?? binutils.??? y.output config.log
516         -rm -rf tmpdir
517 clean: mostlyclean
518         -rm -f $(PROGS) $(DEMANGLER_PROG).1 stamp-under
519         -rm -f underscore.c sysroff sysroff.c sysroff.h sysinfo dep.sed
520 distclean:
521         -rm -f Makefile config.status *.o *~ \#* core y.*
522         -rm -f binutils.?? binutils.??s binutils.aux binutils.log binutils.toc
523         -rm -f $(PROGS) underscore.c config.h stamp-h config.cache config.log
524         -rm -f dep.sed stamp-under $(DEMANGLER_PROG).1
525 maintainer-clean realclean: clean distclean
526         @echo "This command is intended for maintainers to use;"
527         @echo "it deletes files that may require special tools to rebuild."
528         -rm -f $(DISTSTUFF) *.info TAGS
529
530 etags tags: TAGS
531
532 TAGS: force
533         etags $(INCDIR)/*.h $(srcdir)/*.[hc] 
534
535 install: all
536         for i in $(PROGS) ; do \
537           $(INSTALL_XFORM) $$i $(bindir)/`echo $$i | sed -e 's/.new//'` ; \
538         done
539         for i in $(MANPAGES) ; do \
540           $(INSTALL_XFORM1) $(srcdir)/$$i.1 $(man1dir)/$$i.1 ; \
541         done
542         if [ x$(DEMANGLER_PROG) != x ]; then \
543           $(INSTALL_XFORM1) $(DEMANGLER_PROG).1 $(man1dir)/$(DEMANGLER_PROG).1; \
544         fi
545         -if [ -d $(tooldir) ]; then \
546           if [ -d $(tooldir)/bin ]; then true; else mkdir $(tooldir)/bin; fi; \
547           for i in $(TOOL_PROGS) ; do \
548             if [ -f $$i ]; then \
549               j=`echo $$i | sed -e 's/.new//'`; \
550               rm -f $(tooldir)/bin/$$j; \
551               k=`echo $$j | sed '$(program_transform_name)'`; \
552               ln $(bindir)/$$k $(tooldir)/bin/$$j >/dev/null 2>/dev/null \
553                 || $(INSTALL_PROGRAM) $$i $(tooldir)/bin/$$j; \
554             fi; \
555           done; \
556          else true; fi
557
558 # This little path search is required because in the FSF net releases,
559 # the info files are included in the source tree, and that may not be
560 # the same as the build directory.
561 install-info: binutils.info
562         if [ -r binutils.info ]; then \
563           dir=. ; \
564         else \
565           dir=$(srcdir) ; \
566         fi ; \
567         for i in `cd $$dir; echo binutils.info*` ; do \
568                 $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
569         done
570
571 clean-info:
572         -rm -rf *.info*
573
574 # Making a dist:
575 # cvs rtag binutils-x-yy ld+utils
576 # cvs co -r binutils-x-yy ld+utils
577 # Sanitize
578 # cd {HERE}; make dist [-f Makefile.in]
579
580 dist: $(DIST_NAME).tar.z
581
582 diststuff: $(DISTSTUFF) info
583
584 $(DIST_NAME).tar.z:
585         cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME)
586         make diststuff -f Makefile.in
587         cd ../ld; make diststuff -f Makefile.in
588         cd ../gprof; make diststuff -f Makefile.in
589         cd ../texinfo; mv texinfo.tex ..; rm -rf *; mv ../texinfo.tex .
590         # Take out texinfo from configurable dirs
591         mv ../configure.in tmp; \
592           sed -e '/^host_tools=/s/texinfo //' <tmp >../configure.in; rm tmp
593         cd ..; chmod og=u `find . -print`
594         cd ../..; tar chf - $(DIST_NAME) | gzip >$(DIST_NAME).tar.z
595         rm -rf ../../$(DIST_NAME)
596
597 #-----------------------------------------------------------------------------
598 #               'STANDARD' GNU/960 TARGETS BELOW THIS POINT
599 #
600 # 'VERSION' file must be present and contain a string of the form "x.y"
601 #-----------------------------------------------------------------------------
602
603 ver960.c: FORCE
604         rm -f ver960.c
605         echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
606
607
608 # Dummy target to force execution of dependent targets.
609 #
610 force:
611
612 # Target to uncomment host-specific lines in this makefile.  Such lines must
613 # have the following string beginning in column 1: #__<hostname>__#
614 # Original Makefile is backed up as 'Makefile.old'.
615 #
616 # Invoke with:  make make HOST=xxx
617 #
618 make:
619         -@if test $(HOST)x = x ; then \
620                 echo '\aSpecify "make make HOST=???"'; \
621                 exit 1; \
622         fi ; \
623         grep -s "^#The next line was generated by 'make make'" Makefile; \
624         if test $$? = 0 ; then  \
625                 echo "\aMakefile has already been processed with 'make make'";\
626                 exit 1; \
627         fi ; \
628         mv -f Makefile Makefile.old; \
629         echo "#The next line was generated by 'make make'"       >Makefile ; \
630         echo "HOST=$(HOST)"                                     >>Makefile ; \
631         echo                                                    >>Makefile ; \
632         sed "s/^#__$(HOST)__#//" < Makefile.old                 >>Makefile
633
634 Makefile: Makefile.in config.status
635         CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
636
637 config.h: stamp-h ; @true
638 stamp-h: config.in config.status
639         CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
640
641 config.status: configure $(srcdir)/../bfd/configure.host $(srcdir)/../bfd/config.bfd
642         $(SHELL) ./config.status --recheck
643
644 # What appears below is generated by a hacked mkdep using gcc -MM.
645
646 # DO NOT DELETE THIS LINE -- mkdep uses it.
647 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
648
649 ar.o: ar.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
650   $(INCDIR)/libiberty.h $(INCDIR)/progress.h bucomm.h \
651   config.h $(INCDIR)/fopen-same.h $(INCDIR)/aout/ar.h \
652   ../bfd/libbfd.h arsup.h
653 arsup.o: arsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
654   $(INCDIR)/obstack.h arsup.h $(INCDIR)/libiberty.h bucomm.h \
655   config.h $(INCDIR)/fopen-same.h
656 bucomm.o: bucomm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
657   $(INCDIR)/obstack.h $(INCDIR)/libiberty.h bucomm.h \
658   config.h $(INCDIR)/fopen-same.h
659 coffdump.o: coffdump.c coffgrok.h bucomm.h config.h \
660   $(INCDIR)/fopen-same.h
661 coffgrok.o: coffgrok.c bucomm.h config.h $(INCDIR)/fopen-same.h \
662   $(INCDIR)/coff/internal.h ../bfd/libcoff.h $(INCDIR)/bfdlink.h \
663   coffgrok.h
664 debug.o: debug.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
665   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
666   $(INCDIR)/libiberty.h debug.h
667 dlltool.o: dlltool.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
668   $(INCDIR)/obstack.h $(INCDIR)/libiberty.h bucomm.h \
669   config.h $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h \
670   $(INCDIR)/demangle.h
671 filemode.o: filemode.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
672   $(INCDIR)/obstack.h
673 ieee.o: ieee.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
674   $(INCDIR)/ieee.h bucomm.h config.h $(INCDIR)/fopen-same.h \
675   $(INCDIR)/libiberty.h debug.h budbg.h
676 is-ranlib.o: is-ranlib.c
677 is-strip.o: is-strip.c
678 maybe-ranlib.o: maybe-ranlib.c
679 maybe-strip.o: maybe-strip.c
680 nlmconv.o: nlmconv.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
681   $(INCDIR)/obstack.h $(INCDIR)/libiberty.h bucomm.h \
682   config.h $(INCDIR)/fopen-same.h ../bfd/libnlm.h $(INCDIR)/nlm/common.h \
683   $(INCDIR)/nlm/internal.h $(INCDIR)/nlm/external.h nlmconv.h
684 nm.o: nm.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
685   $(INCDIR)/progress.h bucomm.h config.h $(INCDIR)/fopen-same.h \
686   $(INCDIR)/getopt.h $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def \
687   $(INCDIR)/aout/ranlib.h $(INCDIR)/demangle.h $(INCDIR)/libiberty.h
688 not-ranlib.o: not-ranlib.c
689 not-strip.o: not-strip.c
690 objcopy.o: objcopy.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
691   $(INCDIR)/obstack.h $(INCDIR)/progress.h bucomm.h config.h \
692   $(INCDIR)/fopen-same.h $(INCDIR)/getopt.h $(INCDIR)/libiberty.h \
693   budbg.h
694 objdump.o: objdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
695   $(INCDIR)/obstack.h $(INCDIR)/getopt.h $(INCDIR)/progress.h \
696   bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/dis-asm.h \
697   $(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/aout/aout64.h \
698   $(INCDIR)/aout/stab.def
699 prdbg.o: prdbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
700   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
701   $(INCDIR)/libiberty.h debug.h budbg.h
702 rddbg.o: rddbg.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
703   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
704   $(INCDIR)/libiberty.h debug.h budbg.h
705 size.o: size.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
706   $(INCDIR)/getopt.h bucomm.h config.h $(INCDIR)/fopen-same.h \
707   $(INCDIR)/libiberty.h
708 srconv.o: srconv.c bucomm.h config.h $(INCDIR)/fopen-same.h \
709   sysroff.h coffgrok.h $(INCDIR)/coff/internal.h ../bfd/libcoff.h \
710   $(INCDIR)/bfdlink.h sysroff.c
711 stabs.o: stabs.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
712   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
713   $(INCDIR)/libiberty.h debug.h budbg.h $(INCDIR)/aout/aout64.h \
714   $(INCDIR)/aout/stab_gnu.h $(INCDIR)/aout/stab.def
715 strings.o: strings.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
716   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
717   $(INCDIR)/libiberty.h
718 sysdump.o: sysdump.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
719   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
720   sysroff.h sysroff.c
721 version.o: version.c
722 underscore.o: underscore.c
723 arparse.o: arparse.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
724   $(INCDIR)/obstack.h bucomm.h config.h $(INCDIR)/fopen-same.h \
725   arsup.h
726 arlex.o: arlex.c arparse.h
727 sysroff.o: sysroff.c
728 sysinfo.o: sysinfo.c
729 syslex.o: syslex.c sysinfo.h
730 defparse.o: defparse.c
731 deflex.o: deflex.c defparse.h
732 nlmheader.o: nlmheader.c ../bfd/bfd.h $(INCDIR)/obstack.h \
733   bucomm.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/nlm/common.h \
734   $(INCDIR)/nlm/internal.h nlmconv.h
735
736 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY