start-sanitize-d10v
[deliverable/binutils-gdb.git] / ld / Makefile.in
CommitLineData
ce4d59e2 1# Makefile for the GNU linker ld (version 2)
6014cea7
ILT
2# Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996
3# Free Software Foundation, Inc.
ce4d59e2 4
d4e5e3c3 5# This file is part of GNU ld.
ce4d59e2
SC
6
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU General Public License for more details.
16#
17# You should have received a copy of the GNU General Public License
18# along with this program; if not, write to the Free Software
943fbd5b 19# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
ce4d59e2 20
eb02fd64 21
d66c832b
ILT
22VPATH = @srcdir@
23srcdir = @srcdir@
3a9149a7 24objdir = .
eb02fd64 25
d66c832b
ILT
26target_alias = @target_alias@
27prefix = @prefix@
e06ba18d 28
d66c832b
ILT
29program_transform_name = @program_transform_name@
30exec_prefix = @exec_prefix@
f14a5192
JM
31bindir = @bindir@
32libdir = @libdir@
034351e3 33tooldir = $(exec_prefix)/$(target_alias)
f14a5192
JM
34datadir = @datadir@
35mandir = @mandir@
e06ba18d
PB
36man1dir = $(mandir)/man1
37man2dir = $(mandir)/man2
38man3dir = $(mandir)/man3
39man4dir = $(mandir)/man4
40man5dir = $(mandir)/man5
41man6dir = $(mandir)/man6
42man7dir = $(mandir)/man7
43man8dir = $(mandir)/man8
44man9dir = $(mandir)/man9
f14a5192
JM
45infodir = @infodir@
46includedir = @includedir@
47
173a0c3d 48# We put the scripts in the directory $(scriptdir)/ldscripts.
559d7baf
RP
49# We can't put the scripts in $(datadir) because the SEARCH_DIR
50# directives need to be different for native and cross linkers.
173a0c3d 51scriptdir = $(tooldir)/lib
e06ba18d
PB
52
53SHELL = /bin/sh
54
e0d005f2 55INSTALL = `cd $(srcdir); pwd`/../install.sh -c
f14a5192
JM
56INSTALL_PROGRAM = @INSTALL_PROGRAM@
57INSTALL_DATA = @INSTALL_DATA@
5ebaf24b 58INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
c97b9003
DZ
59INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
60
e06ba18d
PB
61AR = ar
62AR_FLAGS = qv
d66c832b
ILT
63CC = @CC@
64CFLAGS = @CFLAGS@
c99fbc42 65LDFLAGS = @LDFLAGS@
2e598345 66HLDFLAGS = @HLDFLAGS@
ad43e45b 67RPATH_ENVVAR = @RPATH_ENVVAR@
e06ba18d 68MAKEINFO = makeinfo
2412a768 69TEXI2DVI = texi2dvi
e06ba18d 70RANLIB = ranlib
bf3acf44 71BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
2df68136 72LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
8c32cf6e 73
d66c832b
ILT
74EMUL = @EMUL@
75EMULATION_OFILES = @EMULATION_OFILES@
76
efa6c497 77# Search path to override the default search path for -lfoo libraries.
ee17cac9 78# If LIB_PATH is empty, the ones in the script (if any) are left alone.
208bc89e 79# (The default is usually /lib:/usr/lib:/usr/local/lib, unless building
917bffa7 80# a cross-linker, in which case the default is empty. See genscripts.sh.)
ee17cac9
PB
81# Otherwise, they are replaced with the ones given in LIB_PATH,
82# which may have the form: LIB_PATH=/lib:/usr/local/lib
83LIB_PATH =
84
959eba20
JO
85BASEDIR = $(srcdir)/..
86BFDDIR = $(BASEDIR)/bfd
87INCDIR = $(BASEDIR)/include
88INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
4a6afc88 89DEP = mkdep
2ee11735 90
2412a768
RP
91# What version of the manual to build
92DOCVER = gen
93
8073190b 94# Where to find texinfo.tex to format docn with TeX
d17eb3db 95TEXIDIR = $(srcdir)/../texinfo
8d317d2a 96
959eba20
JO
97# Where to find other docs needed to format with TeX
98TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir)
99
10a69a37 100# Whether to get roff to put indexing entries on stderr
954ac2ea
RP
101TEXI2OPT =
102# You neeed this to generate ld-index.ms (or .mm or .me)
103# TEXI2OPT = -i
8073190b 104
e06ba18d
PB
105TEXI2ROFF=texi2roff
106
8073190b
RP
107# Which roff program to use to generate index for texi2roff'd doc
108ROFF = groff
109
5cdea2ac 110#stuff for self hosting (can be overridden in config file).
d66c832b
ILT
111HOSTING_CRT0 = @HOSTING_CRT0@
112HOSTING_LIBS = @HOSTING_LIBS@
74e6b793 113HOSTING_EMU = -m $(EMUL)
5cdea2ac 114
32286e08
C
115# These were used by `make check-cdtest'
116#
117#CXX = `if [ -f ../gcc/xgcc ] ; then \
118# echo ../gcc/xgcc -B../gcc/; \
119# else echo gcc; \
120# fi`
121#CXXFLAGS = -fgnu-linker
122#
8a6665ae 123# FIX_ME: using ../gcc/xgcc breaks the cdtest.
32286e08 124#CXX = g++
8a6665ae 125
3a9149a7 126# Setup the testing framework, if you have one
32286e08
C
127EXPECT = `if [ -f $$r/../expect/expect ] ; \
128 then echo $$r/../expect/expect ; \
129 else echo expect ; fi`
130
131RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
132 then echo $${srcroot}/../dejagnu/runtest ; \
133 else echo runtest ; fi`
099c286e 134
03372cf4 135RUNTESTFLAGS =
32286e08
C
136
137CC_FOR_TARGET = ` \
65d22248 138 if [ -f $$r/../gcc/xgcc ] ; then \
32286e08
C
139 if [ -f $$r/../newlib/Makefile ] ; then \
140 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
141 else \
142 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
143 fi; \
144 else \
dfc84b08 145 if [ "@host@" = "@target@" ] ; then \
32286e08
C
146 echo $(CC); \
147 else \
b5f076d4 148 echo gcc | sed '$(program_transform_name)'; \
32286e08
C
149 fi; \
150 fi`
151
152CXX = gcc
153CXX_FOR_TARGET = ` \
65d22248 154 if [ -f $$r/../gcc/xgcc ] ; then \
32286e08
C
155 if [ -f $$r/../newlib/Makefile ] ; then \
156 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
157 else \
158 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
159 fi; \
160 else \
dfc84b08 161 if [ "@host@" = "@target@" ] ; then \
32286e08
C
162 echo $(CXX); \
163 else \
b5f076d4 164 echo gcc | sed '$(program_transform_name)'; \
32286e08
C
165 fi; \
166 fi`
c97b9003 167
4a6afc88
ILT
168# go directly to ld.new in case this ld isn't capable of
169# linking native object on this host. It can be renamed on
170# install.
171LD_PROG = ld.new
172
173all: $(LD_PROG)
174.PHONY: all
58bf66f9 175
74e6b793 176LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
2ee11735 177
32286e08 178# The .cc suffix was used by `make check-cdtest'.
565c93e9
DM
179
180.SUFFIXES: .y $(SUFFIXES) .cc
181
173a0c3d
DM
182# Suppress smart makes who think they know how to automake Yacc files
183.y.c:
184
32286e08
C
185# This rule was used for the check-cdtest target.
186#.cc.o:
187# $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
565c93e9 188
d66c832b 189ALL_CFLAGS = $(INCLUDES) @HDEFINES@ $(CFLAGS)
77b19d3d 190.c.o:
4a6afc88 191 $(CC) -c $(ALL_CFLAGS) $<
f78e2569 192
2e598345
ILT
193BFDDEP = ../bfd/libbfd.a
194BFDLIB = @BFDLIB@
959eba20 195LIBIBERTY = ../libiberty/libiberty.a
eb02fd64 196
efa6c497
ILT
197ALL_EMULATIONS = \
198 ea29k.o \
199 eaixppc.o \
200 eaixrs6.o \
201 ealpha.o \
202 earmaoutb.o \
203 earmaoutl.o \
204 earmcoff.o \
205 earmpe.o \
206 ecoff_sparc.o \
207 edelta68.o \
208 eebmon29k.o \
209 eelf32_sparc.o \
210 eelf32b4300.o \
211 eelf32bmip.o \
719de0ea
ILT
212 eelf32ebmip.o \
213 eelf32elmip.o \
efa6c497
ILT
214 eelf32l4300.o \
215 eelf32lmip.o \
216 eelf32lppc.o \
217 eelf32ppc.o \
f14a5192 218 eelf64alpha.o \
efa6c497
ILT
219 eelf64_sparc.o \
220 eelf_i386.o \
221 egld960.o \
222 egld960coff.o \
223 ego32.o \
224 eh8300.o \
225 eh8300h.o \
f14a5192 226 eh8300s.o \
efa6c497
ILT
227 eh8500.o \
228 eh8500b.o \
229 eh8500c.o \
230 eh8500m.o \
231 eh8500s.o \
232 ehp300bsd.o \
233 ehp3hpux.o \
234 ehppaelf.o \
235 ei386aout.o \
236 ei386bsd.o \
237 ei386coff.o \
238 ei386go32.o \
239 ei386linux.o \
240 ei386lynx.o \
241 ei386mach.o \
242 ei386moss.o \
243 ei386msdos.o \
244 ei386nbsd.o \
245 ei386nw.o \
246 ei386pe.o \
247 elnk960.o \
248 em68k4knbsd.o \
249 em68kaout.o \
250 em68kaux.o \
251 em68kcoff.o \
252 em68kelf.o \
253 em68klinux.o \
254 em68klynx.o \
255 em68knbsd.o \
256 em68kpsos.o \
257 em88kbcs.o \
258 emipsbig.o \
259 emipsbsd.o \
260 emipsidt.o \
261 emipsidtl.o \
262 emipslit.o \
263 enews.o \
264 ens32knbsd.o \
1ab4cd57 265 epc532macha.o \
efa6c497
ILT
266 eppcmacos.o \
267 eppcnw.o \
268 eppcpe.o \
269 eriscix.o \
270 esa29200.o \
271 esh.o \
272 eshl.o \
273 esparcaout.o \
274 esparclynx.o \
275 esparcnbsd.o \
276 est2000.o \
277 esun3.o \
278 esun4.o \
279 evanilla.o \
280 evax.o \
281 evsta.o \
282 ew65.o \
283 ez8001.o \
284 ez8002.o
7e5c1057 285
74e6b793 286CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
4a6afc88 287 ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
f14a5192 288 mri.c ldcref.c
eb02fd64 289
74e6b793 290HFILES = config.h ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
4a6afc88
ILT
291 ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
292 ldwrite.h mri.h
eb02fd64 293
74e6b793 294GENERATED_CFILES = ldgram.c ldlex.c
208bc89e 295GENERATED_HFILES = ldgram.h ldemul-list.h
eb02fd64 296
74e6b793 297OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
4a6afc88 298 ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
f14a5192 299 ldfile.o ldcref.o ${EMULATION_OFILES}
eb02fd64 300
82ebe9a2 301LINTSOURCES = $(CFILES) $(GENERATED_CFILES) e*.c
eb02fd64 302
82ebe9a2 303STAGESTUFF = *.o ldscripts/* e*.c
e06ba18d
PB
304
305info: ld.info
4a6afc88 306.PHONY: info
2ee11735 307
32286e08 308ldgram.c: ldgram.y
5ff21fa5 309 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
31e54f5d
RP
310 mv -f y.tab.c ldgram.c
311 mv -f y.tab.h ldgram.h
cc964c6f 312
32286e08
C
313# Separate from ldgram.c so that a parallel make doesn't try to build
314# both ldgram.c and ldgram.h simultaneously.
315ldgram.h: ldgram.c
316
4a6afc88 317ldmain.o: ldmain.c config.status
d66c832b 318 $(CC) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' $(ALL_CFLAGS) $<
4a6afc88 319
82ebe9a2 320ldemul-list.h: Makefile
7e5c1057
PB
321 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
322 for f in `echo " " ${EMULATION_OFILES} "" \
82ebe9a2 323 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
324 echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
325 done;\
326 echo "";\
327 echo "#define EMULATION_LIST \\";\
328 for f in `echo " " ${EMULATION_OFILES} "" \
82ebe9a2 329 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
330 echo " &ld_$${f}_emulation, \\"; \
331 done;\
4a6afc88
ILT
332 echo " 0") >ldemul-tmp.h
333 mv ldemul-tmp.h ldemul-list.h
7e5c1057 334
4a6afc88 335ldlex.c: ldlex.l
5ff21fa5 336 $(LEX) -I -Cem $(srcdir)/ldlex.l
4a6afc88
ILT
337 -sed -e '/^int.*free();/d' \
338 -e '/^char.*malloc();/d' \
0b2f8d2e 339 -e 's/malloc/xmalloc/g' \
4a6afc88
ILT
340 < lex.yy.c > ldlex.c.new
341 -rm lex.yy.c
342 mv ldlex.c.new ./ldlex.c
19b03b7a 343
82ebe9a2 344# These all start with e so 'make clean' can find them.
c61b4184 345
2e598345 346GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host@ @target@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@"
c06e55d9 347GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
95d31c3c 348@TDIRS@
7e5c1057 349
efa6c497
ILT
350ea29k.c: $(srcdir)/emulparams/a29k.sh \
351 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
352 ${GENSCRIPTS} a29k "$(tdir_a29k)"
353eaixppc.c: $(srcdir)/emulparams/aixppc.sh \
354 $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
355 ${GENSCRIPTS} aixppc "$(tdir_aixppc)"
356eaixrs6.c: $(srcdir)/emulparams/aixrs6.sh \
357 $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
358 ${GENSCRIPTS} aixrs6 "$(tdir_aixrs6)"
359ealpha.c: $(srcdir)/emulparams/alpha.sh \
360 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
361 ${GENSCRIPTS} alpha "$(tdir_alpha)"
362# start-sanitize-arc
363earcelf.c: $(srcdir)/emulparams/arcelf.sh \
364 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
365 ${GENSCRIPTS} arcelf "$(tdir_arcelf)"
366# end-sanitize-arc
367earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
368 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
369 ${GENSCRIPTS} armaoutb "$(tdir_armaoutb)"
370earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
371 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
372 ${GENSCRIPTS} armaoutl "$(tdir_armaoutl)"
373earmcoff.c: $(srcdir)/emulparams/armcoff.sh \
374 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armcoff.sc ${GEN_DEPENDS}
375 ${GENSCRIPTS} armcoff "$(tdir_armcoff)"
28d0c3ce 376earmpe.c: $(srcdir)/emulparams/armpe.sh \
d66c832b 377 $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
95d31c3c 378 ${GENSCRIPTS} armpe "$(tdir_armpe)"
efa6c497
ILT
379ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
380 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
381 ${GENSCRIPTS} coff_sparc "$(tdir_coff_sparc)"
e9525d96
MH
382# start-sanitize-d10v
383ed10velf.c: $(srcdir)/emulparams/d10velf.sh \
384 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
385 ${GENSCRIPTS} d10velf "$(tdir_arcelf)"
386# end-sanitize-d10v
efa6c497
ILT
387edelta68.c: $(srcdir)/emulparams/delta68.sh \
388 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/delta68.sc ${GEN_DEPENDS}
389 ${GENSCRIPTS} delta68 "$(tdir_delta68)"
390eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
391 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
392 ${GENSCRIPTS} ebmon29k "$(tdir_ebmon29k)"
393eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
394 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
395 ${GENSCRIPTS} elf32_sparc "$(tdir_elf32_sparc)"
396eelf32b4300.c: $(srcdir)/emulparams/elf32b4300.sh \
397 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
398 ${GENSCRIPTS} elf32b4300 "$(tdir_elf32b4300)"
399eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
400 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
401 ${GENSCRIPTS} elf32bmip "$(tdir_elf32bmip)"
719de0ea
ILT
402eelf32ebmip.c: $(srcdir)/emulparams/elf32ebmip.sh \
403 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
404 ${GENSCRIPTS} elf32ebmip "$(tdir_elf32ebmip)"
405eelf32elmip.c: $(srcdir)/emulparams/elf32elmip.sh \
406 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
407 ${GENSCRIPTS} elf32elmip "$(tdir_elf32elmip)"
efa6c497
ILT
408eelf32l4300.c: $(srcdir)/emulparams/elf32l4300.sh \
409 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
410 ${GENSCRIPTS} elf32l4300 "$(tdir_elf32l4300)"
411eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
412 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfmips.sc ${GEN_DEPENDS}
413 ${GENSCRIPTS} elf32lmip "$(tdir_elf32lmip)"
414eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \
415 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
416 ${GENSCRIPTS} elf32lppc "$(tdir_elf32lppc)"
417eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
418 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elfppc.sc ${GEN_DEPENDS}
419 ${GENSCRIPTS} elf32ppc "$(tdir_elf32ppc)"
f14a5192
JM
420eelf64alpha.c: $(srcdir)/emulparams/elf64alpha.sh \
421 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
422 ${GENSCRIPTS} elf64alpha "$(tdir_elf64alpha)"
efa6c497
ILT
423eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
424 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
425 ${GENSCRIPTS} elf64_sparc "$(tdir_elf64_sparc)"
426eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
427 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
428 ${GENSCRIPTS} elf_i386 "$(tdir_elf_i386)"
429egld960.c: $(srcdir)/emulparams/gld960.sh \
430 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
431 ${GENSCRIPTS} gld960 "$(tdir_gld960)"
432egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
433 $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
434 ${GENSCRIPTS} gld960coff "$(tdir_gld960coff)"
82ebe9a2 435ego32.c: $(srcdir)/emulparams/go32.sh \
8ddef552 436 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
95d31c3c 437 ${GENSCRIPTS} go32 "$(tdir_go32)"
efa6c497
ILT
438eh8300.c: $(srcdir)/emulparams/h8300.sh \
439 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
440 ${GENSCRIPTS} h8300 "$(tdir_h8300)"
441eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
442 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
443 ${GENSCRIPTS} h8300h "$(tdir_h8300h)"
f14a5192
JM
444eh8300s.c: $(srcdir)/emulparams/h8300s.sh \
445 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300s.sc ${GEN_DEPENDS}
446 ${GENSCRIPTS} h8300s "$(tdir_h8300s)"
efa6c497
ILT
447eh8500.c: $(srcdir)/emulparams/h8500.sh \
448 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
449 ${GENSCRIPTS} h8500 "$(tdir_h8500)"
450eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
451 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
452 ${GENSCRIPTS} h8500b "$(tdir_h8500b)"
453eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
454 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
455 ${GENSCRIPTS} h8500c "$(tdir_h8500c)"
456eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
457 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
458 ${GENSCRIPTS} h8500m "$(tdir_h8500m)"
459eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
460 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
461 ${GENSCRIPTS} h8500s "$(tdir_h8500s)"
82ebe9a2 462ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
8ddef552 463 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
95d31c3c 464 ${GENSCRIPTS} hp300bsd "$(tdir_hp300bsd)"
82ebe9a2 465ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
8ddef552 466 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
95d31c3c 467 ${GENSCRIPTS} hp3hpux "$(tdir_hp3hpux)"
82ebe9a2 468ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
db0a7149 469 $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
95d31c3c 470 ${GENSCRIPTS} hppaelf "$(tdir_hppaelf)"
82ebe9a2 471ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
8ddef552 472 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
95d31c3c 473 ${GENSCRIPTS} i386aout "$(tdir_i386aout)"
efa6c497
ILT
474ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
475 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
476 ${GENSCRIPTS} i386bsd "$(tdir_i386bsd)"
477ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
478 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
479 ${GENSCRIPTS} i386coff "$(tdir_i386coff)"
82ebe9a2 480ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
6c86b9ff 481 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
95d31c3c 482 ${GENSCRIPTS} i386go32 "$(tdir_i386go32)"
efa6c497
ILT
483ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
484 $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
485 ${GENSCRIPTS} i386linux "$(tdir_i386linux)"
486ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
487 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
488 ${GENSCRIPTS} i386lynx "$(tdir_i386lynx)"
82ebe9a2 489ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
3c1af24d 490 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
95d31c3c 491 ${GENSCRIPTS} i386mach "$(tdir_i386mach)"
943fbd5b
KR
492ei386moss.c: $(srcdir)/emulparams/i386moss.sh \
493 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
95d31c3c 494 ${GENSCRIPTS} i386moss "$(tdir_i386moss)"
943fbd5b
KR
495ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \
496 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS}
95d31c3c 497 ${GENSCRIPTS} i386msdos "$(tdir_i386msdos)"
efa6c497
ILT
498ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
499 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
500 ${GENSCRIPTS} i386nbsd "$(tdir_i386nbsd)"
501ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
502 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
503 ${GENSCRIPTS} i386nw "$(tdir_i386nw)"
504ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
505 $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS}
506 ${GENSCRIPTS} i386pe "$(tdir_i386pe)"
82ebe9a2 507elnk960.c: $(srcdir)/emulparams/lnk960.sh \
8ddef552 508 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
95d31c3c 509 ${GENSCRIPTS} lnk960 "$(tdir_lnk960)"
efa6c497
ILT
510em68k4knbsd.c: $(srcdir)/emulparams/m68k4knbsd.sh \
511 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
512 ${GENSCRIPTS} m68k4knbsd "$(tdir_m68k4knbsd)"
513em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
514 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
515 ${GENSCRIPTS} m68kaout "$(tdir_m68kaout)"
2e598345
ILT
516em68kaux.c: $(srcdir)/emulparams/m68kaux.sh \
517 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kaux.sc ${GEN_DEPENDS}
95d31c3c 518 ${GENSCRIPTS} m68kaux "$(tdir_m68kaux)"
82ebe9a2 519em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
8ddef552 520 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
95d31c3c 521 ${GENSCRIPTS} m68kcoff "$(tdir_m68kcoff)"
417ced0d
MM
522em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
523 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
95d31c3c 524 ${GENSCRIPTS} m68kelf "$(tdir_m68kelf)"
efa6c497
ILT
525em68klinux.c: $(srcdir)/emulparams/m68klinux.sh \
526 $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
527 ${GENSCRIPTS} m68klinux "$(tdir_m68klinux)"
82ebe9a2 528em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
028f8872 529 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
95d31c3c 530 ${GENSCRIPTS} m68klynx "$(tdir_m68klynx)"
efa6c497 531em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
8ddef552 532 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
efa6c497
ILT
533 ${GENSCRIPTS} m68knbsd "$(tdir_m68knbsd)"
534em68kpsos.c: $(srcdir)/emulparams/m68kpsos.sh \
535 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/psos.sc ${GEN_DEPENDS}
536 ${GENSCRIPTS} m68kpsos "$(tdir_m68kpsos)"
537em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
538 $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
539 ${GENSCRIPTS} m88kbcs "$(tdir_m88kbcs)"
82ebe9a2 540emipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
8ddef552 541 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
efa6c497 542 ${GENSCRIPTS} mipsbig
82ebe9a2
KR
543emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
544 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
efa6c497 545 ${GENSCRIPTS} mipsbsd
82ebe9a2 546emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
417ced0d 547 $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
95d31c3c 548 ${GENSCRIPTS} mipsidt "$(tdir_mipsidt)"
82ebe9a2 549emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
417ced0d 550 $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
95d31c3c 551 ${GENSCRIPTS} mipsidtl "$(tdir_mipsidtl)"
efa6c497
ILT
552emipslit.c: $(srcdir)/emulparams/mipslit.sh \
553 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
554 ${GENSCRIPTS} mipslit "$(tdir_mipslit)"
555enews.c: $(srcdir)/emulparams/news.sh \
dd37f215 556 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
efa6c497
ILT
557 ${GENSCRIPTS} news "$(tdir_news)"
558ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
82ebe9a2 559 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
efa6c497 560 ${GENSCRIPTS} ns32knbsd "$(tdir_ns32knbsd)"
1ab4cd57 561epc532macha.c: $(srcdir)/emulparams/pc532macha.sh \
cdf71377 562 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
1ab4cd57 563 ${GENSCRIPTS} pc532macha "$(tdir_pc532macha)"
4fe13b2b
MM
564eppcmacos.c: $(srcdir)/emulparams/ppcmacos.sh \
565 $(srcdir)/emultempl/aix.em $(srcdir)/scripttempl/aix.sc ${GEN_DEPENDS}
95d31c3c 566 ${GENSCRIPTS} ppcmacos "$(tdir_ppcmacos)"
32286e08
C
567eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
568 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
95d31c3c 569 ${GENSCRIPTS} ppcnw "$(tdir_ppcnw)"
efa6c497
ILT
570eppcpe.c: $(srcdir)/emulparams/ppcpe.sh \
571 $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/ppcpe.sc ${GEN_DEPENDS}
572 ${GENSCRIPTS} ppcpe "$(tdir_ppcpe)"
efa6c497 573eriscix.c: $(srcdir)/emulparams/riscix.sh \
e93e87cb 574 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
efa6c497
ILT
575 ${GENSCRIPTS} riscix "$(tdir_riscix)"
576esa29200.c: $(srcdir)/emulparams/sa29200.sh \
577 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
578 ${GENSCRIPTS} sa29200 "$(tdir_sa29200)"
579esh.c: $(srcdir)/emulparams/sh.sh \
580 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
581 ${GENSCRIPTS} sh "$(tdir_sh)"
582eshl.c: $(srcdir)/emulparams/shl.sh \
583 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
584 ${GENSCRIPTS} shl "$(tdir_shl)"
585esparcaout.c: $(srcdir)/emulparams/sparcaout.sh \
e93e87cb 586 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
efa6c497
ILT
587 ${GENSCRIPTS} sparcaout "$(tdir_sparcaout)"
588esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
589 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
590 ${GENSCRIPTS} sparclynx "$(tdir_sparclynx)"
32286e08 591esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
e93e87cb 592 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
95d31c3c 593 ${GENSCRIPTS} sparcnbsd "$(tdir_sparcnbsd)"
efa6c497
ILT
594est2000.c: $(srcdir)/emulparams/st2000.sh \
595 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
596 ${GENSCRIPTS} st2000 "$(tdir_st2000)"
597esun3.c: $(srcdir)/emulparams/sun3.sh \
598 $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
599 ${GENSCRIPTS} sun3 "$(tdir_sun3)"
600esun4.c: $(srcdir)/emulparams/sun4.sh \
601 $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
602 ${GENSCRIPTS} sun4 "$(tdir_sun4)"
603evanilla.c: $(srcdir)/emulparams/vanilla.sh \
604 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
605 ${GENSCRIPTS} vanilla "$(tdir_vanilla)"
606evax.c: $(srcdir)/emulparams/vax.sh \
607 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
608 ${GENSCRIPTS} vax "$(tdir_vax)"
609evsta.c: $(srcdir)/emulparams/vsta.sh \
610 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
611 ${GENSCRIPTS} vsta "$(tdir_vsta)"
612ew65.c: $(srcdir)/emulparams/w65.sh \
613 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
614 ${GENSCRIPTS} w65 "$(tdir_w65)"
65d22248
C
615ez8001.c: $(srcdir)/emulparams/z8001.sh \
616 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
95d31c3c 617 ${GENSCRIPTS} z8001 "$(tdir_z8001)"
65d22248
C
618ez8002.c: $(srcdir)/emulparams/z8002.sh \
619 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS}
95d31c3c 620 ${GENSCRIPTS} z8002 "$(tdir_z8002)"
eb02fd64 621
2e598345
ILT
622$(LD_PROG): $(OFILES) $(BFDDEP) $(LIBIBERTY)
623 $(CC) $(HLDFLAGS) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
d17eb3db
ILT
624
625# The generated emulation files mostly have the same dependencies.
d66c832b
ILT
626$(EMULATION_OFILES): ../bfd/bfd.h sysdep.h config.h $(INCDIR)/bfdlink.h \
627 ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h \
2a80ec10 628 ldctor.h ldexp.h ldlang.h ldgram.h
4a6afc88 629
3a9149a7
JW
630# These targets are for the dejagnu testsuites. The file site.exp
631# contains global variables that all the testsuites will use.
3a9149a7 632
d301e438
JW
633site.exp: ./config.status Makefile
634 @echo "Making a new config file..."
3a9149a7 635 @rm -f ./tmp?
d301e438 636 @touch site.exp
3a9149a7 637 @mv site.exp site.bak
d301e438
JW
638 @echo "## variables are automatically generated by make ##" > ./tmp0
639 @echo "# Do not edit here. If you wish to override these" >> ./tmp0
640 @echo "# values, add them to the last section" >> ./tmp0
3a9149a7 641 @echo "# HOST AND TARGET INFO" >> ./tmp0
d66c832b
ILT
642 @echo "set host_os @host_os@" >> ./tmp0
643 @echo "set host_alias @host_alias@" >> ./tmp0
644 @echo "set host_cpu @host_cpu@" >> ./tmp0
645 @echo "set host_vendor @host_vendor@" >> ./tmp0
646 @echo "set target_os @target_os@" >> ./tmp0
647 @echo "set target_alias @target_alias@" >> ./tmp0
648 @echo "set target_cpu @target_cpu@" >> ./tmp0
649 @echo "set target_vendor @target_vendor@" >> ./tmp0
650 @echo "set host_triplet @host@" >> ./tmp0
651 @echo "set target_triplet @target@" >> ./tmp0
3a9149a7 652 @echo "# DIRECTORY INFO" >> ./tmp0
d301e438 653 @echo "set objdir `pwd`" >> ./tmp0
d301e438 654 @echo "" >> ./tmp0
32286e08 655 @echo "# LD DEPENDENCIES" >> ./tmp0
3a9149a7
JW
656 @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
657 @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
658 @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
659 @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
660 @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
661 @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
d301e438
JW
662 @echo "" >> ./tmp0
663 @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
664 @cat ./tmp0 > site.exp
665 @cat site.bak | sed \
666 -e '1,/^## Variables generated by.*##/ d' >> site.exp
667 -@rm -f ./tmp?
8ddef552 668
64bb143c 669check: site.exp
32286e08
C
670 r=`pwd`; export r; \
671 srcroot=`cd ${srcdir}; pwd` ; export srcroot ; \
672 EXPECT=${EXPECT} ; export EXPECT ; \
ad43e45b
ILT
673 $(RPATH_ENVVAR)=$$r/../bfd:$$r/../opcodes:$$$(RPATH_ENVVAR); \
674 export $(RPATH_ENVVAR); \
32286e08
C
675 if [ -f $$r/../expect/expect ] ; then \
676 TCL_LIBRARY=$${srcroot}/../tcl/library ; \
0128cbae
KR
677 export TCL_LIBRARY ; \
678 else true ; fi ; \
32286e08
C
679 $(RUNTEST) --tool ld --srcdir $(srcdir)/testsuite $(RUNTESTFLAGS) \
680 CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
417ced0d
MM
681 CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
682 CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)"
d301e438 683
8ddef552 684installcheck:
4a6afc88 685.PHONY: check installcheck
e7921bd4 686
7e5c1057 687# Rules for testing by relinking ld itself.
32286e08
C
688# A similar test is in the testsuite. This target is for ease of use
689# when porting ld.
eb02fd64 690
7e5c1057 691ld-partial.o: ld.new
a04f1d00 692 ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
7e5c1057 693ld1: ld-partial.o
a04f1d00 694 ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 695
7e5c1057 696ld1-full: ld.new
a04f1d00 697 ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 698
d20fb445 699ld2: ld1
a04f1d00 700 ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
60048a2c 701
eb02fd64 702ld3: ld2
a04f1d00 703 ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 704
d20fb445
SC
705bootstrap: ld3
706 cmp ld2 ld3
707
4a6afc88
ILT
708.PHONY: bootstrap
709
8ddef552 710# A test program for C++ constructors and destructors.
32286e08
C
711# This test is now in the testsuite.
712#
713#cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
714# ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
715# cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
716#
717#cdtest.out: cdtest
718# ./cdtest > cdtest.tmp
719# mv cdtest.tmp cdtest.out
720#
721#cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
722# ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
723# cdtest-bar.o cdtest-foo.o
724#
725#cdtest-ur: cdtest-ur.o
726# ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
727# $(HOSTING_LIBS)
728#
729#cdtest-ur.out: cdtest-ur
730# ./cdtest-ur > cdtest-ur.tmp
731# mv cdtest-ur.tmp cdtest-ur.out
732#
733#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
734# diff $(srcdir)/cdtest.exp cdtest.out
735# diff $(srcdir)/cdtest.exp cdtest-ur.out
736#
737#.PHONY: check-cdtest
4a6afc88 738
d301e438 739# END OF CHECK TARGETS
917bffa7 740
8073190b 741# DOCUMENTATION TARGETS
2412a768
RP
742# Manual configuration file; not usually attached to normal configuration,
743# because almost all configs use "gen" version of manual.
744# Set DOCVER above to change.
745configdoc.texi: ${DOCVER}-doc.texi
034351e3
PB
746 ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
747 ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
748 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
2412a768 749
8073190b 750# TeX output
2412a768 751dvi: ld.dvi
d4e5e3c3 752ld.dvi: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
4a6afc88 753 TEXINPUTS=$(BFDDIR)/doc:$$TEXINPUTS $(TEXI2DVI) $(srcdir)/ld.texinfo
2412a768 754
4b91c519 755ldint.dvi: $(srcdir)/ldint.texinfo
2412a768 756 $(TEXI2DVI) $(srcdir)/ldint.texinfo
8d317d2a 757
8073190b 758# info file for online browsing
4ecfad79 759ld.info: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
959eba20 760 $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo
eb02fd64 761
4b91c519
PB
762ldint.info: $(srcdir)/ldint.texinfo
763 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
764
4a6afc88
ILT
765.PHONY: dvi
766
954ac2ea 767#separate targets for "ms", "me", and "mm" forms of roff doc
e06ba18d
PB
768# Try to use a recent texi2roff. v2 was put on prep in jan91.
769# If you want an index, see texi2roff doc for postprocessing
770# and add -i to texi2roff invocations below.
771# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
772# correspondint -e lines when later texi2roff's are current)
773# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
774# + @c's deleted explicitly because texi2roff sees texinfo commands in them
775# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
776# + @alphaenumerate is ridiculously new, turned into @enumerate
777
9c7810d6 778ld.ms: $(srcdir)/ld.texinfo
8073190b
RP
779 sed -e '/\\input texinfo/d' \
780 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
781 -e '/^@ifinfo/,/^@end ifinfo/d' \
782 -e '/^@c/d' \
783 -e 's/{.*,,/{/' \
784 -e 's/@ / /g' \
785 -e 's/^@alphaenumerate/@enumerate/g' \
786 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 787 $(srcdir)/ld.texinfo | \
e06ba18d
PB
788 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
789 sed -e 's/---/\\(em/g' \
790 >>ld.ms
8073190b
RP
791
792# index for roff output
793ld-index.ms: ld.ms
794 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
795 sed -e '/: warning:/d' | \
796 texi2index >ld-index.ms
797
954ac2ea 798# roff output (-mm)
9c7810d6 799ld.mm: $(srcdir)/ld.texinfo
954ac2ea
RP
800 sed -e '/\\input texinfo/d' \
801 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
802 -e '/^@ifinfo/,/^@end ifinfo/d' \
803 -e '/^@c/d' \
9c7810d6
RP
804 -e 's/{.*,,/{/' \
805 -e '/@noindent/d' \
e06ba18d
PB
806 -e 's/@ / /g' \
807 -e 's/^@alphaenumerate/@enumerate/g' \
808 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 809 $(srcdir)/ld.texinfo | \
e06ba18d 810 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
9c7810d6
RP
811 sed -e 's/---/\\(em/g' \
812 >ld.mm
954ac2ea
RP
813
814# index for roff output
815ld-index.mm: ld.mm
816 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
817 sed -e '/: warning:/d' | \
818 texi2index >ld-index.mm
819
820# roff output (-me)
9c7810d6 821ld.me: $(srcdir)/ld.texinfo
954ac2ea
RP
822 sed -e '/\\input texinfo/d' \
823 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
824 -e '/^@ifinfo/,/^@end ifinfo/d' \
825 -e '/^@c/d' \
826 -e 's/{.*,,/{/' \
827 -e 's/@ / /g' \
828 -e 's/^@alphaenumerate/@enumerate/g' \
829 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 830 $(srcdir)/ld.texinfo | \
e06ba18d
PB
831 $(TEXI2ROFF) $(TEXI2OPT) -me | \
832 sed -e 's/---/\\(em/g' \
833 >>ld.me
954ac2ea
RP
834
835# index for roff output
836ld-index.me: ld.me
837 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
838 sed -e '/: warning:/d' | \
839 texi2index >ld-index.me
840
e7921bd4 841stage1: force
e06ba18d 842 -mkdir stage1
ab57b174 843 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
e06ba18d 844 -(cd stage1 ; ln -s $(LD_PROG) ld)
f78e2569 845
e7921bd4 846stage2: force
e06ba18d 847 -mkdir stage2
ab57b174 848 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
e06ba18d 849 -(cd stage2 ; ln -s $(LD_PROG) ld)
f78e2569 850
e7921bd4 851stage3: force
e06ba18d 852 -mkdir stage3
ab57b174 853 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
e06ba18d 854 -(cd stage3 ; ln -s $(LD_PROG) ld)
eb02fd64 855
74e6b793 856against = stage2
e46cdcdd
RP
857
858comparison: force
ab57b174 859 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
e46cdcdd 860
e7921bd4 861de-stage1: force
e06ba18d
PB
862 -(cd stage1 ; mv -f * ..)
863 -rm ld
864 -rmdir stage1
e7921bd4
RP
865
866de-stage2: force
e06ba18d
PB
867 -(cd stage2 ; mv -f * ..)
868 -rm ld
869 -rmdir stage2
e7921bd4
RP
870
871de-stage3: force
e06ba18d
PB
872 -(cd stage3 ; mv -f * ..)
873 -rm ld
874 -rmdir stage3
e7921bd4 875
4a6afc88
ILT
876.PHONY: stage1 stage2 stage3 comparison de-stage1 de-stage2 de-stage3
877
ab57b174 878# Stuff that should be included in a distribution:
74e6b793 879LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
8a8965f1 880diststuff: $(LDDISTSTUFF) info
ab57b174
ILT
881
882mostlyclean:
f40d9bc2 883 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp] config.log
083038a7 884 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out cdtest.tmp
1ab4cd57 885 -rm -f cdtest-ur cdtest-ur.out cdtest-ur.tmp crtbegin.o crtend.o
dfc84b08 886 -rm -f ldemul-list.h
82ebe9a2 887 -rm -fr tmpdir
ab57b174 888clean: mostlyclean
1e45c4c3 889 -rm -f $(LD_PROG) configdoc.texi
417ced0d 890distclean: clean
f40d9bc2
ILT
891 -rm -f Makefile config.status TAGS site.exp site.bak config.cache
892 -rm -f config.h stamp-h
893 -rm -rf ldscripts
4977f3b4
ILT
894maintainer-clean realclean: clean distclean
895 @echo "This command is intended for maintainers to use;"
896 @echo "it deletes files that may require special tools to rebuild."
dfc84b08 897 -rm -f $(GENERATED_CFILES) $(GENERATED_HFILES)
8a8965f1 898 -rm -f $(LDDISTSTUFF) *.info*
eb02fd64 899
4a6afc88
ILT
900.PHONY: diststuff mostlyclean clean distclean realclean
901
902lintlog:$(LINTSOURCES) Makefile
2ee11735 903 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
eb02fd64
RP
904| grep -v "pointer casts may be troublesome" \
905| grep -v "possible pointer alignment problem" \
906| grep -v "ignore" \
907| grep -v "conversion from long may lose accuracy" \
908| grep -v "warning: constant argument to NOT" \
909| grep -v "enumeration type clash, operator CAST" \
910| grep -v "warning: constant in conditional context"\
911| grep -v "archive\.c"
912
913
cbb5c2d1
DM
914TAGS:
915 etags -t $(srcdir)/*.[chly] *.[chly]
eb02fd64 916
eb02fd64 917
91b3a2b6 918install:
8ddef552
DM
919 $(INSTALL_XFORM) ld.new $(bindir)/ld
920 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
173a0c3d
DM
921 for f in ldscripts/*; do \
922 $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
d360d135 923 done
2c7aeec6
TT
924 test -d $(tooldir) || mkdir $(tooldir)
925 test -d $(tooldir)/bin || mkdir $(tooldir)/bin
b5f076d4 926 -n=`echo ld | sed '$(program_transform_name)'`; \
56409445 927 rm -f $(tooldir)/bin/ld; \
188ce705 928 ln $(bindir)/$$n $(tooldir)/bin/ld >/dev/null 2>/dev/null \
e357065c 929 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
e06ba18d 930
db0a7149 931install-info: ld.info
82ebe9a2
KR
932 if [ -r ld.info ]; then \
933 dir=. ; \
934 else \
935 dir=$(srcdir) ; \
936 fi ; \
937 for i in `cd $$dir ; echo ld.info*` ; do \
938 $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
afe3aa73
RP
939 done
940
12fa72d4
SC
941clean-info:
942 -rm -rf *.info*
943
4a6afc88 944.PHONY: install install-info clean-info
eb02fd64 945
4a6afc88
ILT
946# Targets to rebuild dependencies in this Makefile.
947# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
208bc89e 948.dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h
4a6afc88
ILT
949 rm -f .dep1
950 $(MAKE) DEP=$(DEP) .dep1
951 sed -f dep.sed <.dep1 >.dep
eb02fd64 952
4a6afc88
ILT
953# This rule really wants a mkdep that runs "gcc -MM".
954.dep1: $(CFILES) $(GENERATED_CFILES)
955 rm -f .dep2
956 echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
957 $(DEP) -f .dep2 $(ALL_CFLAGS) $?
958 $(srcdir)/../move-if-change .dep2 .dep1
eb02fd64 959
4a6afc88
ILT
960dep.sed: dep-in.sed config.status
961 sed <$(srcdir)/dep-in.sed >dep.sed \
962 -e 's!@INCDIR@!$(INCDIR)!' \
d66c832b 963 -e 's!@SRCDIR@!$(srcdir)!'
eb02fd64 964
4a6afc88
ILT
965dep: .dep
966 sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
967 cat .dep >> tmp-Makefile
968 $(srcdir)/../move-if-change tmp-Makefile Makefile
239d28f3 969
4a6afc88
ILT
970dep-in: .dep
971 sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
972 cat .dep >> tmp-Makefile.in
973 $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
974
975.PHONY: dep dep-in
239d28f3 976
eb02fd64
RP
977# Dummy target to force execution of dependent targets.
978#
e7921bd4 979force:
eb02fd64 980
4a6afc88 981.PHONY: force
eb02fd64 982
d66c832b
ILT
983Makefile: Makefile.in config.status
984 CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status
985
986config.h: stamp-h ; @true
ef346f1a
ILT
987stamp-h: config.in config.status
988 CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status
d66c832b 989
ed753c20 990config.status: configure configure.host configure.tgt
d66c832b 991 $(SHELL) ./config.status --recheck
eb02fd64 992
4a6afc88
ILT
993# What appears below is generated by a hacked mkdep using gcc -MM.
994
995# DO NOT DELETE THIS LINE -- mkdep uses it.
996# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
997
dd37f215 998ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 999 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
4a6afc88 1000 $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldmisc.h \
fb5b11ee 1001 ldgram.h ldmain.h ldctor.h
dd37f215 1002ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b
ILT
1003 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
1004 ld.h ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h \
1005 ldemul-list.h
dd37f215 1006ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1007 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
4a6afc88
ILT
1008 $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \
1009 ldgram.h ldlang.h
dd37f215 1010ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1011 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
65d22248
C
1012 $(INCDIR)/bfdlink.h ld.h ldmisc.h ldexp.h ldlang.h \
1013 ldfile.h ldmain.h ldgram.h ldlex.h ldemul.h
dd37f215 1014ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1015 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
4725fb48
ILT
1016 $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
1017 ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
1018 ldctor.h ldfile.h
dd37f215 1019ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1020 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
65d22248 1021 $(INCDIR)/libiberty.h $(INCDIR)/progress.h $(INCDIR)/bfdlink.h \
d66c832b
ILT
1022 ld.h ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
1023 ldemul.h ldlex.h ldfile.h ldctor.h
dd37f215 1024ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1025 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
efa6c497
ILT
1026 $(INCDIR)/libiberty.h $(INCDIR)/demangle.h ld.h ldmisc.h \
1027 ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h ldfile.h
dd37f215 1028ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1029 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
4a6afc88 1030 ld.h ldver.h ldemul.h ldmain.h
dd37f215 1031ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1032 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
2c7aeec6
TT
1033 $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h ldexp.h \
1034 ldlang.h ldwrite.h ldmisc.h ldgram.h ldmain.h
dd37f215 1035lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b
ILT
1036 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
1037 $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
1038 ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \
1039 ldver.h ldemul.h
dd37f215 1040mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
d66c832b 1041 sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldexp.h \
4a6afc88 1042 ldlang.h ldmisc.h mri.h ldgram.h
f14a5192
JM
1043ldcref.o: ldcref.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
1044 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
1045 $(INCDIR)/bfdlink.h $(INCDIR)/libiberty.h ld.h ldmain.h \
1046 ldmisc.h
dd37f215 1047ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
d66c832b 1048 $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \
4a6afc88
ILT
1049 $(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldemul.h \
1050 ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
d66c832b
ILT
1051ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h sysdep.h \
1052 config.h $(INCDIR)/fopen-same.h ld.h ldgram.h ldmisc.h \
1053 ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h
239d28f3
SC
1054
1055# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.233283 seconds and 4 git commands to generate.