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