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
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`
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
76 # Additional libraries which are used when ld is built native. This
77 # is set by some host makefile fragments.
80 BASEDIR
= $(srcdir)/..
81 BFDDIR
= $(BASEDIR
)/bfd
82 INCDIR
= $(BASEDIR
)/include
83 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(BFDDIR
) -I
$(INCDIR
)
86 # What version of the manual to build
89 # Where to find texinfo.tex to format docn with TeX
90 TEXIDIR
= $(srcdir)/..
/texinfo
92 # Where to find other docs needed to format with TeX
93 TEXINPUTS
= $(TEXIDIR
):$(BFDDIR
)/doc
:$(srcdir)
95 # Whether to get roff to put indexing entries on stderr
97 # You neeed this to generate ld-index.ms (or .mm or .me)
102 # Which roff program to use to generate index for texi2roff'd doc
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
)
110 CXX
= `if [ -f ../gcc/xgcc ] ; then \
111 echo ../gcc/xgcc -B../gcc/; \
114 CXXFLAGS
= -fgnu-linker
116 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
119 # Setup the testing framework, if you have one
122 RUNTEST_CC
= `if [ -f ../gcc/xgcc ] ; then \
123 echo ../gcc/xgcc -B../gcc/; \
126 RUNTEST_CFLAGS
= $(CFLAGS
)
127 RUNTEST_CXX
= `if [ -f ../gcc/xgcc ] ; then \
128 echo ../gcc/xgcc -B../gcc/; \
131 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
133 RUNTEST_CXXFLAGS
= $(CXXFLAGS
)
135 # go directly to ld.new in case this ld isn't capable of
136 # linking native object on this host. It can be renamed on
143 ### Host, target, and site specific Makefile fragments come in here.
146 LINTFLAGS
= $(INCLUDES
) $(EXTRA_DEF
)
148 # The .cc suffix is used by `make check'.
150 .SUFFIXES
: .y
$(SUFFIXES
) .
cc
152 # Suppress smart makes who think they know how to automake Yacc files
155 # This rule is used for the check-cdtest target.
157 $(CXX
) -c
-I
$(srcdir) $(CXXFLAGS
) $(CFLAGS
) $<
159 ALL_CFLAGS
= $(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) $(CFLAGS
)
161 $(CC
) -c
$(ALL_CFLAGS
) $<
164 BFDLIB
= ..
/bfd
/libbfd.a
165 LIBIBERTY
= ..
/libiberty
/libiberty.a
167 ALL_EMULATIONS
= em_lnk960.o em_sun3.o em_i386aout.o em_go32.o em_vsta.o \
168 em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
169 em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \
170 em_m68kcoff.o em_st2000.o em_sa29200.o em_i386mach.o \
171 em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
172 em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
173 em_hppaosf.o em_mipsidtl.o em_sh.o em_elf_i386.o em_alpha.o \
174 em_i386lynx.o em_m68klynx.o em_sparclynx.o em_coff_sparc.o \
178 # This is now set by configure.in.
179 #EMULATION_OFILES = ${ALL_EMULATIONS}
181 CFILES
= ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
182 ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
186 HFILES
= config.h
ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
187 ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
190 GENERATED_CFILES
= ldgram.c ldlex.c
191 GENERATED_HFILES
= ldgram.h ldemul-list.h
193 OFILES
= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
194 ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
195 ldfile.o
${EMULATION_OFILES}
197 LINTSOURCES
= $(CFILES
) $(GENERATED_CFILES
) em_
*.c
199 STAGESTUFF
= *.o ldscripts
/* em_
*.c
$(GENERATED_CFILES
) $(GENERATED_HFILES
)
204 ldgram.h ldgram.c
: ldgram.y
205 $(BISON
) $(BISONFLAGS
) -d
$(srcdir)/ldgram.y
206 mv
-f y.tab.c ldgram.c
207 mv
-f y.tab.h ldgram.h
209 # EMUL is the name of a file in the emulparams subdir, without the .sh.
210 ldmain.o
: ldmain.c config.status
211 if
[ -z
"$(EMUL)" ] ; then \
212 echo
"you must set a default emulation" 1>&2 ; \
215 $(CC
) -c
$(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) -DDEFAULT_EMULATION
='"$(EMUL)"' -DSCRIPTDIR
='"$(scriptdir)"' $(CFLAGS
) $< ; \
218 ldemul-list.h
: config.status
219 (echo
"/* This file is automatically generated. DO NOT EDIT! */";\
220 for f in
`echo " " ${EMULATION_OFILES} "" \
221 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
222 echo
"extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
225 echo
"#define EMULATION_LIST \\";\
226 for f in
`echo " " ${EMULATION_OFILES} "" \
227 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
228 echo
" &ld_$${f}_emulation, \\"; \
230 echo
" 0") >ldemul-tmp.h
231 mv ldemul-tmp.h ldemul-list.h
234 $(LEX
) -I
-Cem
$(srcdir)/ldlex.l
235 -sed
-e
'/^int.*free();/d' \
236 -e
'/^char.*malloc();/d' \
237 -e
's/malloc/ldmalloc/g' \
238 < lex.yy.c
> ldlex.c.new
240 mv ldlex.c.new .
/ldlex.c
242 # These all start with em_ so 'make clean' can find them.
244 GENSCRIPTS
= $(SHELL
) $(srcdir)/genscripts.sh
${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)"
245 GEN_DEPENDS
= $(srcdir)/genscripts.sh
247 em_sun4.c
: $(srcdir)/emulparams
/sun4.sh \
248 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
250 em_sun3.c
: $(srcdir)/emulparams
/sun3.sh \
251 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
253 em_vsta.c
: $(srcdir)/emulparams
/vsta.sh \
254 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
256 em_go32.c
: $(srcdir)/emulparams
/go32.sh \
257 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
259 em_news.c
: $(srcdir)/emulparams
/news.sh \
260 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
262 em_vax.c
: $(srcdir)/emulparams
/vax.sh \
263 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
265 em_hp300bsd.c
: $(srcdir)/emulparams
/hp300bsd.sh \
266 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
267 ${GENSCRIPTS} hp300bsd
268 em_hp3hpux.c
: $(srcdir)/emulparams
/hp3hpux.sh \
269 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
270 ${GENSCRIPTS} hp3hpux
271 em_hppaosf.c
: $(srcdir)/emulparams
/hppaosf.sh \
272 $(srcdir)/emultempl
/hppaosf.em
$(srcdir)/scripttempl
/hppaosf.sc
${GEN_DEPENDS}
273 ${GENSCRIPTS} hppaosf
274 em_i386aout.c
: $(srcdir)/emulparams
/i386aout.sh \
275 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
276 ${GENSCRIPTS} i386aout
277 em_i386mach.c
: $(srcdir)/emulparams
/i386mach.sh \
278 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
279 ${GENSCRIPTS} i386mach
280 em_ebmon29k.c
: $(srcdir)/emulparams
/ebmon29k.sh \
281 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/ebmon29k.sc
${GEN_DEPENDS}
282 ${GENSCRIPTS} ebmon29k
283 em_sa29200.c
: $(srcdir)/emulparams
/sa29200.sh \
284 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sa29200.sc
${GEN_DEPENDS}
285 ${GENSCRIPTS} sa29200
286 em_a29k.c
: $(srcdir)/emulparams
/a29k.sh \
287 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/a29k.sc
${GEN_DEPENDS}
289 em_m88kbcs.c
: $(srcdir)/emulparams
/m88kbcs.sh \
290 $(srcdir)/emultempl
/m88kbcs.em
$(srcdir)/scripttempl
/m88kbcs.sc
${GEN_DEPENDS}
291 ${GENSCRIPTS} m88kbcs
292 em_h8300.c
: $(srcdir)/emulparams
/h8300.sh \
293 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8300.sc
${GEN_DEPENDS}
295 em_h8300h.c
: $(srcdir)/emulparams
/h8300h.sh \
296 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8300h.sc
${GEN_DEPENDS}
298 em_h8500.c
: $(srcdir)/emulparams
/h8500.sh \
299 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500.sc
${GEN_DEPENDS}
301 em_sh.c
: $(srcdir)/emulparams
/sh.sh \
302 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sh.sc
${GEN_DEPENDS}
304 em_st2000.c
: $(srcdir)/emulparams
/st2000.sh \
305 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/st2000.sc
${GEN_DEPENDS}
307 em_z8ksim.c
: $(srcdir)/emulparams
/z8ksim.sh \
308 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/z8ksim.sc
${GEN_DEPENDS}
310 em_vanilla.c
: $(srcdir)/emulparams
/vanilla.sh \
311 $(srcdir)/emultempl
/vanilla.em
$(srcdir)/scripttempl
/vanilla.sc
${GEN_DEPENDS}
312 ${GENSCRIPTS} vanilla
313 em_lnk960.c
: $(srcdir)/emulparams
/lnk960.sh \
314 $(srcdir)/emultempl
/lnk960.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
316 em_gld960.c
: $(srcdir)/emulparams
/gld960.sh \
317 $(srcdir)/emultempl
/gld960.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
319 em_m68kcoff.c
: $(srcdir)/emulparams
/m68kcoff.sh \
320 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/m68kcoff.sc
${GEN_DEPENDS}
321 ${GENSCRIPTS} m68kcoff
322 em_delta68.c
: $(srcdir)/emulparams
/delta68.sh \
323 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/delta68.sc
${GEN_DEPENDS}
324 ${GENSCRIPTS} delta68
325 em_m68klynx.c
: $(srcdir)/emulparams
/m68klynx.sh \
326 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/m68kcoff.sc
${GEN_DEPENDS}
327 ${GENSCRIPTS} m68klynx
328 em_i386coff.c
: $(srcdir)/emulparams
/i386coff.sh \
329 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/i386coff.sc
${GEN_DEPENDS}
330 ${GENSCRIPTS} i386coff
331 em_i386lynx.c
: $(srcdir)/emulparams
/i386lynx.sh \
332 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/i386coff.sc
${GEN_DEPENDS}
333 ${GENSCRIPTS} i386lynx
334 em_sparclynx.c
: $(srcdir)/emulparams
/sparclynx.sh \
335 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sparccoff.sc
${GEN_DEPENDS}
336 ${GENSCRIPTS} sparclynx
337 em_mipslit.c
: $(srcdir)/emulparams
/mipslit.sh \
338 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
339 ${GENSCRIPTS} mipslit
340 em_i386bsd.c
: $(srcdir)/emulparams
/i386bsd.sh \
341 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
342 ${GENSCRIPTS} i386bsd
343 em_mipsbig.c
: $(srcdir)/emulparams
/mipsbig.sh \
344 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
345 ${GENSCRIPTS} mipsbig
346 em_mipsbsd.c
: $(srcdir)/emulparams
/mipsbsd.sh \
347 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
348 ${GENSCRIPTS} mipsbsd
349 em_mipsidt.c
: $(srcdir)/emulparams
/mipsidt.sh \
350 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
351 ${GENSCRIPTS} mipsidt
352 em_mipsidtl.c
: $(srcdir)/emulparams
/mipsidtl.sh \
353 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
354 ${GENSCRIPTS} mipsidtl
355 em_elf_i386.c
: $(srcdir)/emulparams
/elf_i386.sh \
356 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
357 ${GENSCRIPTS} elf_i386
358 em_elf32mipb.c
: $(srcdir)/emulparams
/elf32mipb.sh \
359 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
360 ${GENSCRIPTS} elf32mipb
361 em_alpha.c
: $(srcdir)/emulparams
/alpha.sh \
362 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/alpha.sc
${GEN_DEPENDS}
364 em_coff_sparc.c
: $(srcdir)/emulparams
/coff_sparc.sh \
365 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sparccoff.sc
${GEN_DEPENDS}
366 ${GENSCRIPTS} coff_sparc
368 $(LD_PROG
): $(OFILES
) $(BFDLIB
) $(LIBIBERTY
)
369 $(CC
) $(CFLAGS
) $(LDFLAGS
) -o
$(LD_PROG
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(EXTRALIBS
)
371 # The generated emulation files mostly have the same dependencies.
372 $(EMULATION_OFILES
): ..
/bfd
/bfd.h ..
/bfd
/sysdep.h
$(INCDIR
)/bfdlink.h \
373 ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h config.h ldctor.h
375 # These targets are for the dejagnu testsuites. The file site.exp
376 # contains global variables that all the testsuites will use.
377 # There is a current debate as to how and where to generate test
378 # outputs. Rob feels each test should be built in $(objdir) with
379 # a unique name. Cassidy feels that we should create a directory
380 # called $(objdir)/tmpdir and do the work there. This way, there
381 # is no potential conflict with existing objects, ie: as there
382 # was in the past with loop.o and flow.o, and, there is no chance
383 # of filling /tmp, which would cause other problems. Lastly, this
384 # allow retention of the testcase name making debugging easier.
386 testdir
= $(objdir
)/tmpdir
388 site.exp
: .
/config.status Makefile
389 @if
[ -d
$(testdir
) ]; then true
; else mkdir
$(testdir
); fi
390 @echo
"Making a new config file..."
393 @mv site.exp site.bak
394 @echo
"## variables are automatically generated by make ##" > .
/tmp0
395 @echo
"# Do not edit here. If you wish to override these" >> .
/tmp0
396 @echo
"# values, add them to the last section" >> .
/tmp0
397 @echo
"# HOST AND TARGET INFO" >> .
/tmp0
398 @echo
"set host_os $(host_os)" >> .
/tmp0
399 @echo
"set host_alias $(host_alias)" >> .
/tmp0
400 @echo
"set host_cpu $(host_cpu)" >> .
/tmp0
401 @echo
"set host_vendor $(host_vendor)" >> .
/tmp0
402 @echo
"set target_os $(target_os)" >> .
/tmp0
403 @echo
"set target_alias $(target_alias)" >> .
/tmp0
404 @echo
"set target_cpu $(target_cpu)" >> .
/tmp0
405 @echo
"set target_vendor $(target_vendor)" >> .
/tmp0
406 @echo
"set host_triplet $(host_canonical)" >> .
/tmp0
407 @echo
"set target_triplet $(target_canonical)" >> .
/tmp0
408 @echo
"# DIRECTORY INFO" >> .
/tmp0
409 @echo
"set objdir `pwd`" >> .
/tmp0
410 @echo
"set tmpdir `cd $(testdir); pwd`" >> .
/tmp0
412 @echo
"# LD DEPENDANCIES" >> .
/tmp0
413 @echo
"set OFILES \"$(OFILES)\"" >> .
/tmp0
414 @echo
"set BFDLIB \"$(BFDLIB)\"" >> .
/tmp0
415 @echo
"set LIBIBERTY \"$(LIBIBERTY)\"" >> .
/tmp0
416 @echo
"set HOSTING_EMU \"$(HOSTING_EMU)\"" >> .
/tmp0
417 @echo
"set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> .
/tmp0
418 @echo
"set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> .
/tmp0
420 @echo
"## Variables generated by configure. Do Not Edit ##" >> .
/tmp0
421 @cat .
/tmp0
> site.exp
422 @cat site.bak | sed \
423 -e
'1,/^## Variables generated by.*##/ d' >> site.exp
426 check: ld.new site.exp
427 @if
[ $(host_canonical
) = $(target_canonical
) ]; then \
428 $(RUNTEST
) --tool
ld \
429 --srcdir $(srcdir)/testsuite
$(RUNTESTFLAGS
) \
430 CC
="$(RUNTEST_CC)" CFLAGS
="$(RUNTEST_CFLAGS)" \
431 CXX
="$(RUNTEST_CXX)" CXXFLAGS
="$(RUNTEST_CXXFLAGS)" ;\
432 if
[ $$?
!= 0 ]; then exit
1; else true
; fi
;\
434 echo No cross-linker tests yet.
;\
438 .PHONY
: check installcheck
440 # Rules for testing by relinking ld itself.
443 .
/ld.new
$(HOSTING_EMU
) -o ld-partial.o
-r
$(OFILES
)
445 .
/ld.new
$(HOSTING_EMU
) -o ld1
$(HOSTING_CRT0
) ld-partial.o
$(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
448 .
/ld.new
$(HOSTING_EMU
) -o ld1-full
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
451 .
/ld1
$(HOSTING_EMU
) -o ld2
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
454 .
/ld2
$(HOSTING_EMU
) -o ld3
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
461 # A test program for C++ constructors and destructors.
463 cdtest
: cdtest-main.o cdtest-func.o cdtest-foo.o
ld.new
464 .
/ld.new
$(HOSTING_EMU
) -o cdtest
$(HOSTING_CRT0
) \
465 cdtest-main.o cdtest-func.o cdtest-foo.o
$(HOSTING_LIBS
)
467 check-cdtest
: cdtest
$(srcdir)/cdtest.exp
469 diff
$(srcdir)/cdtest.exp cdtest.out
473 # END OF CHECK TARGETS
475 # DOCUMENTATION TARGETS
476 # Manual configuration file; not usually attached to normal configuration,
477 # because almost all configs use "gen" version of manual.
478 # Set DOCVER above to change.
479 configdoc.texi
: ${DOCVER}-doc.texi
480 ln
-s
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi || \
481 ln
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi || \
482 cp
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi
486 ld.
dvi: $(srcdir)/ld.texinfo
$(srcdir)/configdoc.texi
$(BFDDIR
)/doc
/bfdsumm.texi
487 TEXINPUTS
=$(BFDDIR
)/doc
:$$TEXINPUTS $(TEXI2DVI
) $(srcdir)/ld.texinfo
489 ldint.
dvi: $(srcdir)/ldint.texinfo
490 $(TEXI2DVI
) $(srcdir)/ldint.texinfo
492 # info file for online browsing
493 ld.
info: $(srcdir)/ld.texinfo configdoc.texi
$(BFDDIR
)/doc
/bfdsumm.texi
494 $(MAKEINFO
) -I
$(BFDDIR
)/doc
-o
ld.
info $(srcdir)/ld.texinfo
496 ldint.
info: $(srcdir)/ldint.texinfo
497 $(MAKEINFO
) -o ldint.
info $(srcdir)/ldint.texinfo
501 #separate targets for "ms", "me", and "mm" forms of roff doc
502 # Try to use a recent texi2roff. v2 was put on prep in jan91.
503 # If you want an index, see texi2roff doc for postprocessing
504 # and add -i to texi2roff invocations below.
505 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
506 # correspondint -e lines when later texi2roff's are current)
507 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
508 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
509 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
510 # + @alphaenumerate is ridiculously new, turned into @enumerate
512 ld.ms
: $(srcdir)/ld.texinfo
513 sed
-e
'/\\input texinfo/d' \
514 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
515 -e
'/^@ifinfo/,/^@end ifinfo/d' \
519 -e
's/^@alphaenumerate/@enumerate/g' \
520 -e
's/^@end alphaenumerate/@end enumerate/g' \
521 $(srcdir)/ld.texinfo | \
522 $(TEXI2ROFF
) $(TEXI2OPT
) -ms | \
523 sed
-e
's/---/\\(em/g' \
526 # index for roff output
528 $(ROFF
) -ms
ld.ms
2>&1 1>/dev
/null | \
529 sed
-e
'/: warning:/d' | \
530 texi2index
>ld-index.ms
533 ld.mm
: $(srcdir)/ld.texinfo
534 sed
-e
'/\\input texinfo/d' \
535 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
536 -e
'/^@ifinfo/,/^@end ifinfo/d' \
541 -e
's/^@alphaenumerate/@enumerate/g' \
542 -e
's/^@end alphaenumerate/@end enumerate/g' \
543 $(srcdir)/ld.texinfo | \
544 $(TEXI2ROFF
) $(TEXI2OPT
) -mm | \
545 sed
-e
's/---/\\(em/g' \
548 # index for roff output
550 $(ROFF
) -mm
ld.mm
2>&1 1>/dev
/null | \
551 sed
-e
'/: warning:/d' | \
552 texi2index
>ld-index.mm
555 ld.me
: $(srcdir)/ld.texinfo
556 sed
-e
'/\\input texinfo/d' \
557 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
558 -e
'/^@ifinfo/,/^@end ifinfo/d' \
562 -e
's/^@alphaenumerate/@enumerate/g' \
563 -e
's/^@end alphaenumerate/@end enumerate/g' \
564 $(srcdir)/ld.texinfo | \
565 $(TEXI2ROFF
) $(TEXI2OPT
) -me | \
566 sed
-e
's/---/\\(em/g' \
569 # index for roff output
571 $(ROFF
) -me
ld.me
2>&1 1>/dev
/null | \
572 sed
-e
'/: warning:/d' | \
573 texi2index
>ld-index.me
577 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage1
578 -(cd stage1
; ln
-s
$(LD_PROG
) ld)
582 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage2
583 -(cd stage2
; ln
-s
$(LD_PROG
) ld)
587 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage3
588 -(cd stage3
; ln
-s
$(LD_PROG
) ld)
593 for i in
$(STAGESTUFF
) $(LD_PROG
) ; do cmp
$$i $(against
)/$$i ; done
596 -(cd stage1
; mv
-f
* ..
)
601 -(cd stage2
; mv
-f
* ..
)
606 -(cd stage3
; mv
-f
* ..
)
610 .PHONY
: stage1 stage2 stage3 comparison de-stage1 de-stage2 de-stage3
612 # Stuff that should be included in a distribution:
613 LDDISTSTUFF
= ldgram.c ldgram.h ldlex.c
614 diststuff
: $(LDDISTSTUFF
)
617 -rm -f
$(STAGESTUFF
) ld.??
ld.??? ldlex.
[qp
]
618 -rm -f
ld ld1 ld2 ld3
*.o y.output cdtest cdtest.out
622 -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp \
623 $(STAGESTUFF
) ld.??
ld.??s
ld.toc
ld.aux
ld.log ldlex.
[qp
] \
624 $(LD_PROG
) ld ld1 ld2 ld3
*.o y.output cdtest cdtest.out
625 realclean: clean distclean
626 -rm -f
$(LDDISTSTUFF
)
628 .PHONY
: diststuff
mostlyclean clean distclean realclean
630 lintlog
:$(LINTSOURCES
) Makefile
631 $(LINT
) -abhxzn
$(LINTFLAGS
) $(LINTSOURCES
) \
632 | grep
-v
"pointer casts may be troublesome" \
633 | grep
-v
"possible pointer alignment problem" \
635 | grep
-v
"conversion from long may lose accuracy" \
636 | grep
-v
"warning: constant argument to NOT" \
637 | grep
-v
"enumeration type clash, operator CAST" \
638 | grep
-v
"warning: constant in conditional context"\
639 | grep
-v
"archive\.c"
643 etags
-t
$(srcdir)/*.
[chly
] *.
[chly
]
647 $(INSTALL_XFORM
) ld.new
$(bindir)/ld
648 $(INSTALL_XFORM1
) $(srcdir)/ld.1 $(man1dir)/ld.1
649 for f in ldscripts
/*; do \
650 $(INSTALL_DATA
) $$f $(scriptdir
)/$$f ; \
652 -n
=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
653 rm -f
$(tooldir
)/bin
/ld; \
654 ln
$(bindir)/$$n $(tooldir
)/bin
/ld \
655 ||
$(INSTALL_PROGRAM
) ld.new
$(tooldir
)/bin
/ld
658 for i in
ld.
info* ; do \
659 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
665 .PHONY
: install install-info clean-info
667 # Targets to rebuild dependencies in this Makefile.
668 # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
669 .dep
: dep.sed
$(CFILES
) $(HFILES
) $(GENERATED_CFILES
) $(GENERATED_HFILES
)
671 $(MAKE
) DEP
=$(DEP
) .dep1
672 sed
-f dep.sed
<.dep1
>.dep
674 # This rule really wants a mkdep that runs "gcc -MM".
675 .dep1
: $(CFILES
) $(GENERATED_CFILES
)
677 echo
'# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
678 $(DEP
) -f .dep2
$(ALL_CFLAGS
) $?
679 $(srcdir)/..
/move-if-change .dep2 .dep1
681 dep.sed
: dep-in.sed config.status
682 sed
<$(srcdir)/dep-in.sed
>dep.sed \
683 -e
's!@INCDIR@!$(INCDIR)!' \
684 -e
's!@srcdir@!$(srcdir)!'
687 sed
-e
'/^..DO NOT DELETE THIS LINE/,$$d' < Makefile
> tmp-Makefile
688 cat .dep
>> tmp-Makefile
689 $(srcdir)/..
/move-if-change tmp-Makefile Makefile
692 sed
-e
'/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in
> tmp-Makefile.in
693 cat .dep
>> tmp-Makefile.in
694 $(srcdir)/..
/move-if-change tmp-Makefile.in
$(srcdir)/Makefile.in
698 # Dummy target to force execution of dependent targets.
704 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
705 $(SHELL
) .
/config.status
707 # What appears below is generated by a hacked mkdep using gcc -MM.
709 # DO NOT DELETE THIS LINE -- mkdep uses it.
710 # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
712 ldctor.o
: ldctor.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
713 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
714 $(INCDIR
)/bfdlink.h
ld.h ldexp.h ldlang.h ldmisc.h \
716 ldemul.o
: ldemul.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
717 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
718 config.h
ld.h ldemul.h ldmisc.h ldfile.h ldmain.h ldemul-list.h
719 ldexp.o
: ldexp.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
720 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
721 $(INCDIR
)/bfdlink.h
ld.h ldmain.h ldmisc.h ldexp.h \
723 ldfile.o
: ldfile.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
724 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
725 ld.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldlex.h
726 ldlang.o
: ldlang.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
727 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
728 $(INCDIR
)/bfdlink.h
ld.h ldmain.h ldgram.h ldexp.h \
729 ldlang.h ldemul.h ldlex.h ldmisc.h ldctor.h ldfile.h
730 ldmain.o
: ldmain.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
731 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
732 $(INCDIR
)/bfdlink.h config.h
ld.h ldmain.h ldmisc.h \
733 ldwrite.h ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h \
735 ldmisc.o
: ldmisc.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
736 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
737 ld.h ldmisc.h ldexp.h ldlang.h ldlex.h ldmain.h ldfile.h
738 ldver.o
: ldver.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
739 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
740 ld.h ldver.h ldemul.h ldmain.h
741 ldwrite.o
: ldwrite.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
742 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
743 $(INCDIR
)/bfdlink.h
ld.h ldexp.h ldlang.h ldwrite.h \
744 ldmisc.h ldgram.h ldmain.h
745 lexsup.o
: lexsup.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
746 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
747 ldlex.h
ld.h ldexp.h ldgram.h ldmisc.h
748 mri.o
: mri.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/obstack.h \
749 ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h
ld.h ldexp.h \
750 ldlang.h ldmisc.h mri.h ldgram.h
751 ldgram.o
: ldgram.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
752 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(INCDIR
)/fopen-same.h \
753 $(INCDIR
)/bfdlink.h
ld.h ldexp.h ldver.h ldlang.h ldemul.h \
754 ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
755 ldlex.o
: ldlex.c ..
/bfd
/bfd.h
$(INCDIR
)/obstack.h \
756 ld.h ldgram.h ldmisc.h ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h
758 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY