remove parentdir support
[deliverable/binutils-gdb.git] / ld / Makefile.in
CommitLineData
ce4d59e2 1# Makefile for the GNU linker ld (version 2)
12fa72d4 2# Copyright (C) 1989-1992 Free Software Foundation, Inc.
ce4d59e2
SC
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
eb02fd64
RP
20
21srcdir = .
22
e06ba18d
PB
23prefix = /usr/local
24
0bb95ac8 25program_transform_name =
12fa72d4
SC
26exec_prefix = $(prefix)
27bindir = $(exec_prefix)/bin
28libdir = $(exec_prefix)/lib
034351e3 29tooldir = $(exec_prefix)/$(target_alias)
e06ba18d 30datadir = $(prefix)/lib
12fa72d4 31mandir = $(prefix)/man
e06ba18d
PB
32man1dir = $(mandir)/man1
33man2dir = $(mandir)/man2
34man3dir = $(mandir)/man3
35man4dir = $(mandir)/man4
36man5dir = $(mandir)/man5
37man6dir = $(mandir)/man6
38man7dir = $(mandir)/man7
39man8dir = $(mandir)/man8
40man9dir = $(mandir)/man9
12fa72d4 41infodir = $(prefix)/info
e06ba18d
PB
42includedir = $(prefix)/include
43docdir = $(datadir)/doc
8ddef552 44scriptdir = $(datadir)/ld
e06ba18d 45
2cbe4c5f
HS
46gcclibdir = $(libdir)/gcc/$(target_alias)
47
e06ba18d
PB
48SHELL = /bin/sh
49
e0d005f2 50INSTALL = `cd $(srcdir); pwd`/../install.sh -c
e06ba18d
PB
51INSTALL_PROGRAM = $(INSTALL)
52INSTALL_DATA = $(INSTALL)
c97b9003
DZ
53INSTALL_XFORM = $(INSTALL) -t=$(program_transform_name)
54INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
55
e06ba18d
PB
56AR = ar
57AR_FLAGS = qv
77b19d3d 58CFLAGS = -g
e06ba18d 59MAKEINFO = makeinfo
2412a768 60TEXI2DVI = texi2dvi
e06ba18d 61RANLIB = ranlib
2412a768 62CC_FOR_BUILD=$(CC)
bf3acf44 63BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
2df68136 64LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
8c32cf6e 65
12fa72d4 66#version=/`./../gcc/gcc -dumpversion`
092df318 67version=
8c32cf6e 68
ee17cac9
PB
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.
917bffa7
PB
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.)
ee17cac9
PB
73# Otherwise, they are replaced with the ones given in LIB_PATH,
74# which may have the form: LIB_PATH=/lib:/usr/local/lib
75LIB_PATH =
76
2ee11735 77BASEDIR = ../..
d6e467b4 78INCLUDE = $(srcdir)/../include
8ddef552 79INCLUDES = -I. -I$(srcdir) -I../include -I$(srcdir)/../bfd -I../bfd -I$(INCLUDE)
2ee11735 80
2412a768
RP
81# What version of the manual to build
82DOCVER = gen
83
8073190b 84# Where to find texinfo.tex to format docn with TeX
8d317d2a
RP
85TEXIDIR = $(srcdir)/../texinfo/fsf
86
10a69a37 87# Whether to get roff to put indexing entries on stderr
954ac2ea
RP
88TEXI2OPT =
89# You neeed this to generate ld-index.ms (or .mm or .me)
90# TEXI2OPT = -i
8073190b 91
e06ba18d
PB
92TEXI2ROFF=texi2roff
93
8073190b
RP
94# Which roff program to use to generate index for texi2roff'd doc
95ROFF = groff
96
5cdea2ac
SC
97#stuff for self hosting (can be overridden in config file).
98HOSTING_CRT0=/lib/crt0.o
8ddef552
DM
99HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
100HOSTING_EMU=-m $(EMUL)
5cdea2ac 101
c97b9003
DZ
102C++ = g++ -fgnu-linker
103
7e5c1057 104### Host, target, and site specific Makefile fragments come in here.
63545898 105####
2ee11735 106
2ee11735
RP
107LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
108
565c93e9
DM
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
77b19d3d 116.c.o:
8ddef552 117 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $<
c97b9003 118
eb02fd64
RP
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.
e7921bd4 122LD_PROG = ld.new
f78e2569 123
eb02fd64 124# for self hosting
12fa72d4
SC
125BFDLIB=./../bfd/libbfd.a
126LIBIBERTY=./../libiberty/libiberty.a
eb02fd64 127
ab57b174 128ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
63545898 129 em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
8ddef552 130 em_h8300.o em_ebmon29k.o em_sun4.o em_gld960.o \
034351e3 131 em_m68kcoff.o em_st2000.o em_sa29200.o \
e637dcf0 132 em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
8ddef552 133 em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
1053ea99 134 em_hppaosf.o em_mipsidtl.o em_sh.o
7e5c1057 135
1053ea99 136EMULATION_OFILES=${ALL_EMULATIONS}
7e5c1057 137
119afd7b 138OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
7e5c1057 139 ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \
fc60e4f7 140 ldfile.o relax.o lderror.o ${EMULATION_OFILES}
eb02fd64 141
ce4d59e2
SC
142HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
143 ldsym.h ldctor.h ldlang.h ldexp.h \
239d28f3 144 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
eb02fd64
RP
145
146MANSOURCES=ld.tex
147
119afd7b 148LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
63545898 149 em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \
2e2bf962 150 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
fc60e4f7 151 relax.c lderror.c
eb02fd64 152
ab57b174 153GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h
7e5c1057 154GENERATED_HEADERS=ldgram.h ldemul-list.h
eb02fd64 155
cc964c6f 156LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
eb02fd64 157
2ee11735 158BFDSOURCES=../../bfd/common/*.c
eb02fd64
RP
159
160SOURCES= $(LDSOURCES) $(BFDSOURCES)
161LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
162
8ddef552 163STAGESTUFF = emulations/* $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES)
2ee11735 164
42b5c739 165all: $(LD_PROG)
e06ba18d
PB
166
167info: ld.info
2ee11735 168
4976e6ab 169ldgram.h ldgram.c: ldgram.y
5ff21fa5 170 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
31e54f5d
RP
171 mv -f y.tab.c ldgram.c
172 mv -f y.tab.h ldgram.h
cc964c6f 173
42b5c739
ILT
174
175DEF_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`
42b5c739 181
d20fb445 182ldmain.o: ldmain.c
8ddef552 183 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $<
7e5c1057 184
42b5c739 185ldemul-list.h:
7e5c1057
PB
186 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
187 for f in `echo " " ${EMULATION_OFILES} "" \
ab57b174 188 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
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} "" \
ab57b174 194 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
195 echo " &ld_$${f}_emulation, \\"; \
196 done;\
197 echo " 0") >ldemul-list.h
198
199ldemul.o: ldemul-list.h
d20fb445 200
42b5c739 201ldlex.c: ldlex.l ldgram.h
5ff21fa5
PB
202 $(LEX) -I -Cem $(srcdir)/ldlex.l
203 mv lex.yy.c ldlex.c
19b03b7a 204
ab57b174 205# These all start with em_ so 'make clean' can find them.
c61b4184 206
8ddef552
DM
207GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${tooldir}/lib ${libdir} ${host_alias} ${target_alias}
208GEN_DEPENDS=$(srcdir)/genscripts.sh
7e5c1057 209
8ddef552
DM
210em_sun4.c: $(srcdir)/emulparams/sun4.sh \
211 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
7e5c1057 212 ${GENSCRIPTS} sun4.sh
8ddef552
DM
213em_sun3.c: $(srcdir)/emulparams/sun3.sh \
214 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
7e5c1057 215 ${GENSCRIPTS} sun3.sh
8ddef552
DM
216em_go32.c: $(srcdir)/emulparams/go32.sh \
217 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
9d1fe8a4 218 ${GENSCRIPTS} go32.sh
8ddef552
DM
219em_news.c: $(srcdir)/emulparams/news.sh \
220 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
7e5c1057 221 ${GENSCRIPTS} news.sh
8ddef552
DM
222em_vax.c: $(srcdir)/emulparams/vax.sh \
223 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
034351e3 224 ${GENSCRIPTS} vax.sh
8ddef552
DM
225em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
226 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
1584d069 227 ${GENSCRIPTS} hp300bsd.sh
8ddef552
DM
228em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
229 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
63545898 230 ${GENSCRIPTS} hp3hpux.sh
8ddef552
DM
231em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \
232 $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS}
63545898 233 ${GENSCRIPTS} hppaosf.sh
8ddef552
DM
234em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \
235 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
7e5c1057 236 ${GENSCRIPTS} i386aout.sh
8ddef552
DM
237em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
238 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
7e5c1057 239 ${GENSCRIPTS} ebmon29k.sh
8ddef552
DM
240em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \
241 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
fe3e4dfc 242 ${GENSCRIPTS} sa29200.sh
8ddef552
DM
243em_a29k.c: $(srcdir)/emulparams/a29k.sh \
244 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
7e5c1057 245 ${GENSCRIPTS} a29k.sh
8ddef552
DM
246em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
247 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
7e5c1057 248 ${GENSCRIPTS} m88kbcs.sh
8ddef552
DM
249em_h8300.c: $(srcdir)/emulparams/h8300.sh \
250 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
251 ${GENSCRIPTS} h8300.sh
252em_h8500.c: $(srcdir)/emulparams/h8500.sh \
253 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
254 ${GENSCRIPTS} h8500.sh
255em_sh.c: $(srcdir)/emulparams/sh.sh \
256 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
034351e3 257 ${GENSCRIPTS} sh.sh
8ddef552
DM
258em_st2000.c: $(srcdir)/emulparams/st2000.sh \
259 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
119afd7b 260 ${GENSCRIPTS} st2000.sh
8ddef552
DM
261em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
262 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
22a78f0d 263 ${GENSCRIPTS} z8ksim.sh
8ddef552
DM
264em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \
265 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
7e5c1057 266 ${GENSCRIPTS} vanilla.sh
8ddef552
DM
267em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \
268 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
7e5c1057 269 ${GENSCRIPTS} lnk960.sh
8ddef552
DM
270em_gld960.c: $(srcdir)/emulparams/gld960.sh \
271 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
7e5c1057 272 ${GENSCRIPTS} gld960.sh
8ddef552
DM
273em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
274 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
ab57b174 275 ${GENSCRIPTS} m68kcoff.sh
8ddef552
DM
276em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \
277 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
99e6298a 278 ${GENSCRIPTS} i386coff.sh
8ddef552
DM
279em_mipslit.c: $(srcdir)/emulparams/mipslit.sh \
280 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
42b5c739 281 ${GENSCRIPTS} mipslit.sh
8ddef552
DM
282em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
283 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
e637dcf0 284 ${GENSCRIPTS} i386bsd.sh
8ddef552
DM
285em_mipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
286 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
e637dcf0 287 ${GENSCRIPTS} mipsbig.sh
8ddef552
DM
288em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
289 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
e637dcf0 290 ${GENSCRIPTS} mipsbsd.sh
8ddef552
DM
291em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
292 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
ce7d4b0d 293 ${GENSCRIPTS} mipsidt.sh
8ddef552
DM
294em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
295 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
98f3d1af 296 ${GENSCRIPTS} mipsidtl.sh
eb02fd64 297
e77463a1 298$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
8ddef552
DM
299 $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) $(CFLAGS)
300
301
302# CHECK TARGETS
303
304check: bootstrap check-cdtest
305installcheck:
e7921bd4 306
7e5c1057 307# Rules for testing by relinking ld itself.
eb02fd64 308
7e5c1057 309ld-partial.o: ld.new
8ddef552 310 ./ld.new -Lemulations $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
7e5c1057 311ld1: ld-partial.o
8ddef552 312 ./ld.new -Lemulations $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 313
7e5c1057 314ld1-full: ld.new
8ddef552 315 ./ld.new -Lemulations $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 316
d20fb445 317ld2: ld1
8ddef552 318 ./ld1 -Lemulations $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
60048a2c 319
eb02fd64 320ld3: ld2
8ddef552 321 ./ld2 -Lemulations $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 322
d20fb445
SC
323bootstrap: ld3
324 cmp ld2 ld3
325
8ddef552
DM
326# A test program for C++ constructors and destructors.
327
ef868186 328cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new
8ddef552 329 ./ld.new -Lemulations $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
917bffa7
PB
330 cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS)
331
332check-cdtest: cdtest $(srcdir)/cdtest.exp
333 ./cdtest >cdtest.out
334 diff $(srcdir)/cdtest.exp cdtest.out
335
8073190b 336# DOCUMENTATION TARGETS
2412a768
RP
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.
340configdoc.texi: ${DOCVER}-doc.texi
034351e3
PB
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
2412a768 344
8073190b 345# TeX output
2412a768 346dvi: ld.dvi
9c7810d6 347ld.dvi: $(srcdir)/ld.texinfo
2412a768
RP
348 $(TEXI2DVI) $(srcdir)/ld.texinfo
349
4b91c519 350ldint.dvi: $(srcdir)/ldint.texinfo
2412a768 351 $(TEXI2DVI) $(srcdir)/ldint.texinfo
8d317d2a 352
8073190b 353# info file for online browsing
2412a768 354ld.info: $(srcdir)/ld.texinfo configdoc.texi
e06ba18d 355 $(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo
eb02fd64 356
4b91c519
PB
357ldint.info: $(srcdir)/ldint.texinfo
358 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
359
954ac2ea 360#separate targets for "ms", "me", and "mm" forms of roff doc
e06ba18d
PB
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
9c7810d6 371ld.ms: $(srcdir)/ld.texinfo
8073190b
RP
372 sed -e '/\\input texinfo/d' \
373 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
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' \
9c7810d6 380 $(srcdir)/ld.texinfo | \
e06ba18d
PB
381 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
382 sed -e 's/---/\\(em/g' \
383 >>ld.ms
8073190b
RP
384
385# index for roff output
386ld-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
954ac2ea 391# roff output (-mm)
9c7810d6 392ld.mm: $(srcdir)/ld.texinfo
954ac2ea
RP
393 sed -e '/\\input texinfo/d' \
394 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
395 -e '/^@ifinfo/,/^@end ifinfo/d' \
396 -e '/^@c/d' \
9c7810d6
RP
397 -e 's/{.*,,/{/' \
398 -e '/@noindent/d' \
e06ba18d
PB
399 -e 's/@ / /g' \
400 -e 's/^@alphaenumerate/@enumerate/g' \
401 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 402 $(srcdir)/ld.texinfo | \
e06ba18d 403 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
9c7810d6
RP
404 sed -e 's/---/\\(em/g' \
405 >ld.mm
954ac2ea
RP
406
407# index for roff output
408ld-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)
9c7810d6 414ld.me: $(srcdir)/ld.texinfo
954ac2ea
RP
415 sed -e '/\\input texinfo/d' \
416 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
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' \
9c7810d6 423 $(srcdir)/ld.texinfo | \
e06ba18d
PB
424 $(TEXI2ROFF) $(TEXI2OPT) -me | \
425 sed -e 's/---/\\(em/g' \
426 >>ld.me
954ac2ea
RP
427
428# index for roff output
429ld-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
cc964c6f
SC
435ldlex.o: ldlex.c ldgram.h
436ldgram.o: ldgram.c
437ldgram.c:ldgram.y
42b5c739
ILT
438ldexp.o: ldexp.c ldgram.h
439ldctor.o: ldctor.c ldgram.h
440ldlang.o: ldlang.c ldgram.h
441ldmain.o: ldmain.c ldgram.h
442ldwrite.o: ldwrite.c ldgram.h
443lexsup.o: lexsup.c ldgram.h
444mri.o: mri.c ldgram.h
445relax.o: relax.c ldgram.h
eb02fd64 446
8ddef552 447h8300.o:h8300.c
9d1fe8a4 448h8300xray.o:h8300xray.c
119afd7b 449st2000.o:st2000.c
22a78f0d 450z8ksim.o:z8ksim.c
565a4c76 451
e7921bd4 452stage1: force
e06ba18d 453 -mkdir stage1
ab57b174 454 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
e06ba18d 455 -(cd stage1 ; ln -s $(LD_PROG) ld)
f78e2569 456
e7921bd4 457stage2: force
e06ba18d 458 -mkdir stage2
ab57b174 459 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
e06ba18d 460 -(cd stage2 ; ln -s $(LD_PROG) ld)
f78e2569 461
e7921bd4 462stage3: force
e06ba18d 463 -mkdir stage3
ab57b174 464 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
e06ba18d 465 -(cd stage3 ; ln -s $(LD_PROG) ld)
eb02fd64 466
e46cdcdd
RP
467against=stage2
468
469comparison: force
ab57b174 470 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
e46cdcdd 471
e7921bd4 472de-stage1: force
e06ba18d
PB
473 -(cd stage1 ; mv -f * ..)
474 -rm ld
475 -rmdir stage1
e7921bd4
RP
476
477de-stage2: force
e06ba18d
PB
478 -(cd stage2 ; mv -f * ..)
479 -rm ld
480 -rmdir stage2
e7921bd4
RP
481
482de-stage3: force
e06ba18d
PB
483 -(cd stage3 ; mv -f * ..)
484 -rm ld
485 -rmdir stage3
e7921bd4 486
ab57b174 487# Stuff that should be included in a distribution:
63545898 488LDDISTSTUFF=ldgram.c ldgram.h ldlex.c
ab57b174
ILT
489diststuff: $(LDDISTSTUFF)
490
491mostlyclean:
492 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
917bffa7 493 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out
ab57b174
ILT
494clean: mostlyclean
495 -rm -f $(LD_PROG)
496distclean: clean
42b5c739 497 -rm -f Makefile config.status TAGS sysdep.h
ab57b174
ILT
498realclean: distclean
499 -rm -f $(LDDISTSTUFF)
eb02fd64
RP
500
501lintlog:$(SOURCES) Makefile
2ee11735 502 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
eb02fd64
RP
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
513tags TAGS:$(SOURCES) $(HEADERS)
19b03b7a 514 etags -t $?
eb02fd64 515
eb02fd64
RP
516
517objdump:objdump.c
518
12fa72d4 519.PHONY: install
91b3a2b6 520install:
8ddef552
DM
521 $(INSTALL_XFORM) ld.new $(bindir)/ld
522 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
523 cd emulations; for f in *; do $(INSTALL_DATA) $$f $(scriptdir)/$$f; done
0bb95ac8 524 -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
56409445
ILT
525 rm -f $(tooldir)/bin/ld; \
526 ln $(bindir)/$$n $(tooldir)/bin/ld \
527 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld; \
af6237a4 528 rm -f $(tooldir)/bin/gld; \
42b5c739 529 ln $(tooldir)/bin/ld $(tooldir)/bin/gld; \
e06ba18d 530
91b3a2b6 531install-info:
afe3aa73 532 for i in ld.info* ; do \
e06ba18d 533 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
afe3aa73
RP
534 done
535
12fa72d4
SC
536clean-info:
537 -rm -rf *.info*
538
eb02fd64
RP
539#-----------------------------------------------------------------------------
540# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
541#
542# 'VERSION' file must be present and contain a string of the form "x.y"
543#-----------------------------------------------------------------------------
544
545ver960.c: FORCE
546 rm -f ver960.c
547 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
548
549
550# This target should be invoked before building a new release.
551# 'VERSION' file must be present and contain a string of the form "x.y"
552#
553roll:
554 @V=`cat VERSION` ; \
555 MAJ=`sed 's/\..*//' VERSION` ; \
556 MIN=`sed 's/.*\.//' VERSION` ; \
557 V=$$MAJ.`expr $$MIN + 1` ; \
558 rm -f VERSION ; \
559 echo $$V >VERSION ; \
560 echo Version $$V
561
239d28f3 562
e1e5fbfc 563dep: $(LDSOURCES)
239d28f3
SC
564 mkdep $(CFLAGS) $?
565
eb02fd64
RP
566# Dummy target to force execution of dependent targets.
567#
e7921bd4 568force:
eb02fd64
RP
569
570# Target to uncomment host-specific lines in this makefile. Such lines must
571# have the following string beginning in column 1: #__<hostname>__#
572# Original Makefile is backed up as 'Makefile.old'.
573#
574# Invoke with: make make HOST=xxx
575#
576make:
577 -@if test $(HOST)x = x ; then \
578 echo '\aSpecify "make make HOST=???"'; \
579 exit 1; \
580 fi ; \
581 grep -s "^#The next line was generated by 'make make'" Makefile; \
582 if test $$? = 0 ; then \
583 echo "\aMakefile has already been processed with 'make make'";\
584 exit 1; \
585 fi ; \
586 mv -f Makefile Makefile.old; \
587 echo "#The next line was generated by 'make make'" >Makefile ; \
588 echo "HOST=$(HOST)" >>Makefile ; \
589 echo >>Makefile ; \
590 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
591
592#\f
593
f1eb48b6 594Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 595 $(SHELL) ./config.status
eb02fd64 596
eb02fd64 597### mode:fundamental ***
e06ba18d 598### Local Variables: ***
eb02fd64
RP
599### page-delimiter: "^#\f" ***
600### End: ***
601### end of file
239d28f3
SC
602
603
604# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.116073 seconds and 4 git commands to generate.