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