1 # Makefile for the GNU linker ld (version 2)
2 # Copyright (C) 1989-1993 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
50 gcclibdir
= $(libdir)/gcc
/$(target_alias
)
54 INSTALL
= `cd $(srcdir); pwd`/..
/install.sh
-c
55 INSTALL_PROGRAM
= $(INSTALL
)
56 INSTALL_DATA
= $(INSTALL
)
57 INSTALL_XFORM
= $(INSTALL
) -t
='$(program_transform_name)'
58 INSTALL_XFORM1
= $(INSTALL_XFORM
) -b
=.1
67 BISON
= `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
68 LEX
= `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
70 #version=/`./../gcc/gcc -dumpversion`
73 # Seach path to override the default search path for -lfoo libraries.
74 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
75 # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
76 # a cross-linker, in which case the default is empty. See genscripts.sh.)
77 # Otherwise, they are replaced with the ones given in LIB_PATH,
78 # which may have the form: LIB_PATH=/lib:/usr/local/lib
81 # Additional libraries which are used when ld is built native. This
82 # is set by some host makefile fragments.
85 BASEDIR
= $(srcdir)/..
86 BFDDIR
= $(BASEDIR
)/bfd
87 INCDIR
= $(BASEDIR
)/include
88 INCLUDES
= -I.
-I
$(srcdir) -I..
/bfd
-I
$(BFDDIR
) -I
$(INCDIR
)
90 # What version of the manual to build
93 # Where to find texinfo.tex to format docn with TeX
94 TEXIDIR
= $(srcdir)/..
/texinfo
96 # Where to find other docs needed to format with TeX
97 TEXINPUTS
= $(TEXIDIR
):$(BFDDIR
)/doc
:$(srcdir)
99 # Whether to get roff to put indexing entries on stderr
101 # You neeed this to generate ld-index.ms (or .mm or .me)
106 # Which roff program to use to generate index for texi2roff'd doc
109 #stuff for self hosting (can be overridden in config file).
110 HOSTING_CRT0
=/lib
/crt0.o
111 HOSTING_LIBS
=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
112 HOSTING_EMU
=-m
$(EMUL
)
114 CXX
= `if [ -f ../gcc/xgcc ] ; then \
115 echo ../gcc/xgcc -B../gcc/; \
118 CXXFLAGS
= -fgnu-linker
120 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
123 # Setup the testing framework, if you have one
126 RUNTEST_CC
= `if [ -f ../gcc/xgcc ] ; then \
127 echo ../gcc/xgcc -B../gcc/; \
130 RUNTEST_CFLAGS
= $(CFLAGS
)
131 RUNTEST_CXX
= `if [ -f ../gcc/xgcc ] ; then \
132 echo ../gcc/xgcc -B../gcc/; \
135 # FIX_ME: using ../gcc/xgcc breaks the cdtest.
137 RUNTEST_CXXFLAGS
= $(CXXFLAGS
)
141 ### Host, target, and site specific Makefile fragments come in here.
144 LINTFLAGS
= $(INCLUDES
) $(EXTRA_DEF
)
146 # The .cc suffix is used by `make check'.
148 .SUFFIXES
: .y
$(SUFFIXES
) .
cc
150 # Suppress smart makes who think they know how to automake Yacc files
154 $(CXX
) -c
-I
$(srcdir) $(CXXFLAGS
) $(CFLAGS
) $<
157 $(CC
) -c
$(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) $(CFLAGS
) $<
159 # go directly to ld.new in case this ld isn't capable of
160 # linking native object on this host. It can be renamed on
165 BFDLIB
= ..
/bfd
/libbfd.a
166 LIBIBERTY
= ..
/libiberty
/libiberty.a
168 ALL_EMULATIONS
=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
169 em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
170 em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \
171 em_m68kcoff.o em_st2000.o em_sa29200.o \
172 em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
173 em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
174 em_hppaosf.o em_mipsidtl.o em_sh.o em_elf_i386.o em_alpha.o \
177 # This is now set by configure.in.
178 #EMULATION_OFILES=${ALL_EMULATIONS}
180 OFILES
= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
181 ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \
182 ldfile.o relax.o lderror.o
${EMULATION_OFILES}
184 HEADERS
=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
185 ldsym.h ldctor.h ldlang.h ldexp.h \
186 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h
ld.h
190 LDCSOURCES
=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
191 em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \
192 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
195 GENERATED_SOURCES
=ldgram.c ldlex.c em_
*.c ldemul-list.h
196 GENERATED_HEADERS
=ldgram.h ldemul-list.h
198 LDSOURCES
=$(LDCSOURCES
) ldgram.y ldlex.l ldgram.h
200 BFDSOURCES
=..
/..
/bfd
/common
/*.c
202 SOURCES
= $(LDSOURCES
) $(BFDSOURCES
)
203 LINTSOURCES
= $(LDCSOURCES
) $(BFDSOURCES
) $(GENERATED_SOURCES
)
205 STAGESTUFF
= *.o ldscripts
/* $(GENERATED_SOURCES
) $(GENERATED_HEADERS
)
211 ldgram.h ldgram.c
: ldgram.y
212 $(BISON
) $(BISONFLAGS
) -d
$(srcdir)/ldgram.y
213 mv
-f y.tab.c ldgram.c
214 mv
-f y.tab.h ldgram.h
216 # EMUL is the name of a file in the emulparams subdir, without the .sh.
217 DEF_EMUL
= ` if [ -z "$(EMUL)" ] ; then \
218 echo "you must set a default emulation" 1>&2 ; \
221 echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \
224 ldmain.o
: ldmain.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
225 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
226 $(INCDIR
)/fopen-same.h config.h
ld.h \
227 ldmain.h ldmisc.h ldwrite.h .
/ldgram.h \
228 ldsym.h ldlang.h ldemul.h ldlex.h \
229 ldfile.h ldindr.h ldwarn.h ldctor.h \
231 $(CC
) -c
$(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) $(DEF_EMUL
) -DSCRIPTDIR
='"$(scriptdir)"' $(CFLAGS
) $<
233 ldemul-list.h
: Makefile
234 (echo
"/* This file is automatically generated. DO NOT EDIT! */";\
235 for f in
`echo " " ${EMULATION_OFILES} "" \
236 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
237 echo
"extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
240 echo
"#define EMULATION_LIST \\";\
241 for f in
`echo " " ${EMULATION_OFILES} "" \
242 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
243 echo
" &ld_$${f}_emulation, \\"; \
245 echo
" 0") >ldemul-list.h
247 ldlex.c
: ldlex.l ldgram.h
248 $(LEX
) -I
-Cem
$(srcdir)/ldlex.l
251 # These all start with em_ so 'make clean' can find them.
253 GENSCRIPTS
=$(SHELL
) $(srcdir)/genscripts.sh
${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)"
254 GEN_DEPENDS
=$(srcdir)/genscripts.sh
256 em_sun4.c
: $(srcdir)/emulparams
/sun4.sh \
257 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
259 em_sun3.c
: $(srcdir)/emulparams
/sun3.sh \
260 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
262 em_go32.c
: $(srcdir)/emulparams
/go32.sh \
263 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
265 em_news.c
: $(srcdir)/emulparams
/news.sh \
266 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
268 em_vax.c
: $(srcdir)/emulparams
/vax.sh \
269 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
271 em_hp300bsd.c
: $(srcdir)/emulparams
/hp300bsd.sh \
272 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
273 ${GENSCRIPTS} hp300bsd
274 em_hp3hpux.c
: $(srcdir)/emulparams
/hp3hpux.sh \
275 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
276 ${GENSCRIPTS} hp3hpux
277 em_hppaosf.c
: $(srcdir)/emulparams
/hppaosf.sh \
278 $(srcdir)/emultempl
/hppaosf.em
$(srcdir)/scripttempl
/hppaosf.sc
${GEN_DEPENDS}
279 ${GENSCRIPTS} hppaosf
280 em_i386aout.c
: $(srcdir)/emulparams
/i386aout.sh \
281 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
282 ${GENSCRIPTS} i386aout
283 em_ebmon29k.c
: $(srcdir)/emulparams
/ebmon29k.sh \
284 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/ebmon29k.sc
${GEN_DEPENDS}
285 ${GENSCRIPTS} ebmon29k
286 em_sa29200.c
: $(srcdir)/emulparams
/sa29200.sh \
287 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sa29200.sc
${GEN_DEPENDS}
288 ${GENSCRIPTS} sa29200
289 em_a29k.c
: $(srcdir)/emulparams
/a29k.sh \
290 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/a29k.sc
${GEN_DEPENDS}
292 em_m88kbcs.c
: $(srcdir)/emulparams
/m88kbcs.sh \
293 $(srcdir)/emultempl
/m88kbcs.em
$(srcdir)/scripttempl
/m88kbcs.sc
${GEN_DEPENDS}
294 ${GENSCRIPTS} m88kbcs
295 em_h8300.c
: $(srcdir)/emulparams
/h8300.sh \
296 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8300.sc
${GEN_DEPENDS}
298 em_h8300h.c
: $(srcdir)/emulparams
/h8300h.sh \
299 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8300h.sc
${GEN_DEPENDS}
301 em_h8500.c
: $(srcdir)/emulparams
/h8500.sh \
302 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/h8500.sc
${GEN_DEPENDS}
304 em_sh.c
: $(srcdir)/emulparams
/sh.sh \
305 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/sh.sc
${GEN_DEPENDS}
307 em_st2000.c
: $(srcdir)/emulparams
/st2000.sh \
308 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/st2000.sc
${GEN_DEPENDS}
310 em_z8ksim.c
: $(srcdir)/emulparams
/z8ksim.sh \
311 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/z8ksim.sc
${GEN_DEPENDS}
313 em_vanilla.c
: $(srcdir)/emulparams
/vanilla.sh \
314 $(srcdir)/emultempl
/vanilla.em
$(srcdir)/scripttempl
/vanilla.sc
${GEN_DEPENDS}
315 ${GENSCRIPTS} vanilla
316 em_lnk960.c
: $(srcdir)/emulparams
/lnk960.sh \
317 $(srcdir)/emultempl
/lnk960.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
319 em_gld960.c
: $(srcdir)/emulparams
/gld960.sh \
320 $(srcdir)/emultempl
/gld960.em
$(srcdir)/scripttempl
/i960.sc
${GEN_DEPENDS}
322 em_m68kcoff.c
: $(srcdir)/emulparams
/m68kcoff.sh \
323 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/m68kcoff.sc
${GEN_DEPENDS}
324 ${GENSCRIPTS} m68kcoff
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_mipslit.c
: $(srcdir)/emulparams
/mipslit.sh \
335 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
336 ${GENSCRIPTS} mipslit
337 em_i386bsd.c
: $(srcdir)/emulparams
/i386bsd.sh \
338 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
339 ${GENSCRIPTS} i386bsd
340 em_mipsbig.c
: $(srcdir)/emulparams
/mipsbig.sh \
341 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
342 ${GENSCRIPTS} mipsbig
343 em_mipsbsd.c
: $(srcdir)/emulparams
/mipsbsd.sh \
344 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/aout.sc
${GEN_DEPENDS}
345 ${GENSCRIPTS} mipsbsd
346 em_mipsidt.c
: $(srcdir)/emulparams
/mipsidt.sh \
347 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
348 ${GENSCRIPTS} mipsidt
349 em_mipsidtl.c
: $(srcdir)/emulparams
/mipsidtl.sh \
350 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/mips.sc
${GEN_DEPENDS}
351 ${GENSCRIPTS} mipsidtl
352 em_elf_i386.c
: $(srcdir)/emulparams
/elf_i386.sh \
353 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
354 ${GENSCRIPTS} elf_i386
355 em_elf32mipb.c
: $(srcdir)/emulparams
/elf32mipb.sh \
356 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/elf.sc
${GEN_DEPENDS}
357 ${GENSCRIPTS} elf32mipb
358 em_alpha.c
: $(srcdir)/emulparams
/alpha.sh \
359 $(srcdir)/emultempl
/generic.em
$(srcdir)/scripttempl
/alpha.sc
${GEN_DEPENDS}
362 $(LD_PROG
): $(OFILES
) $(BFDLIB
) $(LIBIBERTY
)
363 $(CC
) $(INCLUDES
) $(HDEFINES
) $(TDEFINES
) $(CDEFINES
) $(CFLAGS
) $(LDFLAGS
) -o
$(LD_PROG
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(LOADLIBES
)
365 # The generated emulation files mostly have the same dependencies.
366 $(EMULATION_OFILES
): ..
/bfd
/bfd.h ..
/bfd
/sysdep.h
ld.h ldemul.h \
367 ldfile.h ldmisc.h config.h
369 # This list of dependencies was generated by doing a make with gcc -MM
370 # saving the output in a file and removing the gcc commands
371 # changing "../../devo/ld/../bfd" to "$(BFDDIR)"
372 # removing "../../devo/ld/"
373 # changing "../include" to "$(INCDIR)"
375 ldgram.o
: ldgram.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h
$(INCDIR
)/obstack.h \
376 ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h
$(INCDIR
)/fopen-same.h \
377 ld.h ldexp.h ldver.h ldlang.h \
378 ldemul.h ldfile.h ldmisc.h mri.h
379 ldlex.o
: ldlex.c ..
/bfd
/bfd.h
$(INCDIR
)/obstack.h .
/ldgram.h
380 lexsup.o
: lexsup.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
381 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
382 $(INCDIR
)/fopen-same.h ldlex.h
ld.h \
383 ldexp.h .
/ldgram.h ldmisc.h
384 ldlang.o
: ldlang.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
385 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
386 $(INCDIR
)/fopen-same.h
ld.h ldmain.h \
387 ldsym.h .
/ldgram.h ldwarn.h ldlang.h \
388 ldexp.h ldemul.h ldlex.h ldmisc.h \
390 mri.o
: mri.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
391 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
392 $(INCDIR
)/fopen-same.h
ld.h ldlang.h \
393 mri.h .
/ldgram.h ldexp.h
394 ldctor.o
: ldctor.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
395 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
396 $(INCDIR
)/fopen-same.h
ld.h ldlang.h \
397 ldsym.h ldmisc.h ldexp.h .
/ldgram.h
398 ldmain.o
: ldmain.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
399 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
400 $(INCDIR
)/fopen-same.h config.h
ld.h \
401 ldmain.h ldmisc.h ldwrite.h .
/ldgram.h \
402 ldsym.h ldlang.h ldemul.h ldlex.h \
403 ldfile.h ldindr.h ldwarn.h ldctor.h \
405 ldindr.o
: ldindr.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
406 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
407 $(INCDIR
)/fopen-same.h
ld.h ldsym.h \
409 ldwarn.o
: ldwarn.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
410 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
411 $(INCDIR
)/fopen-same.h ldsym.h ldwarn.h \
413 ldwrite.o
: ldwrite.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
414 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
415 $(INCDIR
)/fopen-same.h ldlang.h
ld.h \
416 ldwrite.h ldmisc.h ldsym.h .
/ldgram.h \
418 ldexp.o
: ldexp.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
419 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
420 $(INCDIR
)/fopen-same.h
ld.h ldmain.h \
421 ldmisc.h ldexp.h .
/ldgram.h ldsym.h \
423 ldemul.o
: ldemul.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
424 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
425 $(INCDIR
)/fopen-same.h config.h
ld.h \
426 ldemul.h ldmisc.h .
/ldemul-list.h
427 ldver.o
: ldver.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
428 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
429 $(INCDIR
)/fopen-same.h ldver.h ldemul.h
430 ldmisc.o
: ldmisc.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
431 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
432 $(INCDIR
)/fopen-same.h
ld.h ldmisc.h \
434 ldsym.o
: ldsym.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
435 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
436 $(INCDIR
)/fopen-same.h
ld.h ldsym.h \
438 ldfile.o
: ldfile.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
439 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
440 $(INCDIR
)/fopen-same.h ldmisc.h ldlang.h \
442 relax.o
: relax.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
443 $(INCDIR
)/obstack.h
$(BFDDIR
)/seclet.h
$(INCDIR
)/coff
/internal.h \
444 ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h
$(INCDIR
)/fopen-same.h \
445 ldlang.h
ld.h ldwrite.h ldmisc.h \
446 ldsym.h .
/ldgram.h relax.h
447 lderror.o
: lderror.c ..
/bfd
/bfd.h
$(INCDIR
)/ansidecl.h \
448 $(INCDIR
)/obstack.h ..
/bfd
/sysdep.h
$(BFDDIR
)/hosts
/std-host.h \
449 $(INCDIR
)/fopen-same.h
$(BFDDIR
)/seclet.h
ld.h \
452 # CYGNUS LOCAL targets.
453 # These targets are for the dejagnu testsuites. The file site.exp
454 # contains global variables that all the testsuites will use.
455 # There is a current debate as to how and where to generate test
456 # outputs. Rob feels each test should be built in $(objdir) with
457 # a unique name. Cassidy feels that we should create a directory
458 # called $(objdir)/tmpdir and do the work there. This way, there
459 # is no potential conflict with existing objects, ie: as there
460 # was in the past with loop.o and flow.o, and, there is no chance
461 # of filling /tmp, which would cause other problems. Lastly, this
462 # allow retention of the testcase name making debugging easier.
464 testdir
= $(objdir
)/tmpdir
466 site.exp
: .
/config.status Makefile
467 @if
[ -d
$(testdir
) ]; then true
; else mkdir
$(testdir
); fi
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
488 @echo
"set tmpdir `cd $(testdir); pwd`" >> .
/tmp0
490 @echo
"# LD DEPENDANCIES" >> .
/tmp0
491 @echo
"set OFILES \"$(OFILES)\"" >> .
/tmp0
492 @echo
"set BFDLIB \"$(BFDLIB)\"" >> .
/tmp0
493 @echo
"set LIBIBERTY \"$(LIBIBERTY)\"" >> .
/tmp0
494 @echo
"set HOSTING_EMU \"$(HOSTING_EMU)\"" >> .
/tmp0
495 @echo
"set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> .
/tmp0
496 @echo
"set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> .
/tmp0
498 @echo
"## Variables generated by configure. Do Not Edit ##" >> .
/tmp0
499 @cat .
/tmp0
> site.exp
500 @cat site.bak | sed \
501 -e
'1,/^## Variables generated by.*##/ d' >> site.exp
504 check: ld.new site.exp
505 $(RUNTEST
) --tool
ld \
506 --srcdir $(srcdir)/testsuite
$(RUNTEST_FLAGS
) \
507 CC
="$(RUNTEST_CC)" CFLAGS
="$(RUNTEST_CFLAGS)" \
508 CXX
="$(RUNTEST_CXX)" CXXFLAGS
="$(RUNTEST_CXXFLAGS)"
512 # Rules for testing by relinking ld itself.
515 .
/ld.new
$(HOSTING_EMU
) -o ld-partial.o
-r
$(OFILES
)
517 .
/ld.new
$(HOSTING_EMU
) -o ld1
$(HOSTING_CRT0
) ld-partial.o
$(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
520 .
/ld.new
$(HOSTING_EMU
) -o ld1-full
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
523 .
/ld1
$(HOSTING_EMU
) -o ld2
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
526 .
/ld2
$(HOSTING_EMU
) -o ld3
$(HOSTING_CRT0
) $(OFILES
) $(BFDLIB
) $(LIBIBERTY
) $(HOSTING_LIBS
)
531 # A test program for C++ constructors and destructors.
533 cdtest
: cdtest-main.o cdtest-func.o cdtest-foo.o
ld.new
534 .
/ld.new
$(HOSTING_EMU
) -o cdtest
$(HOSTING_CRT0
) \
535 cdtest-main.o cdtest-func.o cdtest-foo.o
$(HOSTING_LIBS
)
537 check-cdtest
: cdtest
$(srcdir)/cdtest.exp
539 diff
$(srcdir)/cdtest.exp cdtest.out
540 # END OF CHECK TARGETS
542 # DOCUMENTATION TARGETS
543 # Manual configuration file; not usually attached to normal configuration,
544 # because almost all configs use "gen" version of manual.
545 # Set DOCVER above to change.
546 configdoc.texi
: ${DOCVER}-doc.texi
547 ln
-s
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi || \
548 ln
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi || \
549 cp
${srcdir}/${DOCVER}-doc.texi .
/configdoc.texi
553 ld.
dvi: $(srcdir)/ld.texinfo
$(srcdir)/configdoc.texi
554 $(TEXI2DVI
) $(srcdir)/ld.texinfo
556 ldint.
dvi: $(srcdir)/ldint.texinfo
557 $(TEXI2DVI
) $(srcdir)/ldint.texinfo
559 # info file for online browsing
560 ld.
info: $(srcdir)/ld.texinfo configdoc.texi
561 $(MAKEINFO
) -I
$(BFDDIR
)/doc
-o
ld.
info $(srcdir)/ld.texinfo
563 ldint.
info: $(srcdir)/ldint.texinfo
564 $(MAKEINFO
) -o ldint.
info $(srcdir)/ldint.texinfo
566 #separate targets for "ms", "me", and "mm" forms of roff doc
567 # Try to use a recent texi2roff. v2 was put on prep in jan91.
568 # If you want an index, see texi2roff doc for postprocessing
569 # and add -i to texi2roff invocations below.
570 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
571 # correspondint -e lines when later texi2roff's are current)
572 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
573 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
574 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
575 # + @alphaenumerate is ridiculously new, turned into @enumerate
577 ld.ms
: $(srcdir)/ld.texinfo
578 sed
-e
'/\\input texinfo/d' \
579 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
580 -e
'/^@ifinfo/,/^@end ifinfo/d' \
584 -e
's/^@alphaenumerate/@enumerate/g' \
585 -e
's/^@end alphaenumerate/@end enumerate/g' \
586 $(srcdir)/ld.texinfo | \
587 $(TEXI2ROFF
) $(TEXI2OPT
) -ms | \
588 sed
-e
's/---/\\(em/g' \
591 # index for roff output
593 $(ROFF
) -ms
ld.ms
2>&1 1>/dev
/null | \
594 sed
-e
'/: warning:/d' | \
595 texi2index
>ld-index.ms
598 ld.mm
: $(srcdir)/ld.texinfo
599 sed
-e
'/\\input texinfo/d' \
600 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
601 -e
'/^@ifinfo/,/^@end ifinfo/d' \
606 -e
's/^@alphaenumerate/@enumerate/g' \
607 -e
's/^@end alphaenumerate/@end enumerate/g' \
608 $(srcdir)/ld.texinfo | \
609 $(TEXI2ROFF
) $(TEXI2OPT
) -mm | \
610 sed
-e
's/---/\\(em/g' \
613 # index for roff output
615 $(ROFF
) -mm
ld.mm
2>&1 1>/dev
/null | \
616 sed
-e
'/: warning:/d' | \
617 texi2index
>ld-index.mm
620 ld.me
: $(srcdir)/ld.texinfo
621 sed
-e
'/\\input texinfo/d' \
622 -e
'/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
623 -e
'/^@ifinfo/,/^@end ifinfo/d' \
627 -e
's/^@alphaenumerate/@enumerate/g' \
628 -e
's/^@end alphaenumerate/@end enumerate/g' \
629 $(srcdir)/ld.texinfo | \
630 $(TEXI2ROFF
) $(TEXI2OPT
) -me | \
631 sed
-e
's/---/\\(em/g' \
634 # index for roff output
636 $(ROFF
) -me
ld.me
2>&1 1>/dev
/null | \
637 sed
-e
'/: warning:/d' | \
638 texi2index
>ld-index.me
642 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage1
643 -(cd stage1
; ln
-s
$(LD_PROG
) ld)
647 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage2
648 -(cd stage2
; ln
-s
$(LD_PROG
) ld)
652 -mv
-f
$(STAGESTUFF
) $(LD_PROG
) stage3
653 -(cd stage3
; ln
-s
$(LD_PROG
) ld)
658 for i in
$(STAGESTUFF
) $(LD_PROG
) ; do cmp
$$i $(against
)/$$i ; done
661 -(cd stage1
; mv
-f
* ..
)
666 -(cd stage2
; mv
-f
* ..
)
671 -(cd stage3
; mv
-f
* ..
)
675 # Stuff that should be included in a distribution:
676 LDDISTSTUFF
=ldgram.c ldgram.h ldlex.c
677 diststuff
: $(LDDISTSTUFF
)
680 -rm -f
$(STAGESTUFF
) ld.??
ld.??? ldlex.
[qp
]
681 -rm -f
ld ld1 ld2 ld3
*.o y.output cdtest cdtest.out
685 -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp
687 -rm -f
$(LDDISTSTUFF
)
689 lintlog
:$(SOURCES
) Makefile
690 $(LINT
) -abhxzn
$(LINTFLAGS
) $(LINTSOURCES
) \
691 | grep
-v
"pointer casts may be troublesome" \
692 | grep
-v
"possible pointer alignment problem" \
694 | grep
-v
"conversion from long may lose accuracy" \
695 | grep
-v
"warning: constant argument to NOT" \
696 | grep
-v
"enumeration type clash, operator CAST" \
697 | grep
-v
"warning: constant in conditional context"\
698 | grep
-v
"archive\.c"
702 etags
-t
$(srcdir)/*.
[chly
] *.
[chly
]
707 $(INSTALL_XFORM
) ld.new
$(bindir)/ld
708 $(INSTALL_XFORM1
) $(srcdir)/ld.1 $(man1dir)/ld.1
709 for f in ldscripts
/*; do \
710 $(INSTALL_DATA
) $$f $(scriptdir
)/$$f ; \
712 -n
=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
713 rm -f
$(tooldir
)/bin
/ld; \
714 ln
$(bindir)/$$n $(tooldir
)/bin
/ld \
715 ||
$(INSTALL_PROGRAM
) ld.new
$(tooldir
)/bin
/ld
718 for i in
ld.
info* ; do \
719 $(INSTALL_DATA
) $$i $(infodir)/$$i ; \
725 #-----------------------------------------------------------------------------
726 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
728 # 'VERSION' file must be present and contain a string of the form "x.y"
729 #-----------------------------------------------------------------------------
733 echo
"char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
736 # This target should be invoked before building a new release.
737 # 'VERSION' file must be present and contain a string of the form "x.y"
741 MAJ
=`sed 's/\..*//' VERSION` ; \
742 MIN
=`sed 's/.*\.//' VERSION` ; \
743 V
=$$MAJ.
`expr $$MIN + 1` ; \
745 echo
$$V >VERSION
; \
752 # Dummy target to force execution of dependent targets.
756 # Target to uncomment host-specific lines in this makefile. Such lines must
757 # have the following string beginning in column 1: #__<hostname>__#
758 # Original Makefile is backed up as 'Makefile.old'.
760 # Invoke with: make make HOST=xxx
763 -@if
test $(HOST
)x
= x
; then \
764 echo
'\aSpecify "make make HOST=???"'; \
767 grep
-s
"^#The next line was generated by 'make make'" Makefile
; \
768 if
test $$?
= 0 ; then \
769 echo
"\aMakefile has already been processed with 'make make'";\
772 mv
-f Makefile Makefile.old
; \
773 echo
"#The next line was generated by 'make make'" >Makefile
; \
774 echo
"HOST=$(HOST)" >>Makefile
; \
776 sed
"s/^#__$(HOST)__#//" < Makefile.old
>>Makefile
780 Makefile
: $(srcdir)/Makefile.in
$(host_makefile_frag
) $(target_makefile_frag
)
781 $(SHELL
) .
/config.status
783 ### mode:fundamental ***
784 ### Local Variables: ***
785 ### page-delimiter: "^#\f" ***
790 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY