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