add comments re stub types
[external/binutils.git] / ld / Makefile.in
1 # Makefile for the GNU linker ld (version 2)
2 # Copyright (C) 1989-1992 Free Software Foundation, Inc.
3
4 # This file is part of GNU ld..
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., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20
21 srcdir = .
22
23 prefix = /usr/local
24
25 program_transform_name =
26 exec_prefix = $(prefix)
27 bindir = $(exec_prefix)/bin
28 libdir = $(exec_prefix)/lib
29 tooldir = $(exec_prefix)/$(target_alias)
30 datadir = $(prefix)/lib
31 mandir = $(prefix)/man
32 man1dir = $(mandir)/man1
33 man2dir = $(mandir)/man2
34 man3dir = $(mandir)/man3
35 man4dir = $(mandir)/man4
36 man5dir = $(mandir)/man5
37 man6dir = $(mandir)/man6
38 man7dir = $(mandir)/man7
39 man8dir = $(mandir)/man8
40 man9dir = $(mandir)/man9
41 infodir = $(prefix)/info
42 includedir = $(prefix)/include
43 docdir = $(datadir)/doc
44 # We put the scripts in the directory $(scriptdir)/ldscripts.
45 # We can't put the scripts in $(datadir) because the SEARCH_DIR
46 # directives need to be different for native and cross linkers.
47 scriptdir = $(tooldir)/lib
48
49 gcclibdir = $(libdir)/gcc/$(target_alias)
50
51 SHELL = /bin/sh
52
53 INSTALL = `cd $(srcdir); pwd`/../install.sh -c
54 INSTALL_PROGRAM = $(INSTALL)
55 INSTALL_DATA = $(INSTALL)
56 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
57 INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
58
59 AR = ar
60 AR_FLAGS = qv
61 CFLAGS = -g
62 MAKEINFO = makeinfo
63 TEXI2DVI = texi2dvi
64 RANLIB = ranlib
65 CC_FOR_BUILD=$(CC)
66 BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
67 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ;  else echo flex ; fi`
68
69 #version=/`./../gcc/gcc -dumpversion`
70 version=
71
72 # Seach path to override the default search path for -lfoo libraries.
73 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
74 # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
75 # a cross-linker, in which case the default is empty.  See genscripts.sh.)
76 # Otherwise, they are replaced with the ones given in LIB_PATH,
77 # which may have the form: LIB_PATH=/lib:/usr/local/lib
78 LIB_PATH =
79
80 BASEDIR = ../..
81 INCLUDE = $(srcdir)/../include
82 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../bfd -I../bfd -I$(INCLUDE) 
83
84 # What version of the manual to build
85 DOCVER = gen
86
87 # Where to find texinfo.tex to format docn with TeX
88 TEXIDIR = $(srcdir)/../texinfo/fsf
89
90 # Whether to get roff to put indexing entries on stderr
91 TEXI2OPT =
92 # You neeed this to generate ld-index.ms (or .mm or .me)
93 # TEXI2OPT = -i
94
95 TEXI2ROFF=texi2roff
96
97 # Which roff program to use to generate index for texi2roff'd doc
98 ROFF = groff
99
100 #stuff for self hosting (can be overridden in config file).
101 HOSTING_CRT0=/lib/crt0.o
102 HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi`  -lc
103 HOSTING_EMU=-m $(EMUL)
104
105 C++ = g++ -fgnu-linker
106
107 all:
108
109 ### Host, target, and site specific Makefile fragments come in here.
110 ####
111
112 LINTFLAGS =  $(INCLUDES) $(EXTRA_DEF) 
113
114 # The .cc suffix is used by `make check'.
115
116 .SUFFIXES: .y $(SUFFIXES) .cc
117
118 # Suppress smart makes who think they know how to automake Yacc files
119 .y.c:
120
121 .cc.o:
122         $(C++) -c -I$(srcdir) $(CFLAGS) $<
123
124 .c.o:
125         $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $<
126
127 # go directly to ld.new in case this ld isn't capable of
128 # linking native object on this host.  It can be renamed on
129 # install.
130 LD_PROG = ld.new
131
132 # for self hosting
133 BFDLIB=./../bfd/libbfd.a
134 LIBIBERTY=./../libiberty/libiberty.a
135
136 ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
137         em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
138         em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \
139         em_m68kcoff.o em_st2000.o em_sa29200.o \
140         em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
141         em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
142         em_hppaosf.o em_mipsidtl.o em_sh.o \
143         $(OTHER_EMULATIONS)
144
145 EMULATION_OFILES=${ALL_EMULATIONS}
146
147 OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
148         ldwarn.o ldwrite.o ldexp.o  ldemul.o ldver.o ldmisc.o ldsym.o \
149         ldfile.o relax.o  lderror.o ${EMULATION_OFILES}
150
151 HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
152         ldsym.h ldctor.h ldlang.h ldexp.h \
153         ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
154
155 MANSOURCES=ld.tex
156
157 LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
158         em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \
159         ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
160         relax.c lderror.c
161
162 GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h
163 GENERATED_HEADERS=ldgram.h ldemul-list.h
164
165 LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
166
167 BFDSOURCES=../../bfd/common/*.c
168
169 SOURCES= $(LDSOURCES) $(BFDSOURCES)
170 LINTSOURCES=   $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
171
172 STAGESTUFF = ldscripts/* $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES)
173
174 all: $(LD_PROG)
175
176 info: ld.info
177
178 ldgram.h ldgram.c: ldgram.y
179         $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
180         mv -f y.tab.c ldgram.c
181         mv -f y.tab.h ldgram.h
182
183 # EMUL is the name of a file in the emulparams subdir, without the .sh.
184 DEF_EMUL = ` if [ -z "$(EMUL)" ] ; then \
185                echo "you must set a default emulation" 1>&2 ; \
186                exit 1 ; \
187              else \
188                echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \
189              fi`
190
191 ldmain.o: ldmain.c
192         $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $<
193
194 ldemul-list.h: Makefile
195         (echo "/* This file is automatically generated.  DO NOT EDIT! */";\
196         for f in `echo " " ${EMULATION_OFILES} "" \
197          | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
198             echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
199         done;\
200         echo "";\
201         echo "#define EMULATION_LIST \\";\
202         for f in `echo " " ${EMULATION_OFILES} "" \
203          | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
204             echo "  &ld_$${f}_emulation, \\"; \
205         done;\
206         echo "  0") >ldemul-list.h
207
208 ldemul.o: ldemul-list.h
209
210 ldlex.c: ldlex.l ldgram.h
211         $(LEX) -I -Cem $(srcdir)/ldlex.l
212         mv lex.yy.c ldlex.c
213
214 # These all start with em_ so 'make clean' can find them.
215
216 GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL}
217 GEN_DEPENDS=$(srcdir)/genscripts.sh
218
219 em_sun4.c: $(srcdir)/emulparams/sun4.sh \
220   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
221         ${GENSCRIPTS} sun4
222 em_sun3.c: $(srcdir)/emulparams/sun3.sh \
223   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
224         ${GENSCRIPTS} sun3
225 em_go32.c: $(srcdir)/emulparams/go32.sh \
226   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
227         ${GENSCRIPTS} go32
228 em_news.c: $(srcdir)/emulparams/news.sh \
229   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
230         ${GENSCRIPTS} news
231 em_vax.c: $(srcdir)/emulparams/vax.sh \
232   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
233         ${GENSCRIPTS} vax
234 em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
235   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
236         ${GENSCRIPTS} hp300bsd
237 em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
238   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
239         ${GENSCRIPTS} hp3hpux
240 em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \
241   $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS}
242         ${GENSCRIPTS} hppaosf
243 em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \
244   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
245         ${GENSCRIPTS} i386aout
246 em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
247   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
248         ${GENSCRIPTS} ebmon29k
249 em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \
250   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
251         ${GENSCRIPTS} sa29200
252 em_a29k.c: $(srcdir)/emulparams/a29k.sh \
253   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
254         ${GENSCRIPTS} a29k
255 em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
256   $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
257         ${GENSCRIPTS} m88kbcs
258 em_h8300.c: $(srcdir)/emulparams/h8300.sh \
259   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
260         ${GENSCRIPTS} h8300
261 em_h8300h.c: $(srcdir)/emulparams/h8300h.sh \
262   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
263         ${GENSCRIPTS} h8300h
264 em_h8500.c: $(srcdir)/emulparams/h8500.sh \
265   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
266         ${GENSCRIPTS} h8500
267 em_sh.c: $(srcdir)/emulparams/sh.sh \
268   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
269         ${GENSCRIPTS} sh
270 em_st2000.c: $(srcdir)/emulparams/st2000.sh \
271   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
272         ${GENSCRIPTS} st2000
273 em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
274   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
275         ${GENSCRIPTS} z8ksim
276 em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \
277   $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
278         ${GENSCRIPTS} vanilla
279 em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \
280   $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
281         ${GENSCRIPTS} lnk960
282 em_gld960.c: $(srcdir)/emulparams/gld960.sh \
283   $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
284         ${GENSCRIPTS} gld960
285 em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
286   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
287         ${GENSCRIPTS} m68kcoff
288 em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \
289   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
290         ${GENSCRIPTS} i386coff
291 em_mipslit.c:  $(srcdir)/emulparams/mipslit.sh \
292   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
293         ${GENSCRIPTS} mipslit
294 em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
295   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
296         ${GENSCRIPTS} i386bsd
297 em_mipsbig.c:  $(srcdir)/emulparams/mipsbig.sh \
298   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
299         ${GENSCRIPTS} mipsbig
300 em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
301   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
302         ${GENSCRIPTS} mipsbsd
303 em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
304   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
305         ${GENSCRIPTS} mipsidt
306 em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
307   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
308         ${GENSCRIPTS} mipsidtl
309
310 $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
311         $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) $(CFLAGS)
312
313 # START OF CHECK TARGETS
314 site.exp: ./config.status Makefile
315         @echo "Making a new config file..."
316         -@rm -f ./tmp?
317         @touch site.exp
318
319         -@mv site.exp site.bak
320         @echo "## variables are automatically generated by make ##" > ./tmp0
321         @echo "# Do not edit here. If you wish to override these" >> ./tmp0
322         @echo "# values, add them to the last section" >> ./tmp0
323         @echo "set host_os ${host_os}" >> ./tmp0
324         @echo "set host_alias ${host_alias}" >> ./tmp0
325         @echo "set host_cpu ${host_cpu}" >> ./tmp0
326         @echo "set host_vendor ${host_vendor}" >> ./tmp0
327         @echo "set target_os ${target_os}" >> ./tmp0
328         @echo "set target_alias ${target_alias}" >> ./tmp0
329         @echo "set target_cpu ${target_cpu}" >> ./tmp0
330         @echo "set target_vendor ${target_vendor}" >> ./tmp0
331         @echo "set host_triplet ${host_canonical}" >> ./tmp0
332         @echo "set target_triplet ${target_canonical}" >> ./tmp0
333         @echo "set srcdir ${srcdir}/testsuite" >> ./tmp0
334         @echo "set objdir `pwd`" >> ./tmp0
335         @echo "set tool ld" >> ./tmp0
336         @echo "" >> ./tmp0      
337         @echo "# LD DEPENDANCIES" >> ./tmp0     
338         @echo "set OFILES \"${OFILES}\"" >> ./tmp0
339         @echo "set BFDLIB \"${BFDLIB}\"" >> ./tmp0
340         @echo "set LIBIBERTY \"${LIBIBERTY}\"" >> ./tmp0
341         @echo "set HOSTING_EMU \"${HOSTING_EMU}\"" >> ./tmp0
342         @echo "set HOSTING_CRT0 \"${HOSTING_CRT0}\"" >> ./tmp0
343         @echo "set HOSTING_LIBS \"${HOSTING_LIBS}\"" >> ./tmp0
344         @echo "" >> ./tmp0      
345         @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
346         @cat ./tmp0 > site.exp
347         @cat site.bak | sed \
348                         -e '1,/^## Variables generated by.*##/ d' >> site.exp
349         -@rm -f ./tmp?
350
351 check: bootstrap check-cdtest
352
353 new-check: ld.new site.exp
354         $(RUNTEST) $(RUNTESTFLAGS)
355
356 installcheck:
357
358 # Rules for testing by relinking ld itself.
359
360 ld-partial.o: ld.new
361         ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
362 ld1: ld-partial.o
363         ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
364
365 ld1-full: ld.new
366         ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
367
368 ld2: ld1
369         ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
370
371 ld3: ld2
372         ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
373
374 bootstrap: ld3
375         cmp ld2 ld3
376
377 # A test program for C++ constructors and destructors.
378
379 cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new
380         ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
381           cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS)
382
383 check-cdtest: cdtest $(srcdir)/cdtest.exp
384         ./cdtest >cdtest.out
385         diff $(srcdir)/cdtest.exp cdtest.out
386 # END OF CHECK TARGETS
387
388 # DOCUMENTATION TARGETS
389 # Manual configuration file; not usually attached to normal configuration,
390 # because almost all configs use "gen" version of manual.
391 #  Set DOCVER above to change.
392 configdoc.texi: ${DOCVER}-doc.texi
393         ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
394         ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
395         cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
396
397 # TeX output
398 dvi: ld.dvi
399 ld.dvi: $(srcdir)/ld.texinfo
400         $(TEXI2DVI) $(srcdir)/ld.texinfo
401
402 ldint.dvi: $(srcdir)/ldint.texinfo
403         $(TEXI2DVI) $(srcdir)/ldint.texinfo
404
405 # info file for online browsing
406 ld.info: $(srcdir)/ld.texinfo configdoc.texi
407         $(MAKEINFO) -I$(srcdir)/../bfd/doc -o ld.info $(srcdir)/ld.texinfo
408
409 ldint.info: $(srcdir)/ldint.texinfo
410         $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
411
412 #separate targets for "ms", "me", and "mm" forms of roff doc
413 # Try to use a recent texi2roff.  v2 was put on prep in jan91.
414 # If you want an index, see texi2roff doc for postprocessing 
415 # and add -i to texi2roff invocations below.
416 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
417 #    correspondint -e lines when later texi2roff's are current)
418 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
419 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
420 # + @   (that's at-BLANK) not recognized by texi2roff, turned into blank
421 # + @alphaenumerate is ridiculously new, turned into @enumerate
422
423 ld.ms: $(srcdir)/ld.texinfo
424         sed -e '/\\input texinfo/d' \
425                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
426                 -e '/^@ifinfo/,/^@end ifinfo/d' \
427                 -e '/^@c/d' \
428                 -e 's/{.*,,/{/' \
429                 -e 's/@ / /g' \
430                 -e 's/^@alphaenumerate/@enumerate/g' \
431                 -e 's/^@end alphaenumerate/@end enumerate/g' \
432                 $(srcdir)/ld.texinfo | \
433         $(TEXI2ROFF) $(TEXI2OPT) -ms | \
434         sed -e 's/---/\\(em/g' \
435                 >>ld.ms 
436
437 # index for roff output
438 ld-index.ms: ld.ms
439         $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
440                 sed -e '/: warning:/d' | \
441                 texi2index >ld-index.ms
442
443 # roff output (-mm)
444 ld.mm: $(srcdir)/ld.texinfo
445         sed -e '/\\input texinfo/d' \
446                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
447                 -e '/^@ifinfo/,/^@end ifinfo/d' \
448                 -e '/^@c/d' \
449                 -e 's/{.*,,/{/' \
450                 -e '/@noindent/d' \
451                 -e 's/@ / /g' \
452                 -e 's/^@alphaenumerate/@enumerate/g' \
453                 -e 's/^@end alphaenumerate/@end enumerate/g' \
454                 $(srcdir)/ld.texinfo | \
455         $(TEXI2ROFF) $(TEXI2OPT) -mm | \
456         sed -e 's/---/\\(em/g' \
457         >ld.mm 
458
459 # index for roff output
460 ld-index.mm: ld.mm
461         $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
462                 sed -e '/: warning:/d' | \
463                 texi2index >ld-index.mm
464
465 # roff output (-me)
466 ld.me: $(srcdir)/ld.texinfo
467         sed -e '/\\input texinfo/d' \
468                 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
469                 -e '/^@ifinfo/,/^@end ifinfo/d' \
470                 -e '/^@c/d' \
471                 -e 's/{.*,,/{/' \
472                 -e 's/@ / /g' \
473                 -e 's/^@alphaenumerate/@enumerate/g' \
474                 -e 's/^@end alphaenumerate/@end enumerate/g' \
475                 $(srcdir)/ld.texinfo | \
476         $(TEXI2ROFF) $(TEXI2OPT) -me | \
477         sed -e 's/---/\\(em/g' \
478                 >>ld.me 
479
480 # index for roff output
481 ld-index.me: ld.me
482         $(ROFF) -me ld.me 2>&1 1>/dev/null | \
483                 sed -e '/: warning:/d' | \
484                 texi2index >ld-index.me
485
486
487 ldlex.o: ldlex.c ldgram.h
488 ldgram.o: ldgram.c
489 ldexp.o: ldexp.c ldgram.h
490 ldctor.o: ldctor.c ldgram.h
491 ldlang.o: ldlang.c ldgram.h
492 ldmain.o: ldmain.c ldgram.h
493 ldwrite.o: ldwrite.c ldgram.h
494 lexsup.o: lexsup.c ldgram.h
495 mri.o: mri.c ldgram.h
496 relax.o: relax.c ldgram.h
497
498 h8300.o:h8300.c
499 h8300xray.o:h8300xray.c
500 st2000.o:st2000.c
501 z8ksim.o:z8ksim.c
502
503 stage1: force
504         -mkdir stage1
505         -mv -f $(STAGESTUFF) $(LD_PROG) stage1
506         -(cd stage1 ; ln -s $(LD_PROG) ld)
507
508 stage2: force
509         -mkdir stage2
510         -mv -f $(STAGESTUFF) $(LD_PROG) stage2
511         -(cd stage2 ; ln -s $(LD_PROG) ld)
512
513 stage3: force
514         -mkdir stage3
515         -mv -f $(STAGESTUFF) $(LD_PROG) stage3
516         -(cd stage3 ; ln -s $(LD_PROG) ld)
517
518 against=stage2
519
520 comparison: force
521         for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
522
523 de-stage1: force
524         -(cd stage1 ; mv -f * ..)
525         -rm ld
526         -rmdir stage1
527
528 de-stage2: force
529         -(cd stage2 ; mv -f * ..)
530         -rm ld
531         -rmdir stage2
532
533 de-stage3: force
534         -(cd stage3 ; mv -f * ..)
535         -rm ld
536         -rmdir stage3
537
538 # Stuff that should be included in a distribution:
539 LDDISTSTUFF=ldgram.c ldgram.h ldlex.c
540 diststuff: $(LDDISTSTUFF)
541
542 mostlyclean:
543         -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
544         -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out
545 clean: mostlyclean
546         -rm -f $(LD_PROG)
547 distclean: clean
548         -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp
549 realclean: distclean
550         -rm -f $(LDDISTSTUFF)
551
552 lintlog:$(SOURCES) Makefile
553         $(LINT) -abhxzn  $(LINTFLAGS)  $(LINTSOURCES) \
554 | grep -v "pointer casts may be troublesome" \
555 | grep -v "possible pointer alignment problem" \
556 | grep -v "ignore" \
557 | grep -v "conversion from long may lose accuracy" \
558 | grep -v "warning: constant argument to NOT" \
559 | grep -v "enumeration type clash, operator CAST" \
560 | grep -v "warning: constant in conditional context"\
561 | grep -v "archive\.c"
562
563
564 tags TAGS:$(SOURCES) $(HEADERS)
565         etags -t $?
566
567
568 objdump:objdump.c 
569
570 .PHONY: install
571 install: 
572         $(INSTALL_XFORM) ld.new $(bindir)/ld
573         $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
574         for f in ldscripts/*; do \
575           $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
576         done
577         -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
578           rm -f $(tooldir)/bin/ld; \
579           ln $(bindir)/$$n $(tooldir)/bin/ld \
580            || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
581
582 install-info: 
583         for i in ld.info* ; do \
584                 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
585         done
586
587 clean-info:
588         -rm -rf *.info*
589
590 #-----------------------------------------------------------------------------
591 #               'STANDARD' GNU/960 TARGETS BELOW THIS POINT
592 #
593 # 'VERSION' file must be present and contain a string of the form "x.y"
594 #-----------------------------------------------------------------------------
595
596 ver960.c: FORCE
597         rm -f ver960.c
598         echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
599
600
601 # This target should be invoked before building a new release.
602 # 'VERSION' file must be present and contain a string of the form "x.y"
603 #
604 roll:
605         @V=`cat VERSION`                ; \
606         MAJ=`sed 's/\..*//' VERSION`    ; \
607         MIN=`sed 's/.*\.//' VERSION`    ; \
608         V=$$MAJ.`expr $$MIN + 1`        ; \
609         rm -f VERSION                   ; \
610         echo $$V >VERSION               ; \
611         echo Version $$V
612
613
614 dep: $(LDSOURCES)
615         mkdep $(CFLAGS) $?
616
617 # Dummy target to force execution of dependent targets.
618 #
619 force:
620
621 # Target to uncomment host-specific lines in this makefile.  Such lines must
622 # have the following string beginning in column 1: #__<hostname>__#
623 # Original Makefile is backed up as 'Makefile.old'.
624 #
625 # Invoke with:  make make HOST=xxx
626 #
627 make:
628         -@if test $(HOST)x = x ; then \
629                 echo '\aSpecify "make make HOST=???"'; \
630                 exit 1; \
631         fi ; \
632         grep -s "^#The next line was generated by 'make make'" Makefile; \
633         if test $$? = 0 ; then  \
634                 echo "\aMakefile has already been processed with 'make make'";\
635                 exit 1; \
636         fi ; \
637         mv -f Makefile Makefile.old; \
638         echo "#The next line was generated by 'make make'"       >Makefile ; \
639         echo "HOST=$(HOST)"                                     >>Makefile ; \
640         echo                                                    >>Makefile ; \
641         sed "s/^#__$(HOST)__#//" < Makefile.old                 >>Makefile
642
643 #\f
644
645 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
646         $(SHELL) ./config.status
647
648 ### mode:fundamental ***
649 ### Local Variables: ***
650 ### page-delimiter: "^#\f" ***
651 ### End: ***
652 ### end of file
653
654
655 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY