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