5529db7d558de0af66b3b40855cdbfd1e80c5118
[deliverable/binutils-gdb.git] / ld / Makefile.in
1 # Makefile for the GNU linker ld (version 2)
2 # Copyright (C) 1989, 90, 91, 92, 93, 1994 Free Software Foundation, Inc.
3
4 # This file is part of GNU ld.
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20
21 srcdir = .
22 objdir = .
23
24 prefix = /usr/local
25
26 program_transform_name =
27 exec_prefix = $(prefix)
28 bindir = $(exec_prefix)/bin
29 libdir = $(exec_prefix)/lib
30 tooldir = $(exec_prefix)/$(target_alias)
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 docdir = $(datadir)/doc
45 # We put the scripts in the directory $(scriptdir)/ldscripts.
46 # We can't put the scripts in $(datadir) because the SEARCH_DIR
47 # directives need to be different for native and cross linkers.
48 scriptdir = $(tooldir)/lib
49
50 SHELL = /bin/sh
51
52 INSTALL = `cd $(srcdir); pwd`/../install.sh -c
53 INSTALL_PROGRAM = $(INSTALL)
54 INSTALL_DATA = $(INSTALL)
55 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
56 INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
57
58 AR = ar
59 AR_FLAGS = qv
60 CFLAGS = -g
61 MAKEINFO = makeinfo
62 TEXI2DVI = texi2dvi
63 RANLIB = ranlib
64 CC_FOR_BUILD=$(CC)
65 BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
66 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
67
68 # Seach path to override the default search path for -lfoo libraries.
69 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
70 # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
71 # a cross-linker, in which case the default is empty. See genscripts.sh.)
72 # Otherwise, they are replaced with the ones given in LIB_PATH,
73 # which may have the form: LIB_PATH=/lib:/usr/local/lib
74 LIB_PATH =
75
76 # Additional libraries which are used when ld is built native. This
77 # is set by some host makefile fragments.
78 NATIVE_LIB_DIRS =
79
80 BASEDIR = $(srcdir)/..
81 BFDDIR = $(BASEDIR)/bfd
82 INCDIR = $(BASEDIR)/include
83 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
84 DEP = mkdep
85
86 # What version of the manual to build
87 DOCVER = gen
88
89 # Where to find texinfo.tex to format docn with TeX
90 TEXIDIR = $(srcdir)/../texinfo
91
92 # Where to find other docs needed to format with TeX
93 TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir)
94
95 # Whether to get roff to put indexing entries on stderr
96 TEXI2OPT =
97 # You neeed this to generate ld-index.ms (or .mm or .me)
98 # TEXI2OPT = -i
99
100 TEXI2ROFF=texi2roff
101
102 # Which roff program to use to generate index for texi2roff'd doc
103 ROFF = groff
104
105 #stuff for self hosting (can be overridden in config file).
106 HOSTING_CRT0 = /lib/crt0.o
107 HOSTING_LIBS = `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
108 HOSTING_EMU = -m $(EMUL)
109
110 CXX = `if [ -f ../gcc/xgcc ] ; then \
111 echo ../gcc/xgcc -B../gcc/; \
112 else echo gcc; \
113 fi`
114 CXXFLAGS = -fgnu-linker
115
116 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
117 CXX = g++
118
119 # Setup the testing framework, if you have one
120 EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
121 echo $${rootme}/../../expect/expect ; \
122 else echo expect ; fi`
123
124 RUNTEST = `if [ -f $${srcdir}/../../dejagnu/runtest ] ; then \
125 echo $${srcdir}/../../dejagnu/runtest ; \
126 else echo runtest ; fi`
127 RUNTESTFLAGS =
128 RUNTEST_CC = `if [ -f ../gcc/xgcc ] ; then \
129 echo ../gcc/xgcc -B../gcc/; \
130 else echo gcc; \
131 fi`
132 RUNTEST_CFLAGS = $(CFLAGS)
133 RUNTEST_CXX = `if [ -f ../gcc/xgcc ] ; then \
134 echo ../gcc/xgcc -B../gcc/; \
135 else echo gcc; \
136 fi`
137 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
138 RUNTEST_CXX = $(CXX)
139 RUNTEST_CXXFLAGS = $(CXXFLAGS)
140
141 # go directly to ld.new in case this ld isn't capable of
142 # linking native object on this host. It can be renamed on
143 # install.
144 LD_PROG = ld.new
145
146 all: $(LD_PROG)
147 .PHONY: all
148
149 ### Host, target, and site specific Makefile fragments come in here.
150 ####
151
152 LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
153
154 # The .cc suffix is used by `make check'.
155
156 .SUFFIXES: .y $(SUFFIXES) .cc
157
158 # Suppress smart makes who think they know how to automake Yacc files
159 .y.c:
160
161 # This rule is used for the check-cdtest target.
162 .cc.o:
163 $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
164
165 ALL_CFLAGS = $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS)
166 .c.o:
167 $(CC) -c $(ALL_CFLAGS) $<
168
169 # for self hosting
170 BFDLIB = ../bfd/libbfd.a
171 LIBIBERTY = ../libiberty/libiberty.a
172
173 ALL_EMULATIONS = elnk960.o esun3.o ei386aout.o ego32.o evsta.o \
174 em88kbcs.o ea29k.o enews.o ehp300bsd.o ehp3hpux.o \
175 eh8300.o eh8300h.o eebmon29k.o esun4.o egld960.o \
176 em68kcoff.o est2000.o esa29200.o ei386mach.o \
177 evanilla.o ei386coff.o ez8ksim.o emipslit.o ei386bsd.o \
178 emipsbig.o emipsbsd.o emipsidt.o evax.o eh8500.o \
179 eh8500b.o eh8500s.o eh8500c.o eh8500m.o \
180 ehppaelf.o emipsidtl.o esh.o eelf_i386.o ealpha.o \
181 ei386lynx.o em68klynx.o esparclynx.o ecoff_sparc.o \
182 eelf32ppc.o ei386go32.o em68kaout.o ei386linux.o \
183 eelf32_sparc.o eelf64_sparc.o eriscix.o eelf32mipb.o eelf32mipl.o
184
185 CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
186 ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
187 mri.c
188
189 HFILES = config.h ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
190 ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
191 ldwrite.h mri.h
192
193 GENERATED_CFILES = ldgram.c ldlex.c
194 GENERATED_HFILES = ldgram.h ldemul-list.h
195
196 OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
197 ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
198 ldfile.o ${EMULATION_OFILES}
199
200 LINTSOURCES = $(CFILES) $(GENERATED_CFILES) e*.c
201
202 STAGESTUFF = *.o ldscripts/* e*.c
203
204 info: ld.info
205 .PHONY: info
206
207 ldgram.h ldgram.c: ldgram.y
208 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
209 mv -f y.tab.c ldgram.c
210 mv -f y.tab.h ldgram.h
211
212 # EMUL is the name of a file in the emulparams subdir, without the .sh.
213 ldmain.o: ldmain.c config.status
214 if [ -z "$(EMUL)" ] ; then \
215 echo "you must set a default emulation" 1>&2 ; \
216 exit 1 ; \
217 else \
218 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $< ; \
219 fi
220
221 ldemul-list.h: Makefile
222 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
223 for f in `echo " " ${EMULATION_OFILES} "" \
224 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
225 echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
226 done;\
227 echo "";\
228 echo "#define EMULATION_LIST \\";\
229 for f in `echo " " ${EMULATION_OFILES} "" \
230 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
231 echo " &ld_$${f}_emulation, \\"; \
232 done;\
233 echo " 0") >ldemul-tmp.h
234 mv ldemul-tmp.h ldemul-list.h
235
236 ldlex.c: ldlex.l
237 $(LEX) -I -Cem $(srcdir)/ldlex.l
238 -sed -e '/^int.*free();/d' \
239 -e '/^char.*malloc();/d' \
240 -e 's/malloc/xmalloc/g' \
241 < lex.yy.c > ldlex.c.new
242 -rm lex.yy.c
243 mv ldlex.c.new ./ldlex.c
244
245 # These all start with e so 'make clean' can find them.
246
247 GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)"
248 GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
249
250 esun4.c: $(srcdir)/emulparams/sun4.sh \
251 $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
252 ${GENSCRIPTS} sun4
253 esun3.c: $(srcdir)/emulparams/sun3.sh \
254 $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
255 ${GENSCRIPTS} sun3
256 evsta.c: $(srcdir)/emulparams/vsta.sh \
257 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
258 ${GENSCRIPTS} vsta
259 ego32.c: $(srcdir)/emulparams/go32.sh \
260 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
261 ${GENSCRIPTS} go32
262 enews.c: $(srcdir)/emulparams/news.sh \
263 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
264 ${GENSCRIPTS} news
265 evax.c: $(srcdir)/emulparams/vax.sh \
266 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
267 ${GENSCRIPTS} vax
268 ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
269 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
270 ${GENSCRIPTS} hp300bsd
271 ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
272 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
273 ${GENSCRIPTS} hp3hpux
274 ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
275 $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
276 ${GENSCRIPTS} hppaelf
277 ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
278 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
279 ${GENSCRIPTS} i386aout
280 ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
281 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
282 ${GENSCRIPTS} i386go32
283 ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
284 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
285 ${GENSCRIPTS} i386mach
286 eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
287 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
288 ${GENSCRIPTS} ebmon29k
289 esa29200.c: $(srcdir)/emulparams/sa29200.sh \
290 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
291 ${GENSCRIPTS} sa29200
292 ea29k.c: $(srcdir)/emulparams/a29k.sh \
293 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
294 ${GENSCRIPTS} a29k
295 em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
296 $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
297 ${GENSCRIPTS} m88kbcs
298 eh8300.c: $(srcdir)/emulparams/h8300.sh \
299 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
300 ${GENSCRIPTS} h8300
301 eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
302 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
303 ${GENSCRIPTS} h8300h
304 eh8500.c: $(srcdir)/emulparams/h8500.sh \
305 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
306 ${GENSCRIPTS} h8500
307 eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
308 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
309 ${GENSCRIPTS} h8500b
310 eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
311 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
312 ${GENSCRIPTS} h8500c
313 eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
314 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
315 ${GENSCRIPTS} h8500m
316 eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
317 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
318 ${GENSCRIPTS} h8500s
319 esh.c: $(srcdir)/emulparams/sh.sh \
320 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
321 ${GENSCRIPTS} sh
322 est2000.c: $(srcdir)/emulparams/st2000.sh \
323 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
324 ${GENSCRIPTS} st2000
325 ez8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
326 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
327 ${GENSCRIPTS} z8ksim
328 evanilla.c: $(srcdir)/emulparams/vanilla.sh \
329 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
330 ${GENSCRIPTS} vanilla
331 elnk960.c: $(srcdir)/emulparams/lnk960.sh \
332 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
333 ${GENSCRIPTS} lnk960
334 egld960.c: $(srcdir)/emulparams/gld960.sh \
335 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
336 ${GENSCRIPTS} gld960
337 egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
338 $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
339 ${GENSCRIPTS} gld960coff
340 em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
341 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
342 ${GENSCRIPTS} m68kcoff
343 em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
344 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
345 ${GENSCRIPTS} m68klynx
346 ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
347 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
348 ${GENSCRIPTS} i386coff
349 ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
350 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
351 ${GENSCRIPTS} i386lynx
352 emipslit.c: $(srcdir)/emulparams/mipslit.sh \
353 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
354 ${GENSCRIPTS} mipslit
355 ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
356 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
357 ${GENSCRIPTS} i386bsd
358 emipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
359 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
360 ${GENSCRIPTS} mipsbig
361 emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
362 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
363 ${GENSCRIPTS} mipsbsd
364 emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
365 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
366 ${GENSCRIPTS} mipsidt
367 emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
368 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
369 ${GENSCRIPTS} mipsidtl
370 eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
371 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
372 ${GENSCRIPTS} elf_i386
373 eelf32mipb.c: $(srcdir)/emulparams/elf32mipb.sh \
374 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
375 ${GENSCRIPTS} elf32mipb
376 eelf32mipl.c: $(srcdir)/emulparams/elf32mipl.sh \
377 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
378 ${GENSCRIPTS} elf32mipl
379 ealpha.c: $(srcdir)/emulparams/alpha.sh \
380 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
381 ${GENSCRIPTS} alpha
382 ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
383 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
384 ${GENSCRIPTS} coff_sparc
385 esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
386 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
387 ${GENSCRIPTS} sparclynx
388 eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
389 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
390 ${GENSCRIPTS} elf32ppc
391 eriscix.c: $(srcdir)/emulparams/riscix.sh \
392 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
393 ${GENSCRIPTS} riscix
394 em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
395 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
396 ${GENSCRIPTS} m68kaout
397 ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
398 $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
399 ${GENSCRIPTS} i386linux
400 eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
401 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
402 ${GENSCRIPTS} elf32_sparc
403 eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
404 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
405 ${GENSCRIPTS} elf64_sparc
406
407 epc532machaout.c: $(srcdir)/emulparams/pc532machaout.sh \
408 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
409 ${GENSCRIPTS} pc532machaout
410
411 enetbsd532.c: $(srcdir)/emulparams/netbsd532.sh \
412 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
413 ${GENSCRIPTS} netbsd532
414
415 $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
416 $(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
417
418 # The generated emulation files mostly have the same dependencies.
419 $(EMULATION_OFILES): ../bfd/bfd.h ../bfd/sysdep.h $(INCDIR)/bfdlink.h \
420 ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h config.h \
421 ldctor.h ldexp.h ldlang.h
422
423 # These targets are for the dejagnu testsuites. The file site.exp
424 # contains global variables that all the testsuites will use.
425 # There is a current debate as to how and where to generate test
426 # outputs. Rob feels each test should be built in $(objdir) with
427 # a unique name. Cassidy feels that we should create a directory
428 # called $(objdir)/tmpdir and do the work there. This way, there
429 # is no potential conflict with existing objects, ie: as there
430 # was in the past with loop.o and flow.o, and, there is no chance
431 # of filling /tmp, which would cause other problems. Lastly, this
432 # allow retention of the testcase name making debugging easier.
433 #
434 testdir = $(objdir)/tmpdir
435
436 site.exp: ./config.status Makefile
437 @if [ -d $(testdir) ]; then true; else mkdir $(testdir); fi
438 @echo "Making a new config file..."
439 @rm -f ./tmp?
440 @touch site.exp
441 @mv site.exp site.bak
442 @echo "## variables are automatically generated by make ##" > ./tmp0
443 @echo "# Do not edit here. If you wish to override these" >> ./tmp0
444 @echo "# values, add them to the last section" >> ./tmp0
445 @echo "# HOST AND TARGET INFO" >> ./tmp0
446 @echo "set host_os $(host_os)" >> ./tmp0
447 @echo "set host_alias $(host_alias)" >> ./tmp0
448 @echo "set host_cpu $(host_cpu)" >> ./tmp0
449 @echo "set host_vendor $(host_vendor)" >> ./tmp0
450 @echo "set target_os $(target_os)" >> ./tmp0
451 @echo "set target_alias $(target_alias)" >> ./tmp0
452 @echo "set target_cpu $(target_cpu)" >> ./tmp0
453 @echo "set target_vendor $(target_vendor)" >> ./tmp0
454 @echo "set host_triplet $(host_canonical)" >> ./tmp0
455 @echo "set target_triplet $(target_canonical)" >> ./tmp0
456 @echo "# DIRECTORY INFO" >> ./tmp0
457 @echo "set objdir `pwd`" >> ./tmp0
458 @echo "set tmpdir `cd $(testdir); pwd`" >> ./tmp0
459 @echo "" >> ./tmp0
460 @echo "# LD DEPENDANCIES" >> ./tmp0
461 @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
462 @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
463 @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
464 @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
465 @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
466 @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
467 @echo "" >> ./tmp0
468 @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
469 @cat ./tmp0 > site.exp
470 @cat site.bak | sed \
471 -e '1,/^## Variables generated by.*##/ d' >> site.exp
472 -@rm -f ./tmp?
473
474 check: site.exp
475 @if [ $(host_canonical) = $(target_canonical) ]; then \
476 rootme=`pwd`; export rootme; \
477 srcdir=${srcdir} ; export srcdir ; \
478 EXPECT=${EXPECT} ; export EXPECT ; \
479 if [ -f $${rootme}/../expect/expect ] ; then \
480 TCL_LIBRARY=$${srcdir}/../tcl/library ; \
481 export TCL_LIBRARY ; fi ; \
482 $(RUNTEST) --tool ld \
483 --srcdir $(srcdir)/testsuite $(RUNTESTFLAGS) \
484 CC="$(RUNTEST_CC)" CFLAGS="$(RUNTEST_CFLAGS)" \
485 CXX="$(RUNTEST_CXX)" CXXFLAGS="$(RUNTEST_CXXFLAGS)" ;\
486 if [ $$? != 0 ]; then exit 1; else true; fi ;\
487 else \
488 echo No cross-linker tests yet. ;\
489 fi
490
491 installcheck:
492 .PHONY: check installcheck
493
494 # Rules for testing by relinking ld itself.
495
496 ld-partial.o: ld.new
497 ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
498 ld1: ld-partial.o
499 ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
500
501 ld1-full: ld.new
502 ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
503
504 ld2: ld1
505 ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
506
507 ld3: ld2
508 ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
509
510 bootstrap: ld3
511 cmp ld2 ld3
512
513 .PHONY: bootstrap
514
515 # A test program for C++ constructors and destructors.
516
517 cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
518 ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
519 cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
520
521 cdtest.out: cdtest
522 ./cdtest > cdtest.tmp
523 mv cdtest.tmp cdtest.out
524
525 cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
526 ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
527 cdtest-bar.o cdtest-foo.o
528
529 cdtest-ur: cdtest-ur.o
530 ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
531 $(HOSTING_LIBS)
532
533 cdtest-ur.out: cdtest-ur
534 ./cdtest-ur > cdtest-ur.tmp
535 mv cdtest-ur.tmp cdtest-ur.out
536
537 check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
538 diff $(srcdir)/cdtest.exp cdtest.out
539 diff $(srcdir)/cdtest.exp cdtest-ur.out
540
541 .PHONY: check-cdtest
542
543 # END OF CHECK TARGETS
544
545 # DOCUMENTATION TARGETS
546 # Manual configuration file; not usually attached to normal configuration,
547 # because almost all configs use "gen" version of manual.
548 # Set DOCVER above to change.
549 configdoc.texi: ${DOCVER}-doc.texi
550 ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
551 ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
552 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
553
554 # TeX output
555 dvi: ld.dvi
556 ld.dvi: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
557 TEXINPUTS=$(BFDDIR)/doc:$$TEXINPUTS $(TEXI2DVI) $(srcdir)/ld.texinfo
558
559 ldint.dvi: $(srcdir)/ldint.texinfo
560 $(TEXI2DVI) $(srcdir)/ldint.texinfo
561
562 # info file for online browsing
563 ld.info: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
564 $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo
565
566 ldint.info: $(srcdir)/ldint.texinfo
567 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
568
569 .PHONY: dvi
570
571 #separate targets for "ms", "me", and "mm" forms of roff doc
572 # Try to use a recent texi2roff. v2 was put on prep in jan91.
573 # If you want an index, see texi2roff doc for postprocessing
574 # and add -i to texi2roff invocations below.
575 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
576 # correspondint -e lines when later texi2roff's are current)
577 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
578 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
579 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
580 # + @alphaenumerate is ridiculously new, turned into @enumerate
581
582 ld.ms: $(srcdir)/ld.texinfo
583 sed -e '/\\input texinfo/d' \
584 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
585 -e '/^@ifinfo/,/^@end ifinfo/d' \
586 -e '/^@c/d' \
587 -e 's/{.*,,/{/' \
588 -e 's/@ / /g' \
589 -e 's/^@alphaenumerate/@enumerate/g' \
590 -e 's/^@end alphaenumerate/@end enumerate/g' \
591 $(srcdir)/ld.texinfo | \
592 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
593 sed -e 's/---/\\(em/g' \
594 >>ld.ms
595
596 # index for roff output
597 ld-index.ms: ld.ms
598 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
599 sed -e '/: warning:/d' | \
600 texi2index >ld-index.ms
601
602 # roff output (-mm)
603 ld.mm: $(srcdir)/ld.texinfo
604 sed -e '/\\input texinfo/d' \
605 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
606 -e '/^@ifinfo/,/^@end ifinfo/d' \
607 -e '/^@c/d' \
608 -e 's/{.*,,/{/' \
609 -e '/@noindent/d' \
610 -e 's/@ / /g' \
611 -e 's/^@alphaenumerate/@enumerate/g' \
612 -e 's/^@end alphaenumerate/@end enumerate/g' \
613 $(srcdir)/ld.texinfo | \
614 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
615 sed -e 's/---/\\(em/g' \
616 >ld.mm
617
618 # index for roff output
619 ld-index.mm: ld.mm
620 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
621 sed -e '/: warning:/d' | \
622 texi2index >ld-index.mm
623
624 # roff output (-me)
625 ld.me: $(srcdir)/ld.texinfo
626 sed -e '/\\input texinfo/d' \
627 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
628 -e '/^@ifinfo/,/^@end ifinfo/d' \
629 -e '/^@c/d' \
630 -e 's/{.*,,/{/' \
631 -e 's/@ / /g' \
632 -e 's/^@alphaenumerate/@enumerate/g' \
633 -e 's/^@end alphaenumerate/@end enumerate/g' \
634 $(srcdir)/ld.texinfo | \
635 $(TEXI2ROFF) $(TEXI2OPT) -me | \
636 sed -e 's/---/\\(em/g' \
637 >>ld.me
638
639 # index for roff output
640 ld-index.me: ld.me
641 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
642 sed -e '/: warning:/d' | \
643 texi2index >ld-index.me
644
645 stage1: force
646 -mkdir stage1
647 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
648 -(cd stage1 ; ln -s $(LD_PROG) ld)
649
650 stage2: force
651 -mkdir stage2
652 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
653 -(cd stage2 ; ln -s $(LD_PROG) ld)
654
655 stage3: force
656 -mkdir stage3
657 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
658 -(cd stage3 ; ln -s $(LD_PROG) ld)
659
660 against = stage2
661
662 comparison: force
663 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
664
665 de-stage1: force
666 -(cd stage1 ; mv -f * ..)
667 -rm ld
668 -rmdir stage1
669
670 de-stage2: force
671 -(cd stage2 ; mv -f * ..)
672 -rm ld
673 -rmdir stage2
674
675 de-stage3: force
676 -(cd stage3 ; mv -f * ..)
677 -rm ld
678 -rmdir stage3
679
680 .PHONY: stage1 stage2 stage3 comparison de-stage1 de-stage2 de-stage3
681
682 # Stuff that should be included in a distribution:
683 LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
684 diststuff: $(LDDISTSTUFF)
685
686 mostlyclean:
687 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
688 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out cdtest.tmp
689 -rm -f cdtest-ur cdtest-ur.out cdtest-ur.tmp
690 -rm -f $(GENERATED_CFILES) $(GENERATED_HFILES)
691 -rm -fr tmpdir
692 clean: mostlyclean
693 -rm -f $(LD_PROG) configdoc.texi
694 distclean:
695 -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp site.bak \
696 $(STAGESTUFF) ld.?? ld.??s ld.toc ld.aux ld.log ldlex.[qp] \
697 $(LD_PROG) ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out \
698 configdoc.texi tmpdir
699 realclean: clean distclean
700 -rm -f $(LDDISTSTUFF)
701
702 .PHONY: diststuff mostlyclean clean distclean realclean
703
704 lintlog:$(LINTSOURCES) Makefile
705 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
706 | grep -v "pointer casts may be troublesome" \
707 | grep -v "possible pointer alignment problem" \
708 | grep -v "ignore" \
709 | grep -v "conversion from long may lose accuracy" \
710 | grep -v "warning: constant argument to NOT" \
711 | grep -v "enumeration type clash, operator CAST" \
712 | grep -v "warning: constant in conditional context"\
713 | grep -v "archive\.c"
714
715
716 TAGS:
717 etags -t $(srcdir)/*.[chly] *.[chly]
718
719
720 install:
721 $(INSTALL_XFORM) ld.new $(bindir)/ld
722 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
723 for f in ldscripts/*; do \
724 $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
725 done
726 -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
727 rm -f $(tooldir)/bin/ld; \
728 ln $(bindir)/$$n $(tooldir)/bin/ld >/dev/null 2>/dev/null \
729 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
730
731 install-info: ld.info
732 if [ -r ld.info ]; then \
733 dir=. ; \
734 else \
735 dir=$(srcdir) ; \
736 fi ; \
737 for i in `cd $$dir ; echo ld.info*` ; do \
738 $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
739 done
740
741 clean-info:
742 -rm -rf *.info*
743
744 .PHONY: install install-info clean-info
745
746 # Targets to rebuild dependencies in this Makefile.
747 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
748 .dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES)
749 rm -f .dep1
750 $(MAKE) DEP=$(DEP) .dep1
751 sed -f dep.sed <.dep1 >.dep
752
753 # This rule really wants a mkdep that runs "gcc -MM".
754 .dep1: $(CFILES) $(GENERATED_CFILES)
755 rm -f .dep2
756 echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
757 $(DEP) -f .dep2 $(ALL_CFLAGS) $?
758 $(srcdir)/../move-if-change .dep2 .dep1
759
760 dep.sed: dep-in.sed config.status
761 sed <$(srcdir)/dep-in.sed >dep.sed \
762 -e 's!@INCDIR@!$(INCDIR)!' \
763 -e 's!@srcdir@!$(srcdir)!'
764
765 dep: .dep
766 sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
767 cat .dep >> tmp-Makefile
768 $(srcdir)/../move-if-change tmp-Makefile Makefile
769
770 dep-in: .dep
771 sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
772 cat .dep >> tmp-Makefile.in
773 $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
774
775 .PHONY: dep dep-in
776
777 # Dummy target to force execution of dependent targets.
778 #
779 force:
780
781 .PHONY: force
782
783 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
784 $(SHELL) ./config.status
785
786 # What appears below is generated by a hacked mkdep using gcc -MM.
787
788 # DO NOT DELETE THIS LINE -- mkdep uses it.
789 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
790
791 ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
792 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
793 $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldmisc.h \
794 ldgram.h ldmain.h ldctor.h
795 ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
796 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
797 config.h ld.h ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h \
798 ldmain.h ldemul-list.h
799 ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
800 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
801 $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \
802 ldgram.h ldlang.h
803 ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
804 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
805 ld.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
806 ldlex.h ldemul.h
807 ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
808 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
809 $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
810 ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
811 ldctor.h ldfile.h
812 ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
813 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
814 $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h config.h \
815 ld.h ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
816 ldemul.h ldlex.h ldfile.h ldctor.h
817 ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
818 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
819 ld.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \
820 ldfile.h
821 ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
822 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
823 ld.h ldver.h ldemul.h ldmain.h
824 ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
825 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
826 $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldwrite.h \
827 ldmisc.h ldgram.h ldmain.h
828 lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
829 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
830 $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h config.h ld.h \
831 ldmain.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h \
832 ldfile.h ldver.h
833 mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
834 ../bfd/sysdep.h $(INCDIR)/fopen-same.h ld.h ldexp.h \
835 ldlang.h ldmisc.h mri.h ldgram.h
836 ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
837 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
838 $(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldemul.h \
839 ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
840 ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h ../bfd/sysdep.h \
841 $(INCDIR)/fopen-same.h ld.h ldgram.h ldmisc.h ldexp.h \
842 ldlang.h ldfile.h ldlex.h ldmain.h
843
844 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.045375 seconds and 3 git commands to generate.