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