Fixed RUNTEST* CXX CXXFLAGS macros and check rule.
[deliverable/binutils-gdb.git] / ld / Makefile.in
1 # Makefile for the GNU linker ld (version 2)
2 # Copyright (C) 1989-1993 Free Software Foundation, Inc.
3
4 # This file is part of GNU ld..
5
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20
21 srcdir = .
22 objdir = .
23
24 prefix = /usr/local
25
26 program_transform_name =
27 exec_prefix = $(prefix)
28 bindir = $(exec_prefix)/bin
29 libdir = $(exec_prefix)/lib
30 tooldir = $(exec_prefix)/$(target_alias)
31 datadir = $(prefix)/lib
32 mandir = $(prefix)/man
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
42 infodir = $(prefix)/info
43 includedir = $(prefix)/include
44 docdir = $(datadir)/doc
45 # We put the scripts in the directory $(scriptdir)/ldscripts.
46 # We can't put the scripts in $(datadir) because the SEARCH_DIR
47 # directives need to be different for native and cross linkers.
48 scriptdir = $(tooldir)/lib
49
50 gcclibdir = $(libdir)/gcc/$(target_alias)
51
52 SHELL = /bin/sh
53
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
59
60 AR = ar
61 AR_FLAGS = qv
62 CFLAGS = -g
63 MAKEINFO = makeinfo
64 TEXI2DVI = texi2dvi
65 RANLIB = ranlib
66 CC_FOR_BUILD=$(CC)
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`
69
70 #version=/`./../gcc/gcc -dumpversion`
71 version=
72
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
79 LIB_PATH =
80
81 BASEDIR = $(srcdir)/..
82 BFDDIR = $(BASEDIR)/bfd
83 INCDIR = $(BASEDIR)/include
84 INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
85
86 # What version of the manual to build
87 DOCVER = gen
88
89 # Where to find texinfo.tex to format docn with TeX
90 TEXIDIR = $(srcdir)/../texinfo/fsf
91
92 # Where to find other docs needed to format with TeX
93 TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir)
94
95 # Whether to get roff to put indexing entries on stderr
96 TEXI2OPT =
97 # You neeed this to generate ld-index.ms (or .mm or .me)
98 # TEXI2OPT = -i
99
100 TEXI2ROFF=texi2roff
101
102 # Which roff program to use to generate index for texi2roff'd doc
103 ROFF = groff
104
105 #stuff for self hosting (can be overridden in config file).
106 HOSTING_CRT0=/lib/crt0.o
107 HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
108 HOSTING_EMU=-m $(EMUL)
109
110 CXX = `if [ -f ../gcc/xgcc ] ; then \
111 echo ../gcc/xgcc -B../gcc/; \
112 else echo gcc; \
113 fi`
114 CXXFLAGS = -fgnu-linker
115
116 # Setup the testing framework, if you have one
117 RUNTEST = runtest
118 RUNTEST_FLAGS =
119 RUNTEST_CC = `if [ -f ../gcc/xgcc ] ; then \
120 echo ../gcc/xgcc -B../gcc/; \
121 else echo gcc; \
122 fi`
123 RUNTEST_CFLAGS = $(CFLAGS)
124 RUNTEST_CXX = `if [ -f ../gcc/xgcc ] ; then \
125 echo ../gcc/xgcc -B../gcc/; \
126 else echo gcc; \
127 fi`
128 RUNTEST_CXXFLAGS = $(CXXFLAGS)
129
130 all:
131
132 ### Host, target, and site specific Makefile fragments come in here.
133 ####
134
135 LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
136
137 # The .cc suffix is used by `make check'.
138
139 .SUFFIXES: .y $(SUFFIXES) .cc
140
141 # Suppress smart makes who think they know how to automake Yacc files
142 .y.c:
143
144 .cc.o:
145 $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
146
147 .c.o:
148 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $<
149
150 # go directly to ld.new in case this ld isn't capable of
151 # linking native object on this host. It can be renamed on
152 # install.
153 LD_PROG = ld.new
154
155 # for self hosting
156 BFDLIB = ../bfd/libbfd.a
157 LIBIBERTY = ../libiberty/libiberty.a
158
159 ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
160 em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
161 em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \
162 em_m68kcoff.o em_st2000.o em_sa29200.o \
163 em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
164 em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
165 em_hppaosf.o em_mipsidtl.o em_sh.o \
166 $(OTHER_EMULATIONS)
167
168 # This is now set by configure.in.
169 #EMULATION_OFILES=${ALL_EMULATIONS}
170
171 OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
172 ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \
173 ldfile.o relax.o lderror.o ${EMULATION_OFILES}
174
175 HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
176 ldsym.h ldctor.h ldlang.h ldexp.h \
177 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
178
179 MANSOURCES=ld.tex
180
181 LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
182 em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \
183 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
184 relax.c lderror.c
185
186 GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h
187 GENERATED_HEADERS=ldgram.h ldemul-list.h
188
189 LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
190
191 BFDSOURCES=../../bfd/common/*.c
192
193 SOURCES= $(LDSOURCES) $(BFDSOURCES)
194 LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
195
196 STAGESTUFF = *.o ldscripts/* $(GENERATED_SOURCES) $(GENERATED_HEADERS)
197
198 all: $(LD_PROG)
199
200 info: ld.info
201
202 ldgram.h ldgram.c: ldgram.y
203 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
204 mv -f y.tab.c ldgram.c
205 mv -f y.tab.h ldgram.h
206
207 # EMUL is the name of a file in the emulparams subdir, without the .sh.
208 DEF_EMUL = ` if [ -z "$(EMUL)" ] ; then \
209 echo "you must set a default emulation" 1>&2 ; \
210 exit 1 ; \
211 else \
212 echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \
213 fi`
214
215 ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
216 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
217 $(INCDIR)/fopen-same.h config.h ld.h \
218 ldmain.h ldmisc.h ldwrite.h ./ldgram.h \
219 ldsym.h ldlang.h ldemul.h ldlex.h \
220 ldfile.h ldindr.h ldwarn.h ldctor.h \
221 lderror.h
222 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $<
223
224 ldemul-list.h: Makefile
225 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
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 "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
229 done;\
230 echo "";\
231 echo "#define EMULATION_LIST \\";\
232 for f in `echo " " ${EMULATION_OFILES} "" \
233 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
234 echo " &ld_$${f}_emulation, \\"; \
235 done;\
236 echo " 0") >ldemul-list.h
237
238 ldlex.c: ldlex.l ldgram.h
239 $(LEX) -I -Cem $(srcdir)/ldlex.l
240 mv lex.yy.c ldlex.c
241
242 # These all start with em_ so 'make clean' can find them.
243
244 GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL}
245 GEN_DEPENDS=$(srcdir)/genscripts.sh
246
247 em_sun4.c: $(srcdir)/emulparams/sun4.sh \
248 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
249 ${GENSCRIPTS} sun4
250 em_sun3.c: $(srcdir)/emulparams/sun3.sh \
251 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
252 ${GENSCRIPTS} sun3
253 em_go32.c: $(srcdir)/emulparams/go32.sh \
254 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
255 ${GENSCRIPTS} go32
256 em_news.c: $(srcdir)/emulparams/news.sh \
257 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
258 ${GENSCRIPTS} news
259 em_vax.c: $(srcdir)/emulparams/vax.sh \
260 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
261 ${GENSCRIPTS} vax
262 em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
263 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
264 ${GENSCRIPTS} hp300bsd
265 em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
266 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
267 ${GENSCRIPTS} hp3hpux
268 em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \
269 $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS}
270 ${GENSCRIPTS} hppaosf
271 em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \
272 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
273 ${GENSCRIPTS} i386aout
274 em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
275 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
276 ${GENSCRIPTS} ebmon29k
277 em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \
278 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
279 ${GENSCRIPTS} sa29200
280 em_a29k.c: $(srcdir)/emulparams/a29k.sh \
281 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
282 ${GENSCRIPTS} a29k
283 em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
284 $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
285 ${GENSCRIPTS} m88kbcs
286 em_h8300.c: $(srcdir)/emulparams/h8300.sh \
287 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
288 ${GENSCRIPTS} h8300
289 em_h8300h.c: $(srcdir)/emulparams/h8300h.sh \
290 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
291 ${GENSCRIPTS} h8300h
292 em_h8500.c: $(srcdir)/emulparams/h8500.sh \
293 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
294 ${GENSCRIPTS} h8500
295 em_sh.c: $(srcdir)/emulparams/sh.sh \
296 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
297 ${GENSCRIPTS} sh
298 em_st2000.c: $(srcdir)/emulparams/st2000.sh \
299 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
300 ${GENSCRIPTS} st2000
301 em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
302 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
303 ${GENSCRIPTS} z8ksim
304 em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \
305 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
306 ${GENSCRIPTS} vanilla
307 em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \
308 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
309 ${GENSCRIPTS} lnk960
310 em_gld960.c: $(srcdir)/emulparams/gld960.sh \
311 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
312 ${GENSCRIPTS} gld960
313 em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
314 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
315 ${GENSCRIPTS} m68kcoff
316 em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \
317 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
318 ${GENSCRIPTS} i386coff
319 em_mipslit.c: $(srcdir)/emulparams/mipslit.sh \
320 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
321 ${GENSCRIPTS} mipslit
322 em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
323 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
324 ${GENSCRIPTS} i386bsd
325 em_mipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
326 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
327 ${GENSCRIPTS} mipsbig
328 em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
329 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
330 ${GENSCRIPTS} mipsbsd
331 em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
332 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
333 ${GENSCRIPTS} mipsidt
334 em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
335 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
336 ${GENSCRIPTS} mipsidtl
337
338 $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
339 $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
340
341 # This list of dependencies was generated by doing a make with gcc -MM
342 # saving the output in a file and removing the gcc commands
343 # changing "../../devo/ld/../bfd" to "$(BFDDIR)"
344 # removing "../../devo/ld/"
345 # changing "../include" to "$(INCDIR)"
346
347 ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
348 ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h \
349 ld.h ldexp.h ldver.h ldlang.h \
350 ldemul.h ldfile.h ldmisc.h mri.h
351 ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h ./ldgram.h
352 lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
353 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
354 $(INCDIR)/fopen-same.h ldlex.h ld.h \
355 ldexp.h ./ldgram.h ldmisc.h
356 ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
357 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
358 $(INCDIR)/fopen-same.h ld.h ldmain.h \
359 ldsym.h ./ldgram.h ldwarn.h ldlang.h \
360 ldexp.h ldemul.h ldlex.h ldmisc.h \
361 ldindr.h ldctor.h
362 mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
363 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
364 $(INCDIR)/fopen-same.h ld.h ldlang.h \
365 mri.h ./ldgram.h ldexp.h
366 ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
367 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
368 $(INCDIR)/fopen-same.h ld.h ldlang.h \
369 ldsym.h ldmisc.h ldexp.h ./ldgram.h
370 ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
371 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
372 $(INCDIR)/fopen-same.h config.h ld.h \
373 ldmain.h ldmisc.h ldwrite.h ./ldgram.h \
374 ldsym.h ldlang.h ldemul.h ldlex.h \
375 ldfile.h ldindr.h ldwarn.h ldctor.h \
376 lderror.h
377 ldindr.o: ldindr.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
378 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
379 $(INCDIR)/fopen-same.h ld.h ldsym.h \
380 ldmisc.h
381 ldwarn.o: ldwarn.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
382 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
383 $(INCDIR)/fopen-same.h ldsym.h ldwarn.h \
384 ldmisc.h
385 ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
386 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
387 $(INCDIR)/fopen-same.h ldlang.h ld.h \
388 ldwrite.h ldmisc.h ldsym.h ./ldgram.h \
389 relax.h
390 ldexp.o: ldexp.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 ldmain.h \
393 ldmisc.h ldexp.h ./ldgram.h ldsym.h \
394 ldlang.h
395 ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
396 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
397 $(INCDIR)/fopen-same.h config.h ld.h \
398 ldemul.h ldmisc.h ./ldemul-list.h
399 ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
400 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
401 $(INCDIR)/fopen-same.h ldver.h ldemul.h
402 ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
403 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
404 $(INCDIR)/fopen-same.h ld.h ldmisc.h \
405 ldlang.h ldlex.h
406 ldsym.o: ldsym.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
407 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
408 $(INCDIR)/fopen-same.h ld.h ldsym.h \
409 ldmisc.h ldlang.h
410 ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
411 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
412 $(INCDIR)/fopen-same.h ldmisc.h ldlang.h \
413 ldfile.h
414 relax.o: relax.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
415 $(INCDIR)/obstack.h $(BFDDIR)/seclet.h $(INCDIR)/coff/internal.h \
416 ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h \
417 ldlang.h ld.h ldwrite.h ldmisc.h \
418 ldsym.h ./ldgram.h relax.h
419 lderror.o: lderror.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
420 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
421 $(INCDIR)/fopen-same.h $(BFDDIR)/seclet.h ld.h \
422 ldmisc.h
423
424 # CYGNUS LOCAL targets.
425 # These targets are for the dejagnu testsuites. The file site.exp
426 # contains global variables that all the testsuites will use.
427 # There is a current debate as to how and where to generate test
428 # outputs. Rob feels each test should be built in $(objdir) with
429 # a unique name. Cassidy feels that we should create a directory
430 # called $(objdir)/tmpdir and do the work there. This way, there
431 # is no potential conflict with existing objects, ie: as there
432 # was in the past with loop.o and flow.o, and, there is no chance
433 # of filling /tmp, which would cause other problems. Lastly, this
434 # allow retention of the testcase name making debugging easier.
435 #
436 testdir = $(objdir)/tmpdir
437
438 site.exp: ./config.status Makefile
439 @if [ -d $(testdir) ]; then true; else mkdir $(testdir); fi
440 @echo "Making a new config file..."
441 @rm -f ./tmp?
442 @touch site.exp
443 @mv site.exp site.bak
444 @echo "## variables are automatically generated by make ##" > ./tmp0
445 @echo "# Do not edit here. If you wish to override these" >> ./tmp0
446 @echo "# values, add them to the last section" >> ./tmp0
447 @echo "# HOST AND TARGET INFO" >> ./tmp0
448 @echo "set host_os $(host_os)" >> ./tmp0
449 @echo "set host_alias $(host_alias)" >> ./tmp0
450 @echo "set host_cpu $(host_cpu)" >> ./tmp0
451 @echo "set host_vendor $(host_vendor)" >> ./tmp0
452 @echo "set target_os $(target_os)" >> ./tmp0
453 @echo "set target_alias $(target_alias)" >> ./tmp0
454 @echo "set target_cpu $(target_cpu)" >> ./tmp0
455 @echo "set target_vendor $(target_vendor)" >> ./tmp0
456 @echo "set host_triplet $(host_canonical)" >> ./tmp0
457 @echo "set target_triplet $(target_canonical)" >> ./tmp0
458 @echo "# DIRECTORY INFO" >> ./tmp0
459 @echo "set objdir `pwd`" >> ./tmp0
460 @echo "set tmpdir `cd $(testdir); pwd`" >> ./tmp0
461 @echo "" >> ./tmp0
462 @echo "# LD DEPENDANCIES" >> ./tmp0
463 @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
464 @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
465 @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
466 @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
467 @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
468 @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
469 @echo "" >> ./tmp0
470 @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
471 @cat ./tmp0 > site.exp
472 @cat site.bak | sed \
473 -e '1,/^## Variables generated by.*##/ d' >> site.exp
474 -@rm -f ./tmp?
475
476 check: ld.new site.exp
477 $(RUNTEST) --tool ld \
478 --srcdir $(srcdir)/testsuite $(RUNTEST_FLAGS) \
479 CC="$(RUNTEST_CC)" CFLAGS="$(RUNTEST_CFLAGS)" \
480 CXX="$(RUNTEST_CXX)" CXXFLAGS="$(RUNTEST_CXXFLAGS)"
481
482 installcheck:
483
484 # Rules for testing by relinking ld itself.
485
486 ld-partial.o: ld.new
487 ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
488 ld1: ld-partial.o
489 ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
490
491 ld1-full: ld.new
492 ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
493
494 ld2: ld1
495 ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
496
497 ld3: ld2
498 ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
499
500 bootstrap: ld3
501 cmp ld2 ld3
502
503 # A test program for C++ constructors and destructors.
504
505 cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new
506 ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
507 cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS)
508
509 check-cdtest: cdtest $(srcdir)/cdtest.exp
510 ./cdtest >cdtest.out
511 diff $(srcdir)/cdtest.exp cdtest.out
512 # END OF CHECK TARGETS
513
514 # DOCUMENTATION TARGETS
515 # Manual configuration file; not usually attached to normal configuration,
516 # because almost all configs use "gen" version of manual.
517 # Set DOCVER above to change.
518 configdoc.texi: ${DOCVER}-doc.texi
519 ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
520 ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
521 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
522
523 # TeX output
524 dvi: ld.dvi
525 ld.dvi: $(srcdir)/ld.texinfo $(srcdir)/configdoc.texi
526 $(TEXI2DVI) $(srcdir)/ld.texinfo
527
528 ldint.dvi: $(srcdir)/ldint.texinfo
529 $(TEXI2DVI) $(srcdir)/ldint.texinfo
530
531 # info file for online browsing
532 ld.info: $(srcdir)/ld.texinfo configdoc.texi
533 $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo
534
535 ldint.info: $(srcdir)/ldint.texinfo
536 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
537
538 #separate targets for "ms", "me", and "mm" forms of roff doc
539 # Try to use a recent texi2roff. v2 was put on prep in jan91.
540 # If you want an index, see texi2roff doc for postprocessing
541 # and add -i to texi2roff invocations below.
542 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
543 # correspondint -e lines when later texi2roff's are current)
544 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
545 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
546 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
547 # + @alphaenumerate is ridiculously new, turned into @enumerate
548
549 ld.ms: $(srcdir)/ld.texinfo
550 sed -e '/\\input texinfo/d' \
551 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
552 -e '/^@ifinfo/,/^@end ifinfo/d' \
553 -e '/^@c/d' \
554 -e 's/{.*,,/{/' \
555 -e 's/@ / /g' \
556 -e 's/^@alphaenumerate/@enumerate/g' \
557 -e 's/^@end alphaenumerate/@end enumerate/g' \
558 $(srcdir)/ld.texinfo | \
559 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
560 sed -e 's/---/\\(em/g' \
561 >>ld.ms
562
563 # index for roff output
564 ld-index.ms: ld.ms
565 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
566 sed -e '/: warning:/d' | \
567 texi2index >ld-index.ms
568
569 # roff output (-mm)
570 ld.mm: $(srcdir)/ld.texinfo
571 sed -e '/\\input texinfo/d' \
572 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
573 -e '/^@ifinfo/,/^@end ifinfo/d' \
574 -e '/^@c/d' \
575 -e 's/{.*,,/{/' \
576 -e '/@noindent/d' \
577 -e 's/@ / /g' \
578 -e 's/^@alphaenumerate/@enumerate/g' \
579 -e 's/^@end alphaenumerate/@end enumerate/g' \
580 $(srcdir)/ld.texinfo | \
581 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
582 sed -e 's/---/\\(em/g' \
583 >ld.mm
584
585 # index for roff output
586 ld-index.mm: ld.mm
587 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
588 sed -e '/: warning:/d' | \
589 texi2index >ld-index.mm
590
591 # roff output (-me)
592 ld.me: $(srcdir)/ld.texinfo
593 sed -e '/\\input texinfo/d' \
594 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
595 -e '/^@ifinfo/,/^@end ifinfo/d' \
596 -e '/^@c/d' \
597 -e 's/{.*,,/{/' \
598 -e 's/@ / /g' \
599 -e 's/^@alphaenumerate/@enumerate/g' \
600 -e 's/^@end alphaenumerate/@end enumerate/g' \
601 $(srcdir)/ld.texinfo | \
602 $(TEXI2ROFF) $(TEXI2OPT) -me | \
603 sed -e 's/---/\\(em/g' \
604 >>ld.me
605
606 # index for roff output
607 ld-index.me: ld.me
608 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
609 sed -e '/: warning:/d' | \
610 texi2index >ld-index.me
611
612 stage1: force
613 -mkdir stage1
614 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
615 -(cd stage1 ; ln -s $(LD_PROG) ld)
616
617 stage2: force
618 -mkdir stage2
619 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
620 -(cd stage2 ; ln -s $(LD_PROG) ld)
621
622 stage3: force
623 -mkdir stage3
624 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
625 -(cd stage3 ; ln -s $(LD_PROG) ld)
626
627 against=stage2
628
629 comparison: force
630 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
631
632 de-stage1: force
633 -(cd stage1 ; mv -f * ..)
634 -rm ld
635 -rmdir stage1
636
637 de-stage2: force
638 -(cd stage2 ; mv -f * ..)
639 -rm ld
640 -rmdir stage2
641
642 de-stage3: force
643 -(cd stage3 ; mv -f * ..)
644 -rm ld
645 -rmdir stage3
646
647 # Stuff that should be included in a distribution:
648 LDDISTSTUFF=ldgram.c ldgram.h ldlex.c
649 diststuff: $(LDDISTSTUFF)
650
651 mostlyclean:
652 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
653 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out
654 clean: mostlyclean
655 -rm -f $(LD_PROG)
656 distclean: clean
657 -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp
658 realclean: distclean
659 -rm -f $(LDDISTSTUFF)
660
661 lintlog:$(SOURCES) Makefile
662 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
663 | grep -v "pointer casts may be troublesome" \
664 | grep -v "possible pointer alignment problem" \
665 | grep -v "ignore" \
666 | grep -v "conversion from long may lose accuracy" \
667 | grep -v "warning: constant argument to NOT" \
668 | grep -v "enumeration type clash, operator CAST" \
669 | grep -v "warning: constant in conditional context"\
670 | grep -v "archive\.c"
671
672
673 TAGS:
674 etags -t $(srcdir)/*.[chly] *.[chly]
675
676
677 .PHONY: install
678 install:
679 $(INSTALL_XFORM) ld.new $(bindir)/ld
680 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
681 for f in ldscripts/*; do \
682 $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
683 done
684 -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
685 rm -f $(tooldir)/bin/ld; \
686 ln $(bindir)/$$n $(tooldir)/bin/ld \
687 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
688
689 install-info:
690 for i in ld.info* ; do \
691 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
692 done
693
694 clean-info:
695 -rm -rf *.info*
696
697 #-----------------------------------------------------------------------------
698 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
699 #
700 # 'VERSION' file must be present and contain a string of the form "x.y"
701 #-----------------------------------------------------------------------------
702
703 ver960.c: FORCE
704 rm -f ver960.c
705 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
706
707
708 # This target should be invoked before building a new release.
709 # 'VERSION' file must be present and contain a string of the form "x.y"
710 #
711 roll:
712 @V=`cat VERSION` ; \
713 MAJ=`sed 's/\..*//' VERSION` ; \
714 MIN=`sed 's/.*\.//' VERSION` ; \
715 V=$$MAJ.`expr $$MIN + 1` ; \
716 rm -f VERSION ; \
717 echo $$V >VERSION ; \
718 echo Version $$V
719
720
721 dep: $(LDSOURCES)
722 mkdep $(CFLAGS) $?
723
724 # Dummy target to force execution of dependent targets.
725 #
726 force:
727
728 # Target to uncomment host-specific lines in this makefile. Such lines must
729 # have the following string beginning in column 1: #__<hostname>__#
730 # Original Makefile is backed up as 'Makefile.old'.
731 #
732 # Invoke with: make make HOST=xxx
733 #
734 make:
735 -@if test $(HOST)x = x ; then \
736 echo '\aSpecify "make make HOST=???"'; \
737 exit 1; \
738 fi ; \
739 grep -s "^#The next line was generated by 'make make'" Makefile; \
740 if test $$? = 0 ; then \
741 echo "\aMakefile has already been processed with 'make make'";\
742 exit 1; \
743 fi ; \
744 mv -f Makefile Makefile.old; \
745 echo "#The next line was generated by 'make make'" >Makefile ; \
746 echo "HOST=$(HOST)" >>Makefile ; \
747 echo >>Makefile ; \
748 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
749
750 #\f
751
752 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
753 $(SHELL) ./config.status
754
755 ### mode:fundamental ***
756 ### Local Variables: ***
757 ### page-delimiter: "^#\f" ***
758 ### End: ***
759 ### end of file
760
761
762 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.050329 seconds and 5 git commands to generate.