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