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