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