Distribute lpsrc.sed, remove rc-*.
[deliverable/binutils-gdb.git] / ld / Makefile.in
CommitLineData
ce4d59e2
SC
1# Makefile for the GNU linker ld (version 2)
2# Copyright (C) 1989-1991 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
eb02fd64
RP
20
21srcdir = .
22
e06ba18d
PB
23prefix = /usr/local
24
25bindir = $(prefix)/bin
26datadir = $(prefix)/lib
27libdir = $(prefix)/lib
28mandir = $(datadir)/man
29man1dir = $(mandir)/man1
30man2dir = $(mandir)/man2
31man3dir = $(mandir)/man3
32man4dir = $(mandir)/man4
33man5dir = $(mandir)/man5
34man6dir = $(mandir)/man6
35man7dir = $(mandir)/man7
36man8dir = $(mandir)/man8
37man9dir = $(mandir)/man9
2cbe4c5f 38infodir = $(datadir)/info
e06ba18d
PB
39includedir = $(prefix)/include
40docdir = $(datadir)/doc
41
2cbe4c5f
HS
42gcclibdir = $(libdir)/gcc/$(target_alias)
43
e06ba18d
PB
44SHELL = /bin/sh
45
46INSTALL = install -c
47INSTALL_PROGRAM = $(INSTALL)
48INSTALL_DATA = $(INSTALL)
49
50AR = ar
51AR_FLAGS = qv
52BISON = bison -y
53MAKEINFO = makeinfo
54RANLIB = ranlib
8c32cf6e 55
092df318
SC
56#version=/`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion`
57version=
8c32cf6e 58
ee17cac9
PB
59# Seach path to override the default search path for -lfoo libraries.
60# If LIB_PATH is empty, the ones in the script (if any) are left alone.
61# Otherwise, they are replaced with the ones given in LIB_PATH,
62# which may have the form: LIB_PATH=/lib:/usr/local/lib
63LIB_PATH =
64
2ee11735 65BASEDIR = ../..
d6e467b4 66INCLUDE = $(srcdir)/../include
2ee11735 67INCLUDES = -I. -I$(srcdir) -I$(INCLUDE)
550e87b5 68MINUS_G = -g
2ee11735 69
8073190b 70# Where to find texinfo.tex to format docn with TeX
8d317d2a
RP
71TEXIDIR = $(srcdir)/../texinfo/fsf
72
10a69a37 73# Whether to get roff to put indexing entries on stderr
954ac2ea
RP
74TEXI2OPT =
75# You neeed this to generate ld-index.ms (or .mm or .me)
76# TEXI2OPT = -i
8073190b 77
e06ba18d
PB
78TEXI2ROFF=texi2roff
79
8073190b
RP
80# Which roff program to use to generate index for texi2roff'd doc
81ROFF = groff
82
e1e5fbfc
PB
83SCRIPTS = ldgld68k.sc ldgld.sc \
84 ldlnk960.sc ldlnk960r.sc ldgld960.sc \
ce4d59e2 85 i386aout.sc ldm88k.sc ldglda29k.sc news.sc h8300hds.sc ebmon29k.sc
2ee11735 86
e06ba18d 87#### Host, target, and site specific Makefile fragments come in here.
2ee11735
RP
88###
89
550e87b5 90CFLAGS = $(INCLUDES) $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CDEFINES)
2ee11735
RP
91LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
92
972e7b4b 93.SUFFIXES: .y .x .xr .xu .xn .xN .sc .scu .scr .scn $(SUFFIXES)
2ee11735 94
eb02fd64
RP
95# go directly to ld.new in case this ld isn't capable of
96# linking native object on this host. It can be renamed on
97# install.
e7921bd4 98LD_PROG = ld.new
f78e2569 99
e1e5fbfc
PB
100# A .sc script file is needed for each emulation mode.
101# sed is used to transform this script into two variant forms:
102# A .scr script is for linking without relocation (-r flag).
103# A .scu script is like .scr, but *do* create constructors.
972e7b4b
PB
104# A .scn script is for linking with -N flag (mix text and data on same page).
105# A .scN script is for linking with -N flag (mix text and data on same page).
b7e24eef 106# The diference is that segments should (need) not be page aligned.
e1e5fbfc
PB
107
108# A sed pattern to translate .sc to .scu:
109SED_MAKE_RELOC_WITH_CONSTRUCTORS=\
110 -e "/If relocating/,/End if relocating/d" \
6719c75b
PB
111 -e "/=/s/[_a-zA-Z.]* *= .*//g" \
112 -e '/>/s/} *> *[a-zA-Z]*/}/' \
e1e5fbfc
PB
113 -e "/text/s/[.]text .*:/.text :/" \
114 -e "/data/s/[.]data .*:/.data :/"
115# A sed pattern to translate .scu to .scr:
116SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d
117
118.sc.scu:
119 sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $< >$*.scu
120.scu.scr:
121 sed $(SED_REMOVE_CONSTRUCTORS) < $< >$*.scr
122
972e7b4b
PB
123# Each builtin script file is included as a C string literal.
124# These are generated by the mkscript filter.
30104b16 125.sc.x:
ee17cac9
PB
126 if [ "x"$(LIB_PATH) = "x" ]; then ./mkscript < $< >$*.x ; \
127 else \
128 (sed <$< -e '/SEARCH_DIR(.*)/d' ; \
129 echo $(LIB_PATH) | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g';) | ./mkscript >$*.x;\
130 fi
972e7b4b
PB
131
132# The .xn script is used if the -n flag is given (write-protect text)..
133# Sunos starts the text segment for demand-paged binaries at 0x2020
134# and other binaries at 0x2000, since the exec header is paged in
135# with the text. Some other Unix variants do the same.
136# For -n and -N flags the offset of the exec header must be removed.
137# This sed script does this if the master script contains
138# a line of the form ".text 0xAAAA BLOCK(0xBBBB):" - the
139# output will contain ".text 0xBBBB:". (For Sunos AAAA=2020 and BBBB=2000.)
140.x.xn:
141 sed -e '/text/s/\.text .* BLOCK(\([^)]*\)):/.text \1:/' < $< >$*.xn
142
143# The .xN script is used if the -N flag is given (don't write-protect text).
144# This is like -n, except that the data segment need not be page-aligned.
145# So get rid of commands for page-alignment: We assume these use ALIGN
146# with a hex constant that end with 00, since any normal page size is be
147# at least divisible by 256. We use the 00 to avoid matching
148# anything that tries to align of (say) 8-byte boundaries.
149.xn.xN:
150 sed -e '/ALIGN/s/ALIGN( *0x[0-9a-fA-F]*00 *)/./' < $< >$*.xN
151
152# The xu and xr scripts don't search libraries, so LIB_PATH doesn't matter.
e1e5fbfc
PB
153.sc.xu:
154 sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) < $< | ./mkscript >$*.xu
155.sc.xr:
156 sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $(SED_REMOVE_CONSTRUCTORS) \
157 < $< | ./mkscript >$*.xr
eb02fd64
RP
158
159# for self hosting
e45bef1e
RP
160BFDLIB=$(unsubdir)/../bfd$(subdir)/libbfd.a
161LIBIBERTY=$(unsubdir)/../libiberty$(subdir)/libiberty.a
eb02fd64 162
cbbdbb9f 163OFILES= ldgram.o ldlex.o lexsup.o ldlang.o ldctor.o ldmain.o ldindr.o \
c61b4184
PB
164 ldwarn.o ldwrite.o ldexp.o ldlnk960.o ld__gld68k.o ld__i386aout.o \
165 ld__m88k.o ld__glda29k.o ld__news.o h8300hds.o ld__ebmon29k.o \
2e2bf962
SC
166 ld__gld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o \
167 ldvanilla.o ldfile.o \
168 relax.o lderror.o
eb02fd64 169
ce4d59e2
SC
170HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
171 ldsym.h ldctor.h ldlang.h ldexp.h \
239d28f3 172 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
eb02fd64
RP
173
174MANSOURCES=ld.tex
175
cbbdbb9f 176LDCSOURCES=ldlang.c lexsup.c ldctor.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
c61b4184 177 ld__gld.c ld__gld68k.c ld__m88k.c ld__ebmon29k.c \
2e2bf962
SC
178 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
179 ldvanilla.c relax.c lderror.c
eb02fd64 180
c61b4184 181GENERATED_SOURCES=ldgram.c ldlex.c ldgram.h ld__*.c
cc964c6f 182GENERATED_HEADERS=ldgram.h
eb02fd64 183
cc964c6f 184LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
eb02fd64 185
2ee11735 186BFDSOURCES=../../bfd/common/*.c
eb02fd64
RP
187
188SOURCES= $(LDSOURCES) $(BFDSOURCES)
189LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
190
e1e5fbfc 191STAGESTUFF = *.x *.x[ru] *.sc[ru] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) $(LD_PROG) mkscript
2ee11735 192
e06ba18d
PB
193all: Makefile $(LD_PROG)
194
195info: ld.info
2ee11735 196
4976e6ab 197ldgram.h ldgram.c: ldgram.y
31e54f5d
RP
198 $(BISON) $(BISONFLAGS) -d $(VPATH)/ldgram.y
199 mv -f y.tab.c ldgram.c
200 mv -f y.tab.h ldgram.h
cc964c6f 201
4976e6ab 202ldlex.c: ldlex.l
cbbdbb9f
SC
203 /lib/cpp -E -P $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(VPATH)/ldlex.l >ldlex.p
204 lex -t ldlex.p >ldlex.q
205 sed -e "s/define input/define old_input/" \
206 -e "s/define unput/define old_unput/" \
207 -e "s/input/lex_input/" \
208 -e "s/unput/lex_unput/" <ldlex.q >ldlex.c
209
19b03b7a 210
c61b4184
PB
211# These all start with ld__ so 'make clean' can find them.
212
213ld__gld.c: $(srcdir)/ldtemplate
e1e5fbfc 214 sed -e s/"<ldtarget>"/ldgld/g -e s/"<arch>"/m68k/g \
33ce0085 215 -e s/"<target>"//g -e s/"<TARGET>"//g <$(srcdir)/ldtemplate >$@
c61b4184 216ld__news.c: $(srcdir)/ldtemplate
e1e5fbfc 217 sed -e s/"<ldtarget>"/news/g -e s/"<arch>"/m68k/g \
33ce0085 218 -e s/"<target>"/news/g -e s/"<TARGET>"/NEWS/g <$(srcdir)/ldtemplate >$@
565a4c76 219
c61b4184 220ld__i386aout.c: $(srcdir)/ldtemplate
ce4d59e2
SC
221 sed -e s/"<ldtarget>"/i386aout/g -e s/"<arch>"/i386/g \
222 -e s/"<target>"/i386aout/g -e s/"<TARGET>"/I386AOUT/g <$(srcdir)/ldtemplate >$@
223
224
c61b4184 225ld__ebmon29k.c: $(srcdir)/ldtemplate
565a4c76
SC
226 sed -e s/"<ldtarget>"/ebmon29k/g -e s/"<arch>"/a29k/g \
227 -e s/"gld<target>"/ebmon29k/g -e s/"GLD<TARGET>"/EBMON29K/g \
33ce0085 228 -e s/"<ldtarget>.x"/ebmon.x/ <$(srcdir)/ldtemplate >$@
565a4c76 229
c61b4184 230ld__gld68k.c: $(srcdir)/ldtemplate
e1e5fbfc 231 sed -e s/"<ldtarget>"/ldgld68k/g -e s/"<arch>"/m68k/g \
33ce0085 232 -e s/"<target>"/68k/g -e s/"<TARGET>"/68K/g <$(srcdir)/ldtemplate >$@
c61b4184 233ld__glda29k.c: $(srcdir)/ldtemplate
e1e5fbfc 234 sed -e s/"<ldtarget>"/ldglda29k/g -e s/"<arch>"/a29k/g \
33ce0085 235 -e s/"<target>"/29k/g -e s/"<TARGET>"/29K/g <$(srcdir)/ldtemplate >$@
c61b4184 236ld__m88k.c: $(srcdir)/ldtemplate
e1e5fbfc 237 sed -e s/"<ldtarget>"/ldm88k/g -e s/"<arch>"/m88k/g \
33ce0085 238 -e s/"<target>"/m88kbcs/g -e s/"<TARGET>"/M88KBCS/g <$(srcdir)/ldtemplate >$@
e1e5fbfc
PB
239
240# The .c files for these are generated from ldtemplete.
c61b4184
PB
241ld__gld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu ldgld.xn ldgld.xN
242ld__news.o: ./mkscript news.x news.xr news.xu news.xn news.xN
243ld__i386aout.o: ./mkscript i386aout.x i386aout.xr i386aout.xu i386aout.xn i386aout.xN
244ld__ebmon29k.o: ./mkscript ebmon29k.x ebmon29k.xr ebmon29k.xu \
972e7b4b 245 ebmon29k.xn ebmon29k.xN
c61b4184 246ld__gld68k.o: ./mkscript ldgld68k.x ldgld68k.xr ldgld68k.xu \
972e7b4b 247 ldgld68k.xn ldgld68k.xN
c61b4184 248ld__glda29k.o: ./mkscript ldglda29k.x ldglda29k.xr ldglda29k.xu \
972e7b4b 249 ldglda29k.xn ldglda29k.xN
c61b4184 250ld__m88k.o: ./mkscript ldm88k.x ldm88k.xr ldm88k.xu ldm88k.xn ldm88k.xN
e1e5fbfc
PB
251
252# The .c files for these are (for now) specially written (not ldtemplete).
253ldgld960.o: ./mkscript ldgld960.x
254ldlnk960.o: ./mkscript ldlnk960.x ldlnk960.xr
bee36ac3 255h8300hds.o: ./mkscript h8300hds.x
e1e5fbfc 256
2ee11735
RP
257
258#$(BFDLIB): $(BFDSOURCES)
259# (cd ../bfd; make)
eb02fd64 260
e77463a1 261$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
fe9c20e2 262 $(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
e7921bd4 263
eb02fd64 264# (cd ../bfd; make)
239d28f3 265# LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-sunos-big;./ldok -format a.out-sunos-big -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
e77463a1
JG
266# gld -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib
267# $(CC) -Bstatic -o ld.new $(OFILES) $(BFDLIB) $(LIBIBERTY)
eb02fd64
RP
268
269
f78e2569 270ld1: ld.new
e77463a1 271 $(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64
RP
272
273ld2: ld1
2e2bf962
SC
274 #try and make life a bit harder
275 $(HOSTING_EMU); ./ld1 -o foo.o -r $(OFILES)
276 $(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) foo.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 277
60048a2c
RP
278bootstrap: ld3
279 cmp ld2 ld3
280
eb02fd64 281ld3: ld2
e77463a1 282 $(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 283
8073190b
RP
284######################################################################
285# DOCUMENTATION TARGETS
286# TeX output
9c7810d6
RP
287ld.dvi: $(srcdir)/ld.texinfo
288 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo
8d317d2a 289 texindex ld.??
9c7810d6 290 TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo
8d317d2a 291
8073190b 292# info file for online browsing
9c7810d6 293ld.info: $(srcdir)/ld.texinfo
e06ba18d 294 $(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo
eb02fd64 295
954ac2ea 296#separate targets for "ms", "me", and "mm" forms of roff doc
e06ba18d
PB
297# Try to use a recent texi2roff. v2 was put on prep in jan91.
298# If you want an index, see texi2roff doc for postprocessing
299# and add -i to texi2roff invocations below.
300# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
301# correspondint -e lines when later texi2roff's are current)
302# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
303# + @c's deleted explicitly because texi2roff sees texinfo commands in them
304# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
305# + @alphaenumerate is ridiculously new, turned into @enumerate
306
9c7810d6 307ld.ms: $(srcdir)/ld.texinfo
8073190b
RP
308 sed -e '/\\input texinfo/d' \
309 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
310 -e '/^@ifinfo/,/^@end ifinfo/d' \
311 -e '/^@c/d' \
312 -e 's/{.*,,/{/' \
313 -e 's/@ / /g' \
314 -e 's/^@alphaenumerate/@enumerate/g' \
315 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 316 $(srcdir)/ld.texinfo | \
e06ba18d
PB
317 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
318 sed -e 's/---/\\(em/g' \
319 >>ld.ms
8073190b
RP
320
321# index for roff output
322ld-index.ms: ld.ms
323 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
324 sed -e '/: warning:/d' | \
325 texi2index >ld-index.ms
326
954ac2ea 327# roff output (-mm)
9c7810d6 328ld.mm: $(srcdir)/ld.texinfo
954ac2ea
RP
329 sed -e '/\\input texinfo/d' \
330 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
331 -e '/^@ifinfo/,/^@end ifinfo/d' \
332 -e '/^@c/d' \
9c7810d6
RP
333 -e 's/{.*,,/{/' \
334 -e '/@noindent/d' \
e06ba18d
PB
335 -e 's/@ / /g' \
336 -e 's/^@alphaenumerate/@enumerate/g' \
337 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 338 $(srcdir)/ld.texinfo | \
e06ba18d 339 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
9c7810d6
RP
340 sed -e 's/---/\\(em/g' \
341 >ld.mm
954ac2ea
RP
342
343# index for roff output
344ld-index.mm: ld.mm
345 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
346 sed -e '/: warning:/d' | \
347 texi2index >ld-index.mm
348
349# roff output (-me)
9c7810d6 350ld.me: $(srcdir)/ld.texinfo
954ac2ea
RP
351 sed -e '/\\input texinfo/d' \
352 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
353 -e '/^@ifinfo/,/^@end ifinfo/d' \
354 -e '/^@c/d' \
355 -e 's/{.*,,/{/' \
356 -e 's/@ / /g' \
357 -e 's/^@alphaenumerate/@enumerate/g' \
358 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 359 $(srcdir)/ld.texinfo | \
e06ba18d
PB
360 $(TEXI2ROFF) $(TEXI2OPT) -me | \
361 sed -e 's/---/\\(em/g' \
362 >>ld.me
954ac2ea
RP
363
364# index for roff output
365ld-index.me: ld.me
366 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
367 sed -e '/: warning:/d' | \
368 texi2index >ld-index.me
369
370
8073190b
RP
371######################################################################
372
e0220a5b 373mkscript: $(srcdir)/mkscript.c
30104b16 374 $(CC) $(CFLAGS) $(LDFLAGS) -o mkscript $(srcdir)/mkscript.c $(LOADLIBES)
f78e2569 375
cc964c6f
SC
376ldlex.c: ldlex.l ldgram.h
377ldlex.o: ldlex.c ldgram.h
378ldgram.o: ldgram.c
379ldgram.c:ldgram.y
eb02fd64 380
30104b16
SC
381ldgld68k.x :ldgld68k.sc
382ldgld68kUr.x :ldgld68kUr.sc
383ldgld68kr.x :ldgld68kr.sc
bee36ac3 384h8300hds.x:h8300hds.sc
30104b16
SC
385ldgld.x :ldgld.sc
386ldgldUr.x :ldgldUr.sc
387ldgldr.x :ldgldr.sc
388ldlnk960.x :ldlnk960.sc
389ldlnk960r.x :ldlnk960r.sc
390ldgld960.x :ldgld960.sc
1e332873
SC
391ldgldm88k.x :ldgldm88k.sc
392ldm88kUr.x :ldm88kUr.sc
393ldm88kr.x:ldm88kr.sc
33ce0085
JG
394ldm88k.x:ldm88k.sc
395news.x:news.sc
ce4d59e2 396i386aout.x:i386aout.sc
33ce0085
JG
397h8300hds.x:h8300hds.sc
398h8300hds.o:h8300hds.c
30104b16
SC
399ldgld68k.x:ldgld68k.sc
400ldglda29k.x :ldglda29k.sc
401ldglda29kr.x :ldglda29kr.sc
402ldglda29kUr.x :ldglda29kUr.sc
eb02fd64 403
565a4c76
SC
404ebmon29k.x :ebmon29k.sc
405ebmon29kr.x :ebmon29kr.sc
406ebmon29kUr.x :ebmon29kUr.sc
407
e7921bd4 408stage1: force
e06ba18d
PB
409 -mkdir stage1
410 -mv -f $(STAGESTUFF) stage1
411 -(cd stage1 ; ln -s $(LD_PROG) ld)
f78e2569 412
e7921bd4 413stage2: force
e06ba18d
PB
414 -mkdir stage2
415 -mv -f $(STAGESTUFF) stage2
416 -(cd stage2 ; ln -s $(LD_PROG) ld)
f78e2569 417
e7921bd4 418stage3: force
e06ba18d
PB
419 -mkdir stage3
420 -mv -f $(STAGESTUFF) stage3
421 -(cd stage3 ; ln -s $(LD_PROG) ld)
eb02fd64 422
e46cdcdd
RP
423against=stage2
424
425comparison: force
426 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
427
e7921bd4 428de-stage1: force
e06ba18d
PB
429 -(cd stage1 ; mv -f * ..)
430 -rm ld
431 -rmdir stage1
e7921bd4
RP
432
433de-stage2: force
e06ba18d
PB
434 -(cd stage2 ; mv -f * ..)
435 -rm ld
436 -rmdir stage2
e7921bd4
RP
437
438de-stage3: force
e06ba18d
PB
439 -(cd stage3 ; mv -f * ..)
440 -rm ld
441 -rmdir stage3
e7921bd4
RP
442
443clean:
e06ba18d
PB
444 -rm -f TAGS $(OFILES) $(GENERATED_SOURCES) $(GENERATED_HEADERS)
445 -rm -f *.x *.x[runN] *.sc[runN]
446 -rm -f ld.?? ld.???
447 -rm -f ld ld1 ld2 ld3 ld.new mkscript *.o y.output
eb02fd64
RP
448
449lintlog:$(SOURCES) Makefile
2ee11735 450 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
eb02fd64
RP
451| grep -v "pointer casts may be troublesome" \
452| grep -v "possible pointer alignment problem" \
453| grep -v "ignore" \
454| grep -v "conversion from long may lose accuracy" \
455| grep -v "warning: constant argument to NOT" \
456| grep -v "enumeration type clash, operator CAST" \
457| grep -v "warning: constant in conditional context"\
458| grep -v "archive\.c"
459
460
461tags TAGS:$(SOURCES) $(HEADERS)
19b03b7a 462 etags -t $?
eb02fd64 463
eb02fd64
RP
464
465objdump:objdump.c
466
e7921bd4 467install: $(LD_PROG)
e06ba18d 468 $(INSTALL_PROGRAM) ld.new $(bindir)/ld
2cbe4c5f
HS
469 -if [ -d "$(gcclibdir)" ] ; then \
470 $(INSTALL_PROGRAM) ld.new $(gcclibdir)/ld ; \
471 fi
e06ba18d
PB
472
473install-info: info
afe3aa73 474 for i in ld.info* ; do \
e06ba18d 475 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
afe3aa73
RP
476 done
477
ce4d59e2
SC
478# Something like the following might make sense for install, but doesn't work
479# - it is too fragile, depending on a gcc binary int the right place.
480# Perhaps using gcc/version.c might work?
481# # If $(gcclibdir) exists, install ld there, and put a link to it
482# # from $(bindir); otherwise put ld in $(bindir).
483# if ([ -x $(unsubdir)/../gcc$(subdir)/gcc -a -d $(gcclibdir) ]); then \
484# $(INSTALL_PROGRAM) ld.new $(gcclibdir)/ld; \
485# cd $(bindir); rm -f ld; ln -s $(gcclibdir)/ld ld; \
486# else \
487# $(INSTALL_PROGRAM) ld.new $(bindir)/ld; \
488# fi
eb02fd64
RP
489
490#-----------------------------------------------------------------------------
491# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
492#
493# 'VERSION' file must be present and contain a string of the form "x.y"
494#-----------------------------------------------------------------------------
495
496ver960.c: FORCE
497 rm -f ver960.c
498 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
499
500
501# This target should be invoked before building a new release.
502# 'VERSION' file must be present and contain a string of the form "x.y"
503#
504roll:
505 @V=`cat VERSION` ; \
506 MAJ=`sed 's/\..*//' VERSION` ; \
507 MIN=`sed 's/.*\.//' VERSION` ; \
508 V=$$MAJ.`expr $$MIN + 1` ; \
509 rm -f VERSION ; \
510 echo $$V >VERSION ; \
511 echo Version $$V
512
239d28f3 513
e1e5fbfc 514dep: $(LDSOURCES)
239d28f3
SC
515 mkdep $(CFLAGS) $?
516
eb02fd64
RP
517# Dummy target to force execution of dependent targets.
518#
e7921bd4 519force:
eb02fd64
RP
520
521# Target to uncomment host-specific lines in this makefile. Such lines must
522# have the following string beginning in column 1: #__<hostname>__#
523# Original Makefile is backed up as 'Makefile.old'.
524#
525# Invoke with: make make HOST=xxx
526#
527make:
528 -@if test $(HOST)x = x ; then \
529 echo '\aSpecify "make make HOST=???"'; \
530 exit 1; \
531 fi ; \
532 grep -s "^#The next line was generated by 'make make'" Makefile; \
533 if test $$? = 0 ; then \
534 echo "\aMakefile has already been processed with 'make make'";\
535 exit 1; \
536 fi ; \
537 mv -f Makefile Makefile.old; \
538 echo "#The next line was generated by 'make make'" >Makefile ; \
539 echo "HOST=$(HOST)" >>Makefile ; \
540 echo >>Makefile ; \
541 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
542
543#\f
544
f1eb48b6 545Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 546 $(SHELL) ./config.status
eb02fd64 547
eb02fd64 548### mode:fundamental ***
e06ba18d 549### Local Variables: ***
eb02fd64
RP
550### page-delimiter: "^#\f" ***
551### End: ***
552### end of file
239d28f3
SC
553
554
555# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.075195 seconds and 4 git commands to generate.