1999-05-28 Martin Dorey <mdorey@madge.com>
[binutils.git] / ld / Makefile.am
blob774d770d7999a3a214817daf1c5c6c2a8affc21c
1 ## Process this file with automake to generate Makefile.in
3 ## FIXME: work around apparent automake bug.
4 INTLLIBS = @INTLLIBS@
6 AUTOMAKE_OPTIONS = cygnus dejagnu
8 SUBDIRS = po
10 tooldir = $(exec_prefix)/$(target_alias)
12 YACC = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L$(srcdir)/../bison/ ; else echo bison -y ; fi`
13 YFLAGS = -d
14 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
16 # We put the scripts in the directory $(scriptdir)/ldscripts.
17 # We can't put the scripts in $(datadir) because the SEARCH_DIR
18 # directives need to be different for native and cross linkers.
19 scriptdir = $(tooldir)/lib
21 EMUL = @EMUL@
22 EMULATION_OFILES = @EMULATION_OFILES@
23 EMUL_EXTRA_OFILES = @EMUL_EXTRA_OFILES@
25 # Search path to override the default search path for -lfoo libraries.
26 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
27 # (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
28 # a cross-linker, in which case the default is empty.  See genscripts.sh.)
29 # Otherwise, they are replaced with the ones given in LIB_PATH,
30 # which may have the form: LIB_PATH=/lib:/usr/local/lib
31 LIB_PATH =
33 BASEDIR = $(srcdir)/..
34 BFDDIR = $(BASEDIR)/bfd
35 INCDIR  = $(BASEDIR)/include
36 DEP = mkdep
38 # What version of the manual to build
39 DOCVER = gen
41 #stuff for self hosting (can be overridden in config file).
42 HOSTING_CRT0 = @HOSTING_CRT0@
43 HOSTING_LIBS = @HOSTING_LIBS@
44 HOSTING_EMU = -m $(EMUL)
46 # Setup the testing framework, if you have one
47 EXPECT = `if [ -f $$r/../expect/expect ] ; \
48         then echo $$r/../expect/expect ; \
49         else echo expect ; fi`
51 RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
52         then echo $${srcroot}/../dejagnu/runtest ; \
53         else echo runtest ; fi`
55 RUNTESTFLAGS =
57 CC_FOR_TARGET = ` \
58   if [ -f $$r/../gcc/xgcc ] ; then \
59     if [ -f $$r/../newlib/Makefile ] ; then \
60       echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
61     else \
62       echo $$r/../gcc/xgcc -B$$r/../gcc/; \
63     fi; \
64   else \
65     if [ "@host@" = "@target@" ] ; then \
66       echo $(CC); \
67     else \
68       echo gcc | sed '$(transform)'; \
69     fi; \
70   fi`
72 CXX = gcc
73 CXX_FOR_TARGET = ` \
74   if [ -f $$r/../gcc/xgcc ] ; then \
75     if [ -f $$r/../newlib/Makefile ] ; then \
76       echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
77     else \
78       echo $$r/../gcc/xgcc -B$$r/../gcc/; \
79     fi; \
80   else \
81     if [ "@host@" = "@target@" ] ; then \
82       echo $(CXX); \
83     else \
84       echo gcc | sed '$(transform)'; \
85     fi; \
86   fi`
88 noinst_PROGRAMS = ld-new
89 info_TEXINFOS = ld.texinfo
90 noinst_TEXINFOS = ldint.texinfo
91 man_MANS = ld.1
93 INCLUDES = -D_GNU_SOURCE -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) -I$(top_srcdir)/../intl -I../intl $(HDEFINES) $(CFLAGS) -DLOCALEDIR="\"$(prefix)/share/locale\""
95 BFDLIB = ../bfd/libbfd.la
96 LIBIBERTY = ../libiberty/libiberty.a
98 ALL_EMULATIONS = \
99         ea29k.o \
100         eaixppc.o \
101         eaixrs6.o \
102         ealpha.o \
103         earcelf.o \
104         earmelf.o \
105         earmelf_oabi.o \
106         earmelf_linux.o \
107         earmelf_linux26.o \
108         earmaoutb.o \
109         earmaoutl.o \
110         earmcoff.o \
111         earmpe.o \
112         ecoff_sparc.o \
113         ed10velf.o \
114         ed30velf.o \
115         ed30v_e.o \
116         ed30v_o.o \
117         edelta68.o \
118         eebmon29k.o \
119         eelf32_sparc.o \
120         eelf32_i960.o \
121         eelf32b4300.o \
122         eelf32bmip.o \
123         eelf32ebmip.o \
124         eelf32elmip.o \
125         eelf32l4300.o \
126         eelf32lmip.o \
127         eelf32lppc.o \
128         eelf32ppc.o \
129         eelf_i386.o \
130         eelf_i386_be.o \
131         egld960.o \
132         egld960coff.o \
133         eelf32fr30.o \
134         eelf32mcore.o \
135         ego32.o \
136         eh8300.o \
137         eh8300h.o \
138         eh8300s.o \
139         eh8500.o \
140         eh8500b.o \
141         eh8500c.o \
142         eh8500m.o \
143         eh8500s.o \
144         ehp300bsd.o \
145         ehp3hpux.o \
146         ehppaelf.o \
147         ei386aout.o \
148         ei386beos.o \
149         ei386bsd.o \
150         ei386coff.o \
151         ei386go32.o \
152         ei386linux.o \
153         ei386lynx.o \
154         ei386mach.o \
155         ei386moss.o \
156         ei386msdos.o \
157         ei386nbsd.o \
158         ei386nw.o \
159         ei386pe.o \
160         elnk960.o \
161         em68k4knbsd.o \
162         em68kaout.o \
163         em68kaux.o \
164         em68kcoff.o \
165         em68kelf.o \
166         em68klinux.o \
167         em68klynx.o \
168         em68knbsd.o \
169         em68kpsos.o \
170         em88kbcs.o \
171         emcorepe.o \
172         emipsbig.o \
173         emipsbsd.o \
174         emipsidt.o \
175         emipsidtl.o \
176         emipslit.o \
177         emipslnews.o \
178         enews.o \
179         ens32knbsd.o \
180         epc532macha.o \
181         eppcmacos.o \
182         eppcnw.o \
183         eppcpe.o \
184         eriscix.o \
185         esa29200.o \
186         esh.o \
187         eshelf.o \
188         eshlelf.o \
189         eshl.o \
190         esparcaout.o \
191         esparclinux.o \
192         esparclynx.o \
193         esparcnbsd.o \
194         est2000.o \
195         esun3.o \
196         esun4.o \
197         etic30aout.o \
198         etic30coff.o \
199         etic80coff.o \
200         evanilla.o \
201         evax.o \
202         evsta.o \
203         ew65.o \
204         ez8001.o \
205         ez8002.o
207 ALL_64_EMULATIONS = \
208         eelf64_sparc.o \
209         eelf64alpha.o
211 ALL_EMUL_EXTRA_OFILES = \
212         pe-dll.o \
213         deffilep.o
215 CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
216         ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
217         mri.c ldcref.c pe-dll.c
219 HFILES = ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
220         ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
221         ldwrite.h mri.h deffile.h
223 GENERATED_CFILES = ldgram.c ldlex.c deffilep.c
224 GENERATED_HFILES = ldgram.h ldemul-list.h deffilep.h
226 OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
227         ldwrite.o ldexp.o  ldemul.o ldver.o ldmisc.o \
228         ldfile.o ldcref.o ${EMULATION_OFILES} ${EMUL_EXTRA_OFILES}
230 STAGESTUFF = *.o ldscripts/* e*.c
232 # At the moment this is just a list of those emulation template files
233 # that contain internationalised strings.
234 EMULATION_FILES = emultempl/pe.em emultempl/armcoff.em
236 POTFILES = $(CFILES) $(HFILES) $(EMULATION_FILES)
238 po/POTFILES.in: @MAINT@ Makefile
239         for file in $(POTFILES); do echo $$file; done | sort > tmp \
240           && mv tmp $(srcdir)/po/POTFILES.in
242 ldmain.o: ldmain.c config.status
243         $(COMPILE) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' -DTARGET='"@target@"' $(srcdir)/ldmain.c
245 ldemul-list.h: Makefile
246         (echo "/* This file is automatically generated.  DO NOT EDIT! */";\
247         for f in `echo " " ${EMULATION_OFILES} "" \
248          | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
249             echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
250         done;\
251         echo "";\
252         echo "#define EMULATION_LIST \\";\
253         for f in `echo " " ${EMULATION_OFILES} "" \
254          | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
255             echo "  &ld_$${f}_emulation, \\"; \
256         done;\
257         echo "  0") >ldemul-tmp.h
258         mv ldemul-tmp.h ldemul-list.h
260 # These all start with e so 'make clean' can find them.
262 GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
263 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
264 @TDIRS@
266 ea29k.c: $(srcdir)/emulparams/a29k.sh \
267   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
268         ${GENSCRIPTS} a29k "$(tdir_a29k)"
269 eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
270   $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
271         ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
272 eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
273   $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
274         ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
275 ealpha.c: $(srcdir)/emulparams/alpha.sh \
276   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
277         ${GENSCRIPTS} alpha "$(tdir_alpha)"
278 earcelf.c: $(srcdir)/emulparams/arcelf.sh \
279   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
280         ${GENSCRIPTS} arcelf "$(tdir_arcelf)"
281 earmelf.c: $(srcdir)/emulparams/armelf.sh \
282   $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
283         ${GENSCRIPTS} armelf "$(tdir_armelf)"
284 earmelf_oabi.c: $(srcdir)/emulparams/armelf_oabi.sh \
285   $(srcdir)/emultempl/armelf_oabi.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
286         ${GENSCRIPTS} armelf_oabi "$(tdir_armelf)"
287 earmelf_linux.c: $(srcdir)/emulparams/armelf_linux.sh \
288   $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
289         ${GENSCRIPTS} armelf_linux "$(tdir_armelf_linux)"
290 earmelf_linux26.c: $(srcdir)/emulparams/armelf_linux26.sh \
291   $(srcdir)/emultempl/armelf.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
292         ${GENSCRIPTS} armelf_linux26 "$(tdir_armelf_linux26)"
293 earmaoutb.c:    $(srcdir)/emulparams/armaoutb.sh \
294   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
295         ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
296 earmaoutl.c:    $(srcdir)/emulparams/armaoutl.sh \
297   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
298         ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
299 earmcoff.c:     $(srcdir)/emulparams/armcoff.sh \
300   $(srcdir)/emultempl/armcoff.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
301         ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
302 earmpe.c: $(srcdir)/emulparams/armpe.sh \
303   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
304         ${GENSCRIPTS} armpe "$(tdir_armpe)"
305 ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
306   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
307         ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
308 ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
309   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd10v.sc ${GEN_DEPENDS}
310         ${GENSCRIPTS} d10velf "$(tdir_d10v)"
311 ed30velf.c: $(srcdir)/emulparams/d30velf.sh \
312   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
313         ${GENSCRIPTS} d30velf "$(tdir_d30v)"
314 ed30v_o.c: $(srcdir)/emulparams/d30v_o.sh \
315   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
316         ${GENSCRIPTS} d30v_o "$(tdir_d30v)"
317 ed30v_e.c: $(srcdir)/emulparams/d30v_e.sh \
318   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elfd30v.sc ${GEN_DEPENDS}
319         ${GENSCRIPTS} d30v_e "$(tdir_d30v)"
320 edelta68.c: $(srcdir)/emulparams/delta68.sh \
321   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
322         ${GENSCRIPTS} delta68 "$(tdir_delta68)"
323 eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
324   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
325         ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
326 eelf32fr30.c: $(srcdir)/emulparams/elf32fr30.sh \
327   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
328         ${GENSCRIPTS} elf32fr30 "$(tdir_fr30)"
329 eelf32mcore.c: $(srcdir)/emulparams/elf32mcore.sh \
330   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
331         ${GENSCRIPTS} elf32mcore "$(tdir_mcore)"
332 em32relf.c: $(srcdir)/emulparams/m32relf.sh \
333   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
334         ${GENSCRIPTS} m32relf "$(tdir_m32r)"
335 eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
336   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
337         ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
338 eelf32_i960.c: $(srcdir)/emulparams/elf32_i960.sh \
339   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
340         ${GENSCRIPTS} elf32_i960 "$(tdir_elf32_i960)"
341 eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
342   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
343         ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
344 eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
345   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
346         ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
347 eelf32bsmip.c: $(srcdir)/emulparams/elf32bsmip.sh \
348   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
349         ${GENSCRIPTS} elf32bsmip "$(tdir_elf32bsmip)"
350 eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
351   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
352         ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
353 eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
354   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
355         ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
356 eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
357   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
358         ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
359 eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
360   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
361         ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
362 eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
363   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
364         ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
365 eelf32lsmip.c: $(srcdir)/emulparams/elf32lsmip.sh \
366   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
367         ${GENSCRIPTS} elf32lsmip "$(tdir_elf32lsmip)"
368 eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
369   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
370         ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
371 eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
372   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
373         ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
374 eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
375   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
376         ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
377 eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
378   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
379         ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
380 eelf_i386_be.c: $(srcdir)/emulparams/elf_i386_be.sh \
381   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
382         ${GENSCRIPTS} elf_i386_be "$(tdir_elf_i386_be)"
383 egld960.c: $(srcdir)/emulparams/gld960.sh \
384   $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
385         ${GENSCRIPTS} gld960 "$(tdir_gld960)"
386 egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
387   $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
388         ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
389 ego32.c: $(srcdir)/emulparams/go32.sh \
390   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
391         ${GENSCRIPTS} go32 "$(tdir_go32)"
392 eh8300.c: $(srcdir)/emulparams/h8300.sh \
393   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
394         ${GENSCRIPTS} h8300 "$(tdir_h8300)"
395 eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
396   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
397         ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
398 eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
399   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
400         ${GENSCRIPTS} h8300s "$(tdir_h8300s)"
401 eh8500.c: $(srcdir)/emulparams/h8500.sh \
402   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
403         ${GENSCRIPTS} h8500 "$(tdir_h8500)"
404 eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
405   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
406         ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
407 eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
408   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
409         ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
410 eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
411   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
412         ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
413 eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
414   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
415         ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
416 ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
417   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
418         ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
419 ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
420   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
421         ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
422 ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
423   $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
424         ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
425 ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
426   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
427         ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
428 ei386beos.c: $(srcdir)/emulparams/i386beos.sh \
429   $(srcdir)/emultempl/beos.em $(srcdir)/scripttempl/i386beos.sc ${GEN_DEPENDS}
430         ${GENSCRIPTS} i386beos "$(tdir_i386beos)"
431 ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
432   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
433         ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
434 ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
435   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
436         ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
437 ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
438   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
439         ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
440 ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
441   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
442         ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
443 ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
444   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
445         ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
446 ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
447   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
448         ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
449 ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
450   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
451         ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
452 ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
453   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
454         ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
455 ei386nbsd.c:    $(srcdir)/emulparams/i386nbsd.sh \
456   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
457         ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
458 ei386nw.c:      $(srcdir)/emulparams/i386nw.sh \
459   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
460         ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
461 ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
462   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
463         ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
464 elnk960.c: $(srcdir)/emulparams/lnk960.sh \
465   $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
466         ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
467 em68k4knbsd.c:  $(srcdir)/emulparams/m68k4knbsd.sh \
468   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
469         ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
470 em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
471   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
472         ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
473 em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
474   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
475         ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
476 em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
477   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
478         ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
479 em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
480   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
481         ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
482 em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
483   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
484         ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
485 em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
486   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
487         ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
488 em68knbsd.c:    $(srcdir)/emulparams/m68knbsd.sh \
489   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
490         ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
491 em68kpsos.c:    $(srcdir)/emulparams/m68kpsos.sh \
492   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
493         ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
494 em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
495   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
496         ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
497 emcorepe.c: $(srcdir)/emulparams/mcorepe.sh \
498   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
499         ${GENSCRIPTS} mcorepe "$(tdir_mcorepe)"
500 emipsbig.c:  $(srcdir)/emulparams/mipsbig.sh \
501   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
502         ${GENSCRIPTS} mipsbig
503 emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
504   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
505         ${GENSCRIPTS} mipsbsd
506 emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
507   $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
508         ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
509 emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
510   $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
511         ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
512 emipslit.c:  $(srcdir)/emulparams/mipslit.sh \
513   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
514         ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
515 emipslnews.c:  $(srcdir)/emulparams/mipslnews.sh \
516   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
517         ${GENSCRIPTS} mipslnews
518 emn10300.c: $(srcdir)/emulparams/mn10300.sh \
519   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
520         ${GENSCRIPTS} mn10300 "$(tdir_mn10300)"
521 emn10200.c: $(srcdir)/emulparams/mn10200.sh \
522   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
523         ${GENSCRIPTS} mn10200 "$(tdir_mn10200)"
524 enews.c: $(srcdir)/emulparams/news.sh \
525   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
526         ${GENSCRIPTS} news "$(tdir_news)"
527 ens32knbsd.c:   $(srcdir)/emulparams/ns32knbsd.sh \
528   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
529         ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
530 epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
531   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
532         ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
533 eppcmacos.c:    $(srcdir)/emulparams/ppcmacos.sh \
534   $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
535         ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
536 eppcnw.c:       $(srcdir)/emulparams/ppcnw.sh \
537   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
538         ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
539 eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
540   $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
541         ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
542 eriscix.c: $(srcdir)/emulparams/riscix.sh \
543   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
544         ${GENSCRIPTS} riscix "$(tdir_riscix)"
545 esa29200.c: $(srcdir)/emulparams/sa29200.sh \
546   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
547         ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
548 esh.c: $(srcdir)/emulparams/sh.sh \
549   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
550         ${GENSCRIPTS} sh "$(tdir_sh)"
551 eshelf.c: $(srcdir)/emulparams/shelf.sh \
552   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
553         ${GENSCRIPTS} shelf "$(tdir_shelf)"
554 eshlelf.c: $(srcdir)/emulparams/shlelf.sh \
555   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
556         ${GENSCRIPTS} shlelf "$(tdir_shlelf)"
557 eshl.c: $(srcdir)/emulparams/shl.sh \
558   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
559         ${GENSCRIPTS} shl "$(tdir_shl)"
560 esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
561   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
562         ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
563 esparclinux.c: $(srcdir)/emulparams/sparclinux.sh \
564   $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
565         ${GENSCRIPTS} sparclinux "$(tdir_sparclinux)"
566 esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
567   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
568         ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
569 esparcnbsd.c:   $(srcdir)/emulparams/sparcnbsd.sh \
570   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
571         ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
572 est2000.c: $(srcdir)/emulparams/st2000.sh \
573   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
574         ${GENSCRIPTS} st2000 "$(tdir_st2000)"
575 esun3.c: $(srcdir)/emulparams/sun3.sh \
576   $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
577         ${GENSCRIPTS} sun3 "$(tdir_sun3)"
578 esun4.c: $(srcdir)/emulparams/sun4.sh \
579   $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
580         ${GENSCRIPTS} sun4 "$(tdir_sun4)"
581 etic30aout.c: $(srcdir)/emulparams/tic30aout.sh \
582   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30aout.sc ${GEN_DEPENDS}
583         ${GENSCRIPTS} tic30aout "$(tdir_tic30aout)"
584 etic30coff.c: $(srcdir)/emulparams/tic30coff.sh \
585   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic30coff.sc ${GEN_DEPENDS}
586         ${GENSCRIPTS} tic30coff "$(tdir_tic30coff)"
587 etic80coff.c: $(srcdir)/emulparams/tic80coff.sh \
588   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/tic80coff.sc ${GEN_DEPENDS}
589         ${GENSCRIPTS} tic80coff "$(tdir_tic80coff)"
590 evanilla.c: $(srcdir)/emulparams/vanilla.sh \
591   $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
592         ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
593 evax.c: $(srcdir)/emulparams/vax.sh \
594   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
595         ${GENSCRIPTS} vax "$(tdir_vax)"
596 evsta.c: $(srcdir)/emulparams/vsta.sh \
597   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
598         ${GENSCRIPTS} vsta "$(tdir_vsta)"
599 ev850.c: $(srcdir)/emulparams/v850.sh \
600   $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/v850.sc ${GEN_DEPENDS}
601         ${GENSCRIPTS} v850 "$(tdir_v850)"
602 ew65.c: $(srcdir)/emulparams/w65.sh \
603   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
604         ${GENSCRIPTS} w65 "$(tdir_w65)"
605 ez8001.c: $(srcdir)/emulparams/z8001.sh \
606   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
607         ${GENSCRIPTS} z8001 "$(tdir_z8001)"
608 ez8002.c: $(srcdir)/emulparams/z8002.sh \
609   $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
610         ${GENSCRIPTS} z8002 "$(tdir_z8002)"
612 ld_new_SOURCES = ldgram.y ldlex.l lexsup.c ldlang.c mri.c ldctor.c ldmain.c \
613         ldwrite.c ldexp.c ldemul.c ldver.c ldmisc.c ldfile.c ldcref.c
614 ld_new_DEPENDENCIES = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLDEPS)
615 ld_new_LDADD = $(EMULATION_OFILES) $(EMUL_EXTRA_OFILES) $(BFDLIB) $(LIBIBERTY) $(INTLLIBS)
617 # The generated emulation files mostly have the same dependencies.
618 $(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
619   ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
620   ldctor.h ldexp.h ldlang.h ldgram.h
622 # This is the real libbfd.a created by libtool.
623 TESTBFDLIB = @TESTBFDLIB@
625 check-DEJAGNU: site.exp
626         srcroot=`cd $(srcdir) && pwd`; export srcroot; \
627         r=`pwd`; export r; \
628         EXPECT=$(EXPECT); export EXPECT; \
629         if [ -f $(top_builddir)/../expect/expect ]; then \
630           TCL_LIBRARY=`cd $(top_srcdir)/../tcl/library && pwd`; \
631           export TCL_LIBRARY; \
632         fi; \
633         runtest=$(RUNTEST); \
634         if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
635           $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
636                 CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
637                 CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
638                 CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
639                 OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
640                 LIBIBERTY="$(LIBIBERTY) $(INTLLIBS)" \
641                 $(RUNTESTFLAGS); \
642         else echo "WARNING: could not find \`runtest'" 1>&2; :;\
643         fi
645 # Rules for testing by relinking ld itself.
646 # A similar test is in the testsuite.  This target is for ease of use
647 # when porting ld.
649 ld-partial.o: ld-new$(EXEEXT)
650         ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
651 ld1$(EXEEXT): ld-partial.o
652         ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1$(EXEEXT) $(HOSTING_CRT0) ld-partial.o $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
654 ld1-full$(EXEEXT): ld-new
655         ./ld-new$(EXEEXT) $(HOSTING_EMU) -o ld1-full$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
657 ld2$(EXEEXT): ld1$(EXEEXT)
658         ./ld1$(EXEEXT) $(HOSTING_EMU) -o ld2$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
660 ld3$(EXEEXT): ld2$(EXEEXT)
661         ./ld2$(EXEEXT) $(HOSTING_EMU) -o ld3$(EXEEXT) $(HOSTING_CRT0) $(OFILES) $(TESTBFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
663 bootstrap: ld3$(EXEEXT)
664         cmp ld2$(EXEEXT) ld3$(EXEEXT)
666 .PHONY: bootstrap
668 # A test program for C++ constructors and destructors.
669 # This test is now in the testsuite.
671 #cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
672 #       ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
673 #         cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
675 #cdtest.out: cdtest
676 #       ./cdtest > cdtest.tmp
677 #       mv cdtest.tmp cdtest.out
679 #cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
680 #       ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
681 #         cdtest-bar.o cdtest-foo.o
683 #cdtest-ur: cdtest-ur.o
684 #       ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
685 #         $(HOSTING_LIBS)
687 #cdtest-ur.out: cdtest-ur
688 #       ./cdtest-ur > cdtest-ur.tmp
689 #       mv cdtest-ur.tmp cdtest-ur.out
691 #check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
692 #       diff $(srcdir)/cdtest.exp cdtest.out
693 #       diff $(srcdir)/cdtest.exp cdtest-ur.out
695 #.PHONY: check-cdtest
697 # END OF CHECK TARGETS
699 # DOCUMENTATION TARGETS
700 # Manual configuration file; not usually attached to normal configuration,
701 # because almost all configs use "gen" version of manual.
702 #  Set DOCVER above to change.
703 configdoc.texi: ${DOCVER}-doc.texi
704         ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
705           || ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi >/dev/null 2>&1 \
706           || cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
708 ldver.texi: Makefile
709         rm -f $@
710         echo '@set VERSION $(VERSION)' > $@
712 ld.info: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
713         @rm -f $@ $@-[0-9] $@-[0-9][0-9]
714         $(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc $(srcdir)/ld.texinfo
716 ld.dvi: $(srcdir)/ld.texinfo configdoc.texi ldver.texi
717         TEXINPUTS=$(top_srcdir)/../texinfo:$$TEXINPUTS \
718           MAKEINFO="$(MAKEINFO) -I $(srcdir) -I $(BFDDIR)/doc" $(TEXI2DVI) $(srcdir)/ld.texinfo
720 MAINTAINERCLEANFILES = ldver.texi
722 # We want to reconfigure if configure.host or configure.tgt changes.
723 config.status: $(srcdir)/configure $(srcdir)/configure.host $(srcdir)/configure.tgt
724         $(SHELL) ./config.status --recheck
726 MOSTLYCLEANFILES = $(STAGESTUFF) ld1$(EXEEXT) ld2$(EXEEXT) ld3$(EXEEXT) \
727         ldemul-list.h crtbegin.o crtend.o ld.log ld.sum
728 mostlyclean-local:
729         -rm -rf tmpdir
730 CLEANFILES = dep.sed .dep .dep1
732 .PHONY: install-exec-local install-data-local
734 install-exec-local: ld-new$(EXEEXT)
735         $(mkinstalldirs) $(bindir) $(tooldir)/bin
736         @list='$(noinst_PROGRAMS)'; for p in $$list; do \
737           if test -f $$p; then \
738             echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
739             $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
740           else :; fi; \
741         done
742         n=`echo ld | sed '$(transform)'`; \
743         if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/ld$(EXEEXT)" ]; then \
744           rm -f $(tooldir)/bin/ld$(EXEEXT); \
745           ln $(bindir)/$$n$(EXEEXT) $(tooldir)/bin/ld$(EXEEXT) >/dev/null 2>/dev/null \
746           || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) ld-new$(EXEEXT) $(tooldir)/bin/ld$(EXEEXT); \
747         fi
749 install-data-local:
750         $(mkinstalldirs) $(scriptdir)/ldscripts
751         for f in ldscripts/*; do \
752           $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
753         done
755 # Stuff that should be included in a distribution.  The diststuff
756 # target is run by the taz target in ../Makefile.in.
757 LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
758 diststuff: $(LDDISTSTUFF) info
760 DISTCLEANFILES = tdirs site.exp site.bak
761 distclean-local:
762         rm -rf ldscripts
764 # Targets to rebuild dependencies in this Makefile.
765 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
766 .dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
767         rm -f .dep1
768         $(MAKE) DEP=$(DEP) .dep1
769         sed -f dep.sed <.dep1 >.dep
771 # This rule really wants a mkdep that runs "gcc -MM".
772 .dep1: $(CFILES) $(GENERATED_CFILES)
773         rm -f .dep2
774         echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
775         $(DEP) -f .dep2 $(INCLUDES) $?
776         $(srcdir)/../move-if-change .dep2 .dep1
778 dep.sed: dep-in.sed config.status
779         sed <$(srcdir)/dep-in.sed >dep.sed      \
780                 -e 's!@INCDIR@!$(INCDIR)!'      \
781                 -e 's!@SRCDIR@!$(srcdir)!'
783 dep: .dep
784         sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
785         cat .dep >> tmp-Makefile
786         $(srcdir)/../move-if-change tmp-Makefile Makefile
788 dep-in: .dep
789         sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
790         cat .dep >> tmp-Makefile.in
791         $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
793 dep-am: .dep
794         sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.am > tmp-Makefile.am
795         cat .dep >> tmp-Makefile.am
796         $(srcdir)/../move-if-change tmp-Makefile.am $(srcdir)/Makefile.am
798 .PHONY: dep dep-in dep-am
800 # What appears below is generated by a hacked mkdep using gcc -MM.
802 # DO NOT DELETE THIS LINE -- mkdep uses it.
803 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
805 ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
806   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
807   ld.h ldexp.h ldlang.h ldmisc.h ldgram.h ldmain.h ldctor.h
808 ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
809   sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldemul.h \
810   ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldemul-list.h
811 ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
812   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
813   ld.h ldmain.h ldmisc.h ldexp.h ldgram.h ldlang.h
814 ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
815   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
816   ld.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
817   ldlex.h ldemul.h
818 ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
819   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
820   $(INCDIR)/obstack.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
821   ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
822   ldctor.h ldfile.h $(INCDIR)/fnmatch.h
823 ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
824   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
825   $(INCDIR)/progress.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
826   ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h ldemul.h \
827   ldlex.h ldfile.h ldctor.h
828 ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
829   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
830   $(INCDIR)/demangle.h ld.h ldmisc.h ldexp.h ldlang.h \
831   ldgram.h ldlex.h ldmain.h ldfile.h
832 ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
833   sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldver.h \
834   ldemul.h ldmain.h
835 ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
836   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
837   $(INCDIR)/libiberty.h ld.h ldexp.h ldlang.h ldwrite.h \
838   ldmisc.h ldgram.h ldmain.h
839 lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
840   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/libiberty.h \
841   $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
842   ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
843   ldver.h ldemul.h
844 mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h sysdep.h \
845   config.h $(INCDIR)/fopen-same.h ld.h ldexp.h ldlang.h \
846   ldmisc.h mri.h ldgram.h $(INCDIR)/libiberty.h
847 ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
848   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
849   $(INCDIR)/libiberty.h ld.h ldmain.h ldmisc.h ldexp.h \
850   ldlang.h
851 pe-dll.o: pe-dll.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
852   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
853   $(INCDIR)/libiberty.h ld.h ldexp.h ldlang.h ldwrite.h \
854   ldmisc.h ldgram.h ldmain.h ldemul.h $(INCDIR)/coff/internal.h \
855   ../bfd/libcoff.h deffile.h
856 ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
857   sysdep.h config.h $(INCDIR)/fopen-same.h $(INCDIR)/bfdlink.h \
858   ld.h ldexp.h ldver.h ldlang.h ldemul.h ldfile.h ldmisc.h \
859   ldmain.h mri.h ldctor.h ldlex.h
860 ldlex.o: ldlex.c ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \
861   ld.h ldgram.h ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h \
862   ldmain.h
863 deffilep.o: deffilep.c $(INCDIR)/libiberty.h $(INCDIR)/ansidecl.h \
864   ../bfd/bfd.h sysdep.h config.h $(INCDIR)/fopen-same.h \
865   ld.h ldmisc.h deffile.h
867 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY