* Makefile.in (ldgram.[hc]): rewrite this rule in such a way that gnu
[deliverable/binutils-gdb.git] / ld / Makefile.in
1 # Makefile for the GNU linker ld (version 2)
2 # Copyright (C) 1989-1992 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
23 prefix = /usr/local
24
25 program_transform_name =
26 exec_prefix = $(prefix)
27 bindir = $(exec_prefix)/bin
28 libdir = $(exec_prefix)/lib
29 tooldir = $(exec_prefix)/$(target_alias)
30 datadir = $(prefix)/lib
31 mandir = $(prefix)/man
32 man1dir = $(mandir)/man1
33 man2dir = $(mandir)/man2
34 man3dir = $(mandir)/man3
35 man4dir = $(mandir)/man4
36 man5dir = $(mandir)/man5
37 man6dir = $(mandir)/man6
38 man7dir = $(mandir)/man7
39 man8dir = $(mandir)/man8
40 man9dir = $(mandir)/man9
41 infodir = $(prefix)/info
42 includedir = $(prefix)/include
43 docdir = $(datadir)/doc
44 # We can't put the scripts in $(datadir) because the SEARCH_DIR
45 # directives need to be different for native and cross linkers.
46 scriptdir = $(tooldir)/lib/ld
47
48 gcclibdir = $(libdir)/gcc/$(target_alias)
49
50 SHELL = /bin/sh
51
52 INSTALL = `cd $(srcdir); pwd`/../install.sh -c
53 INSTALL_PROGRAM = $(INSTALL)
54 INSTALL_DATA = $(INSTALL)
55 INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
56 INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
57
58 AR = ar
59 AR_FLAGS = qv
60 CFLAGS = -g
61 MAKEINFO = makeinfo
62 TEXI2DVI = texi2dvi
63 RANLIB = ranlib
64 CC_FOR_BUILD=$(CC)
65 BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
66 LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
67
68 #version=/`./../gcc/gcc -dumpversion`
69 version=
70
71 # Seach path to override the default search path for -lfoo libraries.
72 # If LIB_PATH is empty, the ones in the script (if any) are left alone.
73 # (The default is usually /lib:usr/lib:/usr/local/lib, unless building
74 # a cross-linker, in which case the default is empty. See genscripts.sh.)
75 # Otherwise, they are replaced with the ones given in LIB_PATH,
76 # which may have the form: LIB_PATH=/lib:/usr/local/lib
77 LIB_PATH =
78
79 BASEDIR = ../..
80 INCLUDE = $(srcdir)/../include
81 INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../bfd -I../bfd -I$(INCLUDE)
82
83 # What version of the manual to build
84 DOCVER = gen
85
86 # Where to find texinfo.tex to format docn with TeX
87 TEXIDIR = $(srcdir)/../texinfo/fsf
88
89 # Whether to get roff to put indexing entries on stderr
90 TEXI2OPT =
91 # You neeed this to generate ld-index.ms (or .mm or .me)
92 # TEXI2OPT = -i
93
94 TEXI2ROFF=texi2roff
95
96 # Which roff program to use to generate index for texi2roff'd doc
97 ROFF = groff
98
99 #stuff for self hosting (can be overridden in config file).
100 HOSTING_CRT0=/lib/crt0.o
101 HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
102 HOSTING_EMU=-m $(EMUL)
103
104 C++ = g++ -fgnu-linker
105
106 ### Host, target, and site specific Makefile fragments come in here.
107 ####
108
109 LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
110
111 # The .cc suffix is used by `make check'.
112
113 .SUFFIXES: .y $(SUFFIXES) .cc
114
115 .cc.o:
116 $(C++) -c -I$(srcdir) $(CFLAGS) $<
117
118 .c.o:
119 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $<
120
121 # go directly to ld.new in case this ld isn't capable of
122 # linking native object on this host. It can be renamed on
123 # install.
124 LD_PROG = ld.new
125
126 # for self hosting
127 BFDLIB=./../bfd/libbfd.a
128 LIBIBERTY=./../libiberty/libiberty.a
129
130 ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
131 em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
132 em_h8300.o em_ebmon29k.o em_sun4.o em_gld960.o \
133 em_m68kcoff.o em_st2000.o em_sa29200.o \
134 em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
135 em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
136 em_hppaosf.o em_mipsidtl.o em_sh.o
137
138 EMULATION_OFILES=${ALL_EMULATIONS}
139
140 OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
141 ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \
142 ldfile.o relax.o lderror.o ${EMULATION_OFILES}
143
144 HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
145 ldsym.h ldctor.h ldlang.h ldexp.h \
146 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
147
148 MANSOURCES=ld.tex
149
150 LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
151 em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \
152 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
153 relax.c lderror.c
154
155 GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h
156 GENERATED_HEADERS=ldgram.h ldemul-list.h
157
158 LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
159
160 BFDSOURCES=../../bfd/common/*.c
161
162 SOURCES= $(LDSOURCES) $(BFDSOURCES)
163 LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
164
165 STAGESTUFF = emulations/* $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES)
166
167 all: $(LD_PROG)
168
169 info: ld.info
170
171 # This somewhat odd makefile construction prevents a parallel gnu make
172 # from spinning off two bison processes concurrently. This is
173 # important because yacc uses static file names and multiple instances
174 # will collide.
175 ldgram.h ldgram.c: ldgram-files
176 ldgram-files: ldgram.y
177 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
178 mv -f y.tab.c ldgram.c
179 mv -f y.tab.h ldgram.h
180
181
182 DEF_EMUL = ` if [ -z "$(EMUL)" ] ; then \
183 echo "you must set a default emulation" 1>&2 ; \
184 exit 1 ; \
185 else \
186 echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \
187 fi`
188
189 ldmain.o: ldmain.c
190 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $<
191
192 ldemul-list.h:
193 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
194 for f in `echo " " ${EMULATION_OFILES} "" \
195 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
196 echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
197 done;\
198 echo "";\
199 echo "#define EMULATION_LIST \\";\
200 for f in `echo " " ${EMULATION_OFILES} "" \
201 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
202 echo " &ld_$${f}_emulation, \\"; \
203 done;\
204 echo " 0") >ldemul-list.h
205
206 ldemul.o: ldemul-list.h
207
208 ldlex.c: ldlex.l ldgram.h
209 $(LEX) -I -Cem $(srcdir)/ldlex.l
210 mv lex.yy.c ldlex.c
211
212 # These all start with em_ so 'make clean' can find them.
213
214 GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${tooldir}/lib ${libdir} ${host_alias} ${target_alias}
215 GEN_DEPENDS=$(srcdir)/genscripts.sh
216
217 em_sun4.c: $(srcdir)/emulparams/sun4.sh \
218 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
219 ${GENSCRIPTS} sun4.sh
220 em_sun3.c: $(srcdir)/emulparams/sun3.sh \
221 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
222 ${GENSCRIPTS} sun3.sh
223 em_go32.c: $(srcdir)/emulparams/go32.sh \
224 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
225 ${GENSCRIPTS} go32.sh
226 em_news.c: $(srcdir)/emulparams/news.sh \
227 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
228 ${GENSCRIPTS} news.sh
229 em_vax.c: $(srcdir)/emulparams/vax.sh \
230 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
231 ${GENSCRIPTS} vax.sh
232 em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
233 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
234 ${GENSCRIPTS} hp300bsd.sh
235 em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
236 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
237 ${GENSCRIPTS} hp3hpux.sh
238 em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \
239 $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS}
240 ${GENSCRIPTS} hppaosf.sh
241 em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \
242 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
243 ${GENSCRIPTS} i386aout.sh
244 em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
245 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
246 ${GENSCRIPTS} ebmon29k.sh
247 em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \
248 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
249 ${GENSCRIPTS} sa29200.sh
250 em_a29k.c: $(srcdir)/emulparams/a29k.sh \
251 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
252 ${GENSCRIPTS} a29k.sh
253 em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
254 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
255 ${GENSCRIPTS} m88kbcs.sh
256 em_h8300.c: $(srcdir)/emulparams/h8300.sh \
257 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
258 ${GENSCRIPTS} h8300.sh
259 em_h8500.c: $(srcdir)/emulparams/h8500.sh \
260 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
261 ${GENSCRIPTS} h8500.sh
262 em_sh.c: $(srcdir)/emulparams/sh.sh \
263 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
264 ${GENSCRIPTS} sh.sh
265 em_st2000.c: $(srcdir)/emulparams/st2000.sh \
266 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
267 ${GENSCRIPTS} st2000.sh
268 em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
269 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
270 ${GENSCRIPTS} z8ksim.sh
271 em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \
272 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
273 ${GENSCRIPTS} vanilla.sh
274 em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \
275 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
276 ${GENSCRIPTS} lnk960.sh
277 em_gld960.c: $(srcdir)/emulparams/gld960.sh \
278 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
279 ${GENSCRIPTS} gld960.sh
280 em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
281 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
282 ${GENSCRIPTS} m68kcoff.sh
283 em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \
284 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
285 ${GENSCRIPTS} i386coff.sh
286 em_mipslit.c: $(srcdir)/emulparams/mipslit.sh \
287 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
288 ${GENSCRIPTS} mipslit.sh
289 em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
290 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
291 ${GENSCRIPTS} i386bsd.sh
292 em_mipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
293 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
294 ${GENSCRIPTS} mipsbig.sh
295 em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
296 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
297 ${GENSCRIPTS} mipsbsd.sh
298 em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
299 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
300 ${GENSCRIPTS} mipsidt.sh
301 em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
302 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
303 ${GENSCRIPTS} mipsidtl.sh
304
305 $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
306 $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) $(CFLAGS)
307
308
309 # CHECK TARGETS
310
311 check: bootstrap check-cdtest
312 installcheck:
313
314 # Rules for testing by relinking ld itself.
315
316 ld-partial.o: ld.new
317 ./ld.new -Lemulations $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
318 ld1: ld-partial.o
319 ./ld.new -Lemulations $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
320
321 ld1-full: ld.new
322 ./ld.new -Lemulations $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
323
324 ld2: ld1
325 ./ld1 -Lemulations $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
326
327 ld3: ld2
328 ./ld2 -Lemulations $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
329
330 bootstrap: ld3
331 cmp ld2 ld3
332
333 # A test program for C++ constructors and destructors.
334
335 cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new
336 ./ld.new -Lemulations $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
337 cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS)
338
339 check-cdtest: cdtest $(srcdir)/cdtest.exp
340 ./cdtest >cdtest.out
341 diff $(srcdir)/cdtest.exp cdtest.out
342
343 # DOCUMENTATION TARGETS
344 # Manual configuration file; not usually attached to normal configuration,
345 # because almost all configs use "gen" version of manual.
346 # Set DOCVER above to change.
347 configdoc.texi: ${DOCVER}-doc.texi
348 ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
349 ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
350 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
351
352 # TeX output
353 dvi: ld.dvi
354 ld.dvi: $(srcdir)/ld.texinfo
355 $(TEXI2DVI) $(srcdir)/ld.texinfo
356
357 ldint.dvi: $(srcdir)/ldint.texinfo
358 $(TEXI2DVI) $(srcdir)/ldint.texinfo
359
360 # info file for online browsing
361 ld.info: $(srcdir)/ld.texinfo configdoc.texi
362 $(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo
363
364 ldint.info: $(srcdir)/ldint.texinfo
365 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
366
367 #separate targets for "ms", "me", and "mm" forms of roff doc
368 # Try to use a recent texi2roff. v2 was put on prep in jan91.
369 # If you want an index, see texi2roff doc for postprocessing
370 # and add -i to texi2roff invocations below.
371 # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
372 # correspondint -e lines when later texi2roff's are current)
373 # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
374 # + @c's deleted explicitly because texi2roff sees texinfo commands in them
375 # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
376 # + @alphaenumerate is ridiculously new, turned into @enumerate
377
378 ld.ms: $(srcdir)/ld.texinfo
379 sed -e '/\\input texinfo/d' \
380 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
381 -e '/^@ifinfo/,/^@end ifinfo/d' \
382 -e '/^@c/d' \
383 -e 's/{.*,,/{/' \
384 -e 's/@ / /g' \
385 -e 's/^@alphaenumerate/@enumerate/g' \
386 -e 's/^@end alphaenumerate/@end enumerate/g' \
387 $(srcdir)/ld.texinfo | \
388 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
389 sed -e 's/---/\\(em/g' \
390 >>ld.ms
391
392 # index for roff output
393 ld-index.ms: ld.ms
394 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
395 sed -e '/: warning:/d' | \
396 texi2index >ld-index.ms
397
398 # roff output (-mm)
399 ld.mm: $(srcdir)/ld.texinfo
400 sed -e '/\\input texinfo/d' \
401 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
402 -e '/^@ifinfo/,/^@end ifinfo/d' \
403 -e '/^@c/d' \
404 -e 's/{.*,,/{/' \
405 -e '/@noindent/d' \
406 -e 's/@ / /g' \
407 -e 's/^@alphaenumerate/@enumerate/g' \
408 -e 's/^@end alphaenumerate/@end enumerate/g' \
409 $(srcdir)/ld.texinfo | \
410 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
411 sed -e 's/---/\\(em/g' \
412 >ld.mm
413
414 # index for roff output
415 ld-index.mm: ld.mm
416 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
417 sed -e '/: warning:/d' | \
418 texi2index >ld-index.mm
419
420 # roff output (-me)
421 ld.me: $(srcdir)/ld.texinfo
422 sed -e '/\\input texinfo/d' \
423 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
424 -e '/^@ifinfo/,/^@end ifinfo/d' \
425 -e '/^@c/d' \
426 -e 's/{.*,,/{/' \
427 -e 's/@ / /g' \
428 -e 's/^@alphaenumerate/@enumerate/g' \
429 -e 's/^@end alphaenumerate/@end enumerate/g' \
430 $(srcdir)/ld.texinfo | \
431 $(TEXI2ROFF) $(TEXI2OPT) -me | \
432 sed -e 's/---/\\(em/g' \
433 >>ld.me
434
435 # index for roff output
436 ld-index.me: ld.me
437 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
438 sed -e '/: warning:/d' | \
439 texi2index >ld-index.me
440
441
442 ldlex.o: ldlex.c ldgram.h
443 ldgram.o: ldgram.c
444 ldgram.c:ldgram.y
445 ldexp.o: ldexp.c ldgram.h
446 ldctor.o: ldctor.c ldgram.h
447 ldlang.o: ldlang.c ldgram.h
448 ldmain.o: ldmain.c ldgram.h
449 ldwrite.o: ldwrite.c ldgram.h
450 lexsup.o: lexsup.c ldgram.h
451 mri.o: mri.c ldgram.h
452 relax.o: relax.c ldgram.h
453
454 h8300.o:h8300.c
455 h8300xray.o:h8300xray.c
456 st2000.o:st2000.c
457 z8ksim.o:z8ksim.c
458
459 stage1: force
460 -mkdir stage1
461 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
462 -(cd stage1 ; ln -s $(LD_PROG) ld)
463
464 stage2: force
465 -mkdir stage2
466 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
467 -(cd stage2 ; ln -s $(LD_PROG) ld)
468
469 stage3: force
470 -mkdir stage3
471 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
472 -(cd stage3 ; ln -s $(LD_PROG) ld)
473
474 against=stage2
475
476 comparison: force
477 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
478
479 de-stage1: force
480 -(cd stage1 ; mv -f * ..)
481 -rm ld
482 -rmdir stage1
483
484 de-stage2: force
485 -(cd stage2 ; mv -f * ..)
486 -rm ld
487 -rmdir stage2
488
489 de-stage3: force
490 -(cd stage3 ; mv -f * ..)
491 -rm ld
492 -rmdir stage3
493
494 # Stuff that should be included in a distribution:
495 LDDISTSTUFF=ldgram.c ldgram.h ldlex.c
496 diststuff: $(LDDISTSTUFF)
497
498 mostlyclean:
499 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
500 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out
501 clean: mostlyclean
502 -rm -f $(LD_PROG)
503 distclean: clean
504 -rm -f Makefile config.status TAGS sysdep.h
505 realclean: distclean
506 -rm -f $(LDDISTSTUFF)
507
508 lintlog:$(SOURCES) Makefile
509 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
510 | grep -v "pointer casts may be troublesome" \
511 | grep -v "possible pointer alignment problem" \
512 | grep -v "ignore" \
513 | grep -v "conversion from long may lose accuracy" \
514 | grep -v "warning: constant argument to NOT" \
515 | grep -v "enumeration type clash, operator CAST" \
516 | grep -v "warning: constant in conditional context"\
517 | grep -v "archive\.c"
518
519
520 tags TAGS:$(SOURCES) $(HEADERS)
521 etags -t $?
522
523
524 objdump:objdump.c
525
526 .PHONY: install
527 install:
528 $(INSTALL_XFORM) ld.new $(bindir)/ld
529 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
530 for f in emulations/*; do \
531 $(INSTALL_DATA) $$f $(scriptdir)/`basename $$f` ; \
532 done
533 -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
534 rm -f $(tooldir)/bin/ld; \
535 ln $(bindir)/$$n $(tooldir)/bin/ld \
536 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld; \
537 rm -f $(tooldir)/bin/gld; \
538 ln $(tooldir)/bin/ld $(tooldir)/bin/gld; \
539
540 install-info:
541 for i in ld.info* ; do \
542 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
543 done
544
545 clean-info:
546 -rm -rf *.info*
547
548 #-----------------------------------------------------------------------------
549 # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
550 #
551 # 'VERSION' file must be present and contain a string of the form "x.y"
552 #-----------------------------------------------------------------------------
553
554 ver960.c: FORCE
555 rm -f ver960.c
556 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
557
558
559 # This target should be invoked before building a new release.
560 # 'VERSION' file must be present and contain a string of the form "x.y"
561 #
562 roll:
563 @V=`cat VERSION` ; \
564 MAJ=`sed 's/\..*//' VERSION` ; \
565 MIN=`sed 's/.*\.//' VERSION` ; \
566 V=$$MAJ.`expr $$MIN + 1` ; \
567 rm -f VERSION ; \
568 echo $$V >VERSION ; \
569 echo Version $$V
570
571
572 dep: $(LDSOURCES)
573 mkdep $(CFLAGS) $?
574
575 # Dummy target to force execution of dependent targets.
576 #
577 force:
578
579 # Target to uncomment host-specific lines in this makefile. Such lines must
580 # have the following string beginning in column 1: #__<hostname>__#
581 # Original Makefile is backed up as 'Makefile.old'.
582 #
583 # Invoke with: make make HOST=xxx
584 #
585 make:
586 -@if test $(HOST)x = x ; then \
587 echo '\aSpecify "make make HOST=???"'; \
588 exit 1; \
589 fi ; \
590 grep -s "^#The next line was generated by 'make make'" Makefile; \
591 if test $$? = 0 ; then \
592 echo "\aMakefile has already been processed with 'make make'";\
593 exit 1; \
594 fi ; \
595 mv -f Makefile Makefile.old; \
596 echo "#The next line was generated by 'make make'" >Makefile ; \
597 echo "HOST=$(HOST)" >>Makefile ; \
598 echo >>Makefile ; \
599 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
600
601 #\f
602
603 Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
604 $(SHELL) ./config.status
605
606 ### mode:fundamental ***
607 ### Local Variables: ***
608 ### page-delimiter: "^#\f" ***
609 ### End: ***
610 ### end of file
611
612
613 # IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.041575 seconds and 5 git commands to generate.