1 # Makefile for the GNU linker ld (version 2)
2 # Copyright (C) 1989, 90, 91, 92, 93, 1994 Free Software Foundation, Inc.
4 # This file is part of GNU ld.
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.
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.
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.
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
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
66 BISON
= `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
67 LEX
= `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
69 # Seach path to override the default search path for -lfoo libraries.
70 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
71 # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
72 # a cross-linker, in which case the default is empty. See genscripts.sh.)
73 # Otherwise, they are replaced with the ones given in LIB_PATH,
74 # which may have the form: LIB_PATH=/lib:/usr/local/lib
77 # Additional libraries which are used when ld is built native. This
78 # is set by some host makefile fragments.
81 BASEDIR
= $(srcdir)/..
82 BFDDIR
= $(BASEDIR
)/bfd
83 INCDIR
= $(BASEDIR
)/include
84 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(BFDDIR
) -I
$(INCDIR
)
87 # What version of the manual to build
90 # Where to find texinfo.tex to format docn with TeX
91 TEXIDIR
= $(srcdir)/..
/texinfo
93 # Where to find other docs needed to format with TeX
94 TEXINPUTS
= $(TEXIDIR
):$(BFDDIR
)/doc
:$(srcdir)
96 # Whether to get roff to put indexing entries on stderr
98 # You neeed this to generate ld-index.ms (or .mm or .me)
103 # Which roff program to use to generate index for texi2roff'd doc
106 #stuff for self hosting (can be overridden in config file).
107 HOSTING_CRT0
= /lib
/crt0.o
108 HOSTING_LIBS
= `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
109 HOSTING_EMU
= -m
$(EMUL
)
111 # These were used by `make check-cdtest'
113 #CXX = `if [ -f ../gcc/xgcc ] ; then \
114 # echo ../gcc/xgcc -B../gcc/; \
117 #CXXFLAGS = -fgnu-linker
119 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
122 # Setup the testing framework, if you have one
123 EXPECT
= `if [ -f $$r/../expect/expect ] ; \
124 then echo $$r/../expect/expect ; \
125 else echo expect ; fi`
127 RUNTEST
= `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
128 then echo $${srcroot}/../dejagnu/runtest ; \
129 else echo runtest ; fi`
134 if [ -f $$r/../gcc/Makefile ] ; then \
135 if [ -f $$r/../newlib/Makefile ] ; then \
136 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
138 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
141 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
144 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
150 if [ -f $$r/../gcc/Makefile ] ; then \
151 if [ -f $$r/../newlib/Makefile ] ; then \
152 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
154 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
157 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
160 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
164 # go directly to ld.new in case this ld isn't capable of
165 # linking native object on this host. It can be renamed on
172 ### Host, target, and site specific Makefile fragments come in here.
175 LINTFLAGS
= $(INCLUDES
) $(EXTRA_DEF
)
177 # The .cc suffix was used by `make check-cdtest'.
179 .SUFFIXES
: .y
$(SUFFIXES
) .
cc
181 # Suppress smart makes who think they know how to automake Yacc files
184 # This rule was used for the check-cdtest target.
186 # $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
188 ALL_CFLAGS
= $(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) $(CFLAGS
)
190 $(CC
) -c
$(ALL_CFLAGS
) $<
193 BFDLIB
= ..
/bfd
/libbfd.a
194 LIBIBERTY
= ..
/libiberty
/libiberty.a
196 ALL_EMULATIONS
= ea29k.o ealpha.o ecoff_sparc.o eebmon29k.o \
197 eelf32_sparc.o eelf32bmip.o eelf32lmip.o eelf32ppc.o \
198 eelf64_sparc.o eelf_i386.o egld960.o ego32.o eh8300.o \
199 eh8300h.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o \
200 ehp300bsd.o ehp3hpux.o ehppaelf.o ei386aout.o ei386bsd.o \
201 ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o \
202 ei386nbsd.c ei386nw.o elnk960.o em68kaout.o em68kcoff.o \
203 em68klynx.o em88kbcs.o emipsbig.o emipsbsd.o emipsidt.o \
204 emipsidtl.o emipslit.o enews.o ens32knbsd.c eppcnw.o \
205 eriscix.o esa29200.o esh.o esparclynx.o esparcnbsd.c \
206 est2000.o esun3.o esun4.o evanilla.o evax.o evsta.o \
209 CFILES
= ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
210 ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
213 HFILES
= config.h
ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
214 ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
217 GENERATED_CFILES
= ldgram.c ldlex.c
218 GENERATED_HFILES
= ldgram.h ldemul-list.h
220 OFILES
= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
221 ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
222 ldfile.o
${EMULATION_OFILES}
224 LINTSOURCES
= $(CFILES
) $(GENERATED_CFILES
) e
*.c
226 STAGESTUFF
= *.o ldscripts
/* e
*.c
232 $(BISON
) $(BISONFLAGS
) -d
$(srcdir)/ldgram.y
233 mv
-f y.tab.c ldgram.c
234 mv
-f y.tab.h ldgram.h
236 # Separate from ldgram.c so that a parallel make doesn't try to build
237 # both ldgram.c and ldgram.h simultaneously.
240 # EMUL is the name of a file in the emulparams subdir, without the .sh.
241 ldmain.o
: ldmain.c config.status
242 if
[ -z
"$(EMUL)" ] ; then \
243 echo
"you must set a default emulation" 1>&2 ; \
246 $(CC
) -c
$(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) -DDEFAULT_EMULATION
='"$(EMUL)"' -DSCRIPTDIR
='"$(scriptdir)"' $(CFLAGS
) $< ; \
249 ldemul-list.h
: Makefile
250 (echo
"/* This file is automatically generated. DO NOT EDIT! */";\
251 for f in
`echo " " ${EMULATION_OFILES} "" \
252 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
253 echo
"extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
256 echo
"#define EMULATION_LIST \\";\
257 for f in
`echo " " ${EMULATION_OFILES} "" \
258 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
259 echo
" &ld_$${f}_emulation, \\"; \
261 echo
" 0") >ldemul-tmp.h
262 mv ldemul-tmp.h ldemul-list.h
265 $(LEX
) -I
-Cem
$(srcdir)/ldlex.l
266 -sed
-e
'/^int.*free();/d' \
267 -e
'/^char.*malloc();/d' \
268 -e
's/malloc/xmalloc/g' \
269 < lex.yy.c
> ldlex.c.new
271 mv ldlex.c.new .
/ldlex.c
273 # These all start with e so 'make clean' can find them.
275 GENSCRIPTS
= $(SHELL
) $(srcdir)/genscripts.sh
${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)"
276 GEN_DEPENDS
= $(srcdir)/genscripts.sh
$(srcdir)/emultempl
/stringify.sed
278 esun4.c
: $(srcdir)/emulparams
/sun4.sh \
279 $(srcdir)/emultempl
/sunos.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
281 esun3.c
: $(srcdir)/emulparams
/sun3.sh \
282 $(srcdir)/emultempl
/sunos.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
284 evsta.c
: $(srcdir)/emulparams
/vsta.sh \
285 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
287 ego32.c
: $(srcdir)/emulparams
/go32.sh \
288 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
290 enews.c
: $(srcdir)/emulparams
/news.sh \
291 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
293 evax.c
: $(srcdir)/emulparams
/vax.sh \
294 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
296 ehp300bsd.c
: $(srcdir)/emulparams
/hp300bsd.sh \
297 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
298 ${GENSCRIPTS} hp300bsd
299 ehp3hpux.c
: $(srcdir)/emulparams
/hp3hpux.sh \
300 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
301 ${GENSCRIPTS} hp3hpux
302 ehppaelf.c
: $(srcdir)/emulparams
/hppaelf.sh \
303 $(srcdir)/emultempl
/hppaelf.em
$(srcdir)/scripttempl
/hppaelf.sc
${GEN_DEPENDS}
304 ${GENSCRIPTS} hppaelf
305 ei386aout.c
: $(srcdir)/emulparams
/i386aout.sh \
306 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
307 ${GENSCRIPTS} i386aout
308 ei386go32.c
: $(srcdir)/emulparams
/i386go32.sh \
309 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/i386go32.sc
${GEN_DEPENDS}
310 ${GENSCRIPTS} i386go32
311 ei386mach.c
: $(srcdir)/emulparams
/i386mach.sh \
312 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
313 ${GENSCRIPTS} i386mach
314 eebmon29k.c
: $(srcdir)/emulparams
/ebmon29k.sh \
315 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/ebmon29k.sc
${GEN_DEPENDS}
316 ${GENSCRIPTS} ebmon29k
317 esa29200.c
: $(srcdir)/emulparams
/sa29200.sh \
318 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sa29200.sc
${GEN_DEPENDS}
319 ${GENSCRIPTS} sa29200
320 ea29k.c
: $(srcdir)/emulparams
/a29k.sh \
321 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/a29k.sc
${GEN_DEPENDS}
323 em88kbcs.c
: $(srcdir)/emulparams
/m88kbcs.sh \
324 $(srcdir)/emultempl
/m88kbcs.em
$(srcdir)/scripttempl
/m88kbcs.sc
${GEN_DEPENDS}
325 ${GENSCRIPTS} m88kbcs
326 eh8300.c
: $(srcdir)/emulparams
/h8300.sh \
327 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8300.sc
${GEN_DEPENDS}
329 eh8300h.c
: $(srcdir)/emulparams
/h8300h.sh \
330 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8300h.sc
${GEN_DEPENDS}
332 eh8500.c
: $(srcdir)/emulparams
/h8500.sh \
333 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500.sc
${GEN_DEPENDS}
335 eh8500b.c
: $(srcdir)/emulparams
/h8500b.sh \
336 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500b.sc
${GEN_DEPENDS}
338 eh8500c.c
: $(srcdir)/emulparams
/h8500c.sh \
339 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500c.sc
${GEN_DEPENDS}
341 eh8500m.c
: $(srcdir)/emulparams
/h8500m.sh \
342 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500m.sc
${GEN_DEPENDS}
344 eh8500s.c
: $(srcdir)/emulparams
/h8500s.sh \
345 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500s.sc
${GEN_DEPENDS}
347 esh.c
: $(srcdir)/emulparams
/sh.sh \
348 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sh.sc
${GEN_DEPENDS}
350 est2000.c
: $(srcdir)/emulparams
/st2000.sh \
351 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/st2000.sc
${GEN_DEPENDS}
353 ez8ksim.c
: $(srcdir)/emulparams
/z8ksim.sh \
354 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/z8ksim.sc
${GEN_DEPENDS}
356 evanilla.c
: $(srcdir)/emulparams
/vanilla.sh \
357 $(srcdir)/emultempl
/vanilla.em
$(srcdir)/scripttempl
/vanilla.sc
${GEN_DEPENDS}
358 ${GENSCRIPTS} vanilla
359 elnk960.c
: $(srcdir)/emulparams
/lnk960.sh \
360 $(srcdir)/emultempl
/lnk960.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
362 egld960.c
: $(srcdir)/emulparams
/gld960.sh \
363 $(srcdir)/emultempl
/gld960.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
365 egld960coff.c
: $(srcdir)/emulparams
/gld960coff.sh \
366 $(srcdir)/emultempl
/gld960c.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
367 ${GENSCRIPTS} gld960coff
368 em68kcoff.c
: $(srcdir)/emulparams
/m68kcoff.sh \
369 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/m68kcoff.sc
${GEN_DEPENDS}
370 ${GENSCRIPTS} m68kcoff
371 em68klynx.c
: $(srcdir)/emulparams
/m68klynx.sh \
372 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/m68klynx.sc
${GEN_DEPENDS}
373 ${GENSCRIPTS} m68klynx
374 ei386coff.c
: $(srcdir)/emulparams
/i386coff.sh \
375 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/i386coff.sc
${GEN_DEPENDS}
376 ${GENSCRIPTS} i386coff
377 ei386lynx.c
: $(srcdir)/emulparams
/i386lynx.sh \
378 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/i386lynx.sc
${GEN_DEPENDS}
379 ${GENSCRIPTS} i386lynx
380 emipslit.c
: $(srcdir)/emulparams
/mipslit.sh \
381 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
382 ${GENSCRIPTS} mipslit
383 ei386bsd.c
: $(srcdir)/emulparams
/i386bsd.sh \
384 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
385 ${GENSCRIPTS} i386bsd
386 emipsbig.c
: $(srcdir)/emulparams
/mipsbig.sh \
387 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
388 ${GENSCRIPTS} mipsbig
389 emipsbsd.c
: $(srcdir)/emulparams
/mipsbsd.sh \
390 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mipsbsd.sc
${GEN_DEPENDS}
391 ${GENSCRIPTS} mipsbsd
392 emipsidt.c
: $(srcdir)/emulparams
/mipsidt.sh \
393 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
394 ${GENSCRIPTS} mipsidt
395 emipsidtl.c
: $(srcdir)/emulparams
/mipsidtl.sh \
396 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
397 ${GENSCRIPTS} mipsidtl
398 eelf_i386.c
: $(srcdir)/emulparams
/elf_i386.sh \
399 $(srcdir)/emultempl
/elf32.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
400 ${GENSCRIPTS} elf_i386
401 eelf32bmip.c
: $(srcdir)/emulparams
/elf32bmip.sh \
402 $(srcdir)/emultempl
/elf32.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
403 ${GENSCRIPTS} elf32bmip
404 eelf32lmip.c
: $(srcdir)/emulparams
/elf32lmip.sh \
405 $(srcdir)/emultempl
/elf32.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
406 ${GENSCRIPTS} elf32lmip
407 ealpha.c
: $(srcdir)/emulparams
/alpha.sh \
408 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/alpha.sc
${GEN_DEPENDS}
410 ecoff_sparc.c
: $(srcdir)/emulparams
/coff_sparc.sh \
411 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sparccoff.sc
${GEN_DEPENDS}
412 ${GENSCRIPTS} coff_sparc
413 esparclynx.c
: $(srcdir)/emulparams
/sparclynx.sh \
414 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sparclynx.sc
${GEN_DEPENDS}
415 ${GENSCRIPTS} sparclynx
416 eelf32ppc.c
: $(srcdir)/emulparams
/elf32ppc.sh \
417 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
418 ${GENSCRIPTS} elf32ppc
419 eriscix.c
: $(srcdir)/emulparams
/riscix.sh \
420 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
422 em68kaout.c
: $(srcdir)/emulparams
/m68kaout.sh \
423 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
424 ${GENSCRIPTS} m68kaout
425 ei386linux.c
: $(srcdir)/emulparams
/i386linux.sh \
426 $(srcdir)/emultempl
/linux.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
427 ${GENSCRIPTS} i386linux
428 eelf32_sparc.c
: $(srcdir)/emulparams
/elf32_sparc.sh \
429 $(srcdir)/emultempl
/elf32.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
430 ${GENSCRIPTS} elf32_sparc
431 eelf64_sparc.c
: $(srcdir)/emulparams
/elf64_sparc.sh \
432 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
433 ${GENSCRIPTS} elf64_sparc
435 epc532machaout.c
: $(srcdir)/emulparams
/pc532machaout.sh \
436 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
437 ${GENSCRIPTS} pc532machaout
439 ei386nw.c
: $(srcdir)/emulparams
/i386nw.sh \
440 $(srcdir)/emultempl
/elf32.em
$(srcdir)/scripttempl
/nw.sc
${GEN_DEPENDS}
442 eppcnw.c
: $(srcdir)/emulparams
/ppcnw.sh \
443 $(srcdir)/emultempl
/elf32.em
$(srcdir)/scripttempl
/nw.sc
${GEN_DEPENDS}
446 ei386nbsd.c
: $(srcdir)/emulparams
/i386nbsd.sh \
447 $(srcdir)/emultmpl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
448 ${GENSCRIPTS} i386nbsd
449 ens32knbsd.c
: $(srcdir)/emulparams
/ns32knbsd.sh \
450 $(srcdir)/emultmpl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
451 ${GENSCRIPTS} ns32knbsd
452 esparcnbsd.c
: $(srcdir)/emulparams
/sparcnbsd.sh \
453 $(srcdir)/emultmpl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
454 ${GENSCRIPTS} sparcnbsd
456 $(LD_PROG
): $(OFILES
) $(BFDLIB
) $(LIBIBERTY
)
457 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(LD_PROG
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(EXTRALIBS
)
459 # The generated emulation files mostly have the same dependencies.
460 $(EMULATION_OFILES
): ..
/bfd
/bfd.h ..
/bfd
/sysdep.h
$(INCDIR
)/bfdlink.h \
461 ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h config.h \
462 ldctor.h ldexp.h ldlang.h
464 # These targets are for the dejagnu testsuites. The file site.exp
465 # contains global variables that all the testsuites will use.
467 site.exp
: .
/config.status Makefile
468 @echo
"Making a new config file..."
471 @mv site.exp site.bak
472 @echo
"## variables are automatically generated by make ##" > .
/tmp0
473 @echo
"# Do not edit here. If you wish to override these" >> .
/tmp0
474 @echo
"# values, add them to the last section" >> .
/tmp0
475 @echo
"# HOST AND TARGET INFO" >> .
/tmp0
476 @echo
"set host_os $(host_os)" >> .
/tmp0
477 @echo
"set host_alias $(host_alias)" >> .
/tmp0
478 @echo
"set host_cpu $(host_cpu)" >> .
/tmp0
479 @echo
"set host_vendor $(host_vendor)" >> .
/tmp0
480 @echo
"set target_os $(target_os)" >> .
/tmp0
481 @echo
"set target_alias $(target_alias)" >> .
/tmp0
482 @echo
"set target_cpu $(target_cpu)" >> .
/tmp0
483 @echo
"set target_vendor $(target_vendor)" >> .
/tmp0
484 @echo
"set host_triplet $(host_canonical)" >> .
/tmp0
485 @echo
"set target_triplet $(target_canonical)" >> .
/tmp0
486 @echo
"# DIRECTORY INFO" >> .
/tmp0
487 @echo
"set objdir `pwd`" >> .
/tmp0
489 @echo
"# LD DEPENDENCIES" >> .
/tmp0
490 @echo
"set OFILES \"$(OFILES)\"" >> .
/tmp0
491 @echo
"set BFDLIB \"$(BFDLIB)\"" >> .
/tmp0
492 @echo
"set LIBIBERTY \"$(LIBIBERTY)\"" >> .
/tmp0
493 @echo
"set HOSTING_EMU \"$(HOSTING_EMU)\"" >> .
/tmp0
494 @echo
"set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> .
/tmp0
495 @echo
"set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> .
/tmp0
497 @echo
"## Variables generated by configure. Do Not Edit ##" >> .
/tmp0
498 @cat .
/tmp0
> site.exp
499 @cat site.bak | sed \
500 -e
'1,/^## Variables generated by.*##/ d' >> site.exp
505 srcroot
=`cd ${srcdir}; pwd` ; export srcroot
; \
506 EXPECT
=${EXPECT} ; export EXPECT
; \
507 if
[ -f
$$r/..
/expect
/expect
] ; then \
508 TCL_LIBRARY
=$${srcroot}/..
/tcl
/library
; \
509 export TCL_LIBRARY
; fi
; \
510 $(RUNTEST
) --tool
ld --srcdir $(srcdir)/testsuite
$(RUNTESTFLAGS
) \
511 CC
="$(CC_FOR_TARGET)" CFLAGS
="$(CFLAGS)" \
512 CXX
="$(CXX_FOR_TARGET)" CXXFLAGS
="$(CXXFLAGS)"
515 .PHONY
: check installcheck
517 # Rules for testing by relinking ld itself.
518 # A similar test is in the testsuite. This target is for ease of use
522 .
/ld.new
$(HOSTING_EMU
) -o ld-partial.o
-r
$(OFILES
)
524 .
/ld.new
$(HOSTING_EMU
) -o ld1
$(HOSTING_CRT0
) ld-partial.o
$(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
527 .
/ld.new
$(HOSTING_EMU
) -o ld1-full
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
530 .
/ld1
$(HOSTING_EMU
) -o ld2
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
533 .
/ld2
$(HOSTING_EMU
) -o ld3
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
540 # A test program for C++ constructors and destructors.
541 # This test is now in the testsuite.
543 #cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
544 # ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
545 # cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
548 # ./cdtest > cdtest.tmp
549 # mv cdtest.tmp cdtest.out
551 #cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
552 # ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
553 # cdtest-bar.o cdtest-foo.o
555 #cdtest-ur: cdtest-ur.o
556 # ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
559 #cdtest-ur.out: cdtest-ur
560 # ./cdtest-ur > cdtest-ur.tmp
561 # mv cdtest-ur.tmp cdtest-ur.out
563 #check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
564 # diff $(srcdir)/cdtest.exp cdtest.out
565 # diff $(srcdir)/cdtest.exp cdtest-ur.out
567 #.PHONY: check-cdtest
569 # END OF CHECK TARGETS
571 # DOCUMENTATION TARGETS
572 # Manual configuration file; not usually attached to normal configuration,
573 # because almost all configs use "gen" version of manual.
574 # Set DOCVER above to change.
575 configdoc.texi
: ${DOCVER}-doc.texi
576 ln
-s
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi || \
577 ln
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi || \
578 cp
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi
582 ld.
dvi: $(srcdir)/ld.texinfo configdoc.texi
$(BFDDIR
)/doc
/bfdsumm.texi
583 TEXINPUTS
=$(BFDDIR
)/doc
:$$TEXINPUTS $(TEXI2DVI
) $(srcdir)/ld.texinfo
585 ldint.
dvi: $(srcdir)/ldint.texinfo
586 $(TEXI2DVI
) $(srcdir)/ldint.texinfo
588 # info file for online browsing
589 ld.
info: $(srcdir)/ld.texinfo configdoc.texi
$(BFDDIR
)/doc
/bfdsumm.texi
590 $(MAKEINFO
) -I
$(BFDDIR
)/doc
-o
ld.
info $(srcdir)/ld.texinfo
592 ldint.
info: $(srcdir)/ldint.texinfo
593 $(MAKEINFO
) -o ldint.
info $(srcdir)/ldint.texinfo
597 #separate targets for "ms", "me", and "mm" forms of roff doc
598 # Try to use a recent texi2roff. v2 was put on prep in jan91.
599 # If you want an index, see texi2roff doc for postprocessing
600 # and add -i to texi2roff invocations below.
601 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
602 # correspondint -e lines when later texi2roff's are current)
603 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
604 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
605 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
606 # + @alphaenumerate is ridiculously new, turned into @enumerate
608 ld.ms
: $(srcdir)/ld.texinfo
609 sed
-e
'/\\input texinfo/d' \
610 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
611 -e
'/^@ifinfo/,/^@end ifinfo/d' \
615 -e
's/^@alphaenumerate/@enumerate/g' \
616 -e
's/^@end alphaenumerate/@end enumerate/g' \
617 $(srcdir)/ld.texinfo | \
618 $(TEXI2ROFF
) $(TEXI2OPT
) -ms | \
619 sed
-e
's/---/\\(em/g' \
622 # index for roff output
624 $(ROFF
) -ms
ld.ms
2>&1 1>/dev
/null | \
625 sed
-e
'/: warning:/d' | \
626 texi2index
>ld-index.ms
629 ld.mm
: $(srcdir)/ld.texinfo
630 sed
-e
'/\\input texinfo/d' \
631 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
632 -e
'/^@ifinfo/,/^@end ifinfo/d' \
637 -e
's/^@alphaenumerate/@enumerate/g' \
638 -e
's/^@end alphaenumerate/@end enumerate/g' \
639 $(srcdir)/ld.texinfo | \
640 $(TEXI2ROFF
) $(TEXI2OPT
) -mm | \
641 sed
-e
's/---/\\(em/g' \
644 # index for roff output
646 $(ROFF
) -mm
ld.mm
2>&1 1>/dev
/null | \
647 sed
-e
'/: warning:/d' | \
648 texi2index
>ld-index.mm
651 ld.me
: $(srcdir)/ld.texinfo
652 sed
-e
'/\\input texinfo/d' \
653 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
654 -e
'/^@ifinfo/,/^@end ifinfo/d' \
658 -e
's/^@alphaenumerate/@enumerate/g' \
659 -e
's/^@end alphaenumerate/@end enumerate/g' \
660 $(srcdir)/ld.texinfo | \
661 $(TEXI2ROFF
) $(TEXI2OPT
) -me | \
662 sed
-e
's/---/\\(em/g' \
665 # index for roff output
667 $(ROFF
) -me
ld.me
2>&1 1>/dev
/null | \
668 sed
-e
'/: warning:/d' | \
669 texi2index
>ld-index.me
673 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage1
674 -(cd stage1
; ln
-s
$(LD_PROG
) ld)
678 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage2
679 -(cd stage2
; ln
-s
$(LD_PROG
) ld)
683 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage3
684 -(cd stage3
; ln
-s
$(LD_PROG
) ld)
689 for i in
$(STAGESTUFF
) $(LD_PROG
) ; do cmp
$$i $(against
)/$$i ; done
692 -(cd stage1
; mv
-f
* ..
)
697 -(cd stage2
; mv
-f
* ..
)
702 -(cd stage3
; mv
-f
* ..
)
706 .PHONY
: stage1 stage2 stage3 comparison de-stage1 de-stage2 de-stage3
708 # Stuff that should be included in a distribution:
709 LDDISTSTUFF
= ldgram.c ldgram.h ldlex.c
710 diststuff
: $(LDDISTSTUFF
)
713 -rm -f
$(STAGESTUFF
) ld.??
ld.??? ldlex.
[qp
]
714 -rm -f
ld ld1 ld2 ld3
*.o y.output cdtest cdtest.out cdtest.tmp
715 -rm -f cdtest-ur cdtest-ur.out cdtest-ur.tmp
716 -rm -f
$(GENERATED_CFILES
) $(GENERATED_HFILES
)
719 -rm -f
$(LD_PROG
) configdoc.texi
721 -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp site.bak \
722 $(STAGESTUFF
) ld.??
ld.??s
ld.toc
ld.aux
ld.log ldlex.
[qp
] \
723 $(LD_PROG
) ld ld1 ld2 ld3
*.o y.output cdtest cdtest.out \
724 configdoc.texi tmpdir
725 realclean: clean distclean
726 -rm -f
$(LDDISTSTUFF
)
728 .PHONY
: diststuff
mostlyclean clean distclean realclean
730 lintlog
:$(LINTSOURCES
) Makefile
731 $(LINT
) -abhxzn
$(LINTFLAGS
) $(LINTSOURCES
) \
732 | grep
-v
"pointer casts may be troublesome" \
733 | grep
-v
"possible pointer alignment problem" \
735 | grep
-v
"conversion from long may lose accuracy" \
736 | grep
-v
"warning: constant argument to NOT" \
737 | grep
-v
"enumeration type clash, operator CAST" \
738 | grep
-v
"warning: constant in conditional context"\
739 | grep
-v
"archive\.c"
743 etags
-t
$(srcdir)/*.
[chly
] *.
[chly
]
747 $(INSTALL_XFORM
) ld.new
$(bindir)/ld
748 $(INSTALL_XFORM1
) $(srcdir)/ld.1 $(man1dir)/ld.1
749 for f in ldscripts
/*; do \
750 $(INSTALL_DATA
) $$f $(scriptdir
)/$$f ; \
752 -n
=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
753 rm -f
$(tooldir
)/bin
/ld; \
754 ln
$(bindir)/$$n $(tooldir
)/bin
/ld >/dev
/null
2>/dev
/null \
755 ||
$(INSTALL_PROGRAM
) ld.new
$(tooldir
)/bin
/ld
757 install-info
: ld.
info
758 if
[ -r
ld.
info ]; then \
763 for i in
`cd $$dir ; echo ld.info*` ; do \
764 $(INSTALL_DATA
) $$dir/$$i $(infodir)/$$i ; \
770 .PHONY
: install install-info clean-info
772 # Targets to rebuild dependencies in this Makefile.
773 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
774 .dep
: dep.sed
$(CFILES
) $(HFILES
) $(GENERATED_CFILES
) $(GENERATED_HFILES
)
776 $(MAKE
) DEP
=$(DEP
) .dep1
777 sed
-f dep.sed
<.dep1
>.dep
779 # This rule really wants a mkdep that runs "gcc -MM".
780 .dep1
: $(CFILES
) $(GENERATED_CFILES
)
782 echo
'# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
783 $(DEP
) -f .dep2
$(ALL_CFLAGS
) $?
784 $(srcdir)/..
/move-if-change .dep2 .dep1
786 dep.sed
: dep-in.sed config.status
787 sed
<$(srcdir)/dep-in.sed
>dep.sed \
788 -e
's!@INCDIR@!$(INCDIR)!' \
789 -e
's!@srcdir@!$(srcdir)!'
792 sed
-e
'/^..DO NOT DELETE THIS LINE/,$$d' < Makefile
> tmp-Makefile
793 cat .dep
>> tmp-Makefile
794 $(srcdir)/..
/move-if-change tmp-Makefile Makefile
797 sed
-e
'/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in
> tmp-Makefile.in
798 cat .dep
>> tmp-Makefile.in
799 $(srcdir)/..
/move-if-change tmp-Makefile.in
$(srcdir)/Makefile.in
803 # Dummy target to force execution of dependent targets.
809 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
810 $(SHELL
) .
/config.status
812 # What appears below is generated by a hacked mkdep using gcc -MM.
814 # DO NOT DELETE THIS LINE -- mkdep uses it.
815 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
817 ldctor.o
: ldctor.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
818 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
819 $(INCDIR
)/bfdlink.h
ld.h ldexp.h ldlang.h ldmisc.h \
820 ldgram.h ldmain.h ldctor.h
821 ldemul.o
: ldemul.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
822 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
823 config.h
ld.h ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h \
824 ldmain.h ldemul-list.h
825 ldexp.o
: ldexp.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
826 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
827 $(INCDIR
)/bfdlink.h
ld.h ldmain.h ldmisc.h ldexp.h \
829 ldfile.o
: ldfile.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
830 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
831 ld.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
833 ldlang.o
: ldlang.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
834 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
835 $(INCDIR
)/libiberty.h
$(INCDIR
)/bfdlink.h
ld.h ldmain.h \
836 ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
838 ldmain.o
: ldmain.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
839 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
840 $(INCDIR
)/libiberty.h
$(INCDIR
)/bfdlink.h config.h \
841 ld.h ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
842 ldemul.h ldlex.h ldfile.h ldctor.h
843 ldmisc.o
: ldmisc.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
844 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
845 ld.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \
847 ldver.o
: ldver.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
848 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
849 ld.h ldver.h ldemul.h ldmain.h
850 ldwrite.o
: ldwrite.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
851 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
852 $(INCDIR
)/bfdlink.h
ld.h ldexp.h ldlang.h ldwrite.h \
853 ldmisc.h ldgram.h ldmain.h
854 lexsup.o
: lexsup.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
855 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
856 $(INCDIR
)/getopt.h
$(INCDIR
)/bfdlink.h config.h
ld.h \
857 ldmain.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h \
859 mri.o
: mri.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/obstack.h \
860 ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h
ld.h ldexp.h \
861 ldlang.h ldmisc.h mri.h ldgram.h
862 ldgram.o
: ldgram.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
863 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
864 $(INCDIR
)/bfdlink.h
ld.h ldexp.h ldver.h ldlang.h ldemul.h \
865 ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
866 ldlex.o
: ldlex.c ..
/bfd
/bfd.h
$(INCDIR
)/obstack.h ..
/bfd
/sysdep.h \
867 $(INCDIR
)/fopen-same.h
ld.h ldgram.h ldmisc.h ldexp.h \
868 ldlang.h ldfile.h ldlex.h ldmain.h
870 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY