add ld-versados.
[deliverable/binutils-gdb.git] / ld / Makefile.in
CommitLineData
ce4d59e2 1# Makefile for the GNU linker ld (version 2)
74e6b793 2# Copyright (C) 1989, 90, 91, 92, 93, 1994 Free Software Foundation, Inc.
ce4d59e2 3
d4e5e3c3 4# This file is part of GNU ld.
ce4d59e2
SC
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 = .
3a9149a7 22objdir = .
eb02fd64 23
e06ba18d
PB
24prefix = /usr/local
25
0bb95ac8 26program_transform_name =
12fa72d4
SC
27exec_prefix = $(prefix)
28bindir = $(exec_prefix)/bin
29libdir = $(exec_prefix)/lib
034351e3 30tooldir = $(exec_prefix)/$(target_alias)
e06ba18d 31datadir = $(prefix)/lib
12fa72d4 32mandir = $(prefix)/man
e06ba18d
PB
33man1dir = $(mandir)/man1
34man2dir = $(mandir)/man2
35man3dir = $(mandir)/man3
36man4dir = $(mandir)/man4
37man5dir = $(mandir)/man5
38man6dir = $(mandir)/man6
39man7dir = $(mandir)/man7
40man8dir = $(mandir)/man8
41man9dir = $(mandir)/man9
12fa72d4 42infodir = $(prefix)/info
e06ba18d
PB
43includedir = $(prefix)/include
44docdir = $(datadir)/doc
173a0c3d 45# We put the scripts in the directory $(scriptdir)/ldscripts.
559d7baf
RP
46# We can't put the scripts in $(datadir) because the SEARCH_DIR
47# directives need to be different for native and cross linkers.
173a0c3d 48scriptdir = $(tooldir)/lib
e06ba18d
PB
49
50SHELL = /bin/sh
51
e0d005f2 52INSTALL = `cd $(srcdir); pwd`/../install.sh -c
e06ba18d
PB
53INSTALL_PROGRAM = $(INSTALL)
54INSTALL_DATA = $(INSTALL)
5ebaf24b 55INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
c97b9003
DZ
56INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1
57
e06ba18d
PB
58AR = ar
59AR_FLAGS = qv
32286e08 60CC = cc
77b19d3d 61CFLAGS = -g
e06ba18d 62MAKEINFO = makeinfo
2412a768 63TEXI2DVI = texi2dvi
e06ba18d 64RANLIB = ranlib
2412a768 65CC_FOR_BUILD=$(CC)
bf3acf44 66BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
2df68136 67LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi`
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
d17eb3db
ILT
77# Additional libraries which are used when ld is built native. This
78# is set by some host makefile fragments.
79NATIVE_LIB_DIRS =
80
959eba20
JO
81BASEDIR = $(srcdir)/..
82BFDDIR = $(BASEDIR)/bfd
83INCDIR = $(BASEDIR)/include
84INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR)
4a6afc88 85DEP = mkdep
2ee11735 86
2412a768
RP
87# What version of the manual to build
88DOCVER = gen
89
8073190b 90# Where to find texinfo.tex to format docn with TeX
d17eb3db 91TEXIDIR = $(srcdir)/../texinfo
8d317d2a 92
959eba20
JO
93# Where to find other docs needed to format with TeX
94TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir)
95
10a69a37 96# Whether to get roff to put indexing entries on stderr
954ac2ea
RP
97TEXI2OPT =
98# You neeed this to generate ld-index.ms (or .mm or .me)
99# TEXI2OPT = -i
8073190b 100
e06ba18d
PB
101TEXI2ROFF=texi2roff
102
8073190b
RP
103# Which roff program to use to generate index for texi2roff'd doc
104ROFF = groff
105
5cdea2ac 106#stuff for self hosting (can be overridden in config file).
74e6b793
SS
107HOSTING_CRT0 = /lib/crt0.o
108HOSTING_LIBS = `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
109HOSTING_EMU = -m $(EMUL)
5cdea2ac 110
32286e08
C
111# These were used by `make check-cdtest'
112#
113#CXX = `if [ -f ../gcc/xgcc ] ; then \
114# echo ../gcc/xgcc -B../gcc/; \
115# else echo gcc; \
116# fi`
117#CXXFLAGS = -fgnu-linker
118#
8a6665ae 119# FIX_ME: using ../gcc/xgcc breaks the cdtest.
32286e08 120#CXX = g++
8a6665ae 121
3a9149a7 122# Setup the testing framework, if you have one
32286e08
C
123EXPECT = `if [ -f $$r/../expect/expect ] ; \
124 then echo $$r/../expect/expect ; \
125 else echo expect ; fi`
126
127RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \
128 then echo $${srcroot}/../dejagnu/runtest ; \
129 else echo runtest ; fi`
099c286e 130
03372cf4 131RUNTESTFLAGS =
32286e08
C
132
133CC_FOR_TARGET = ` \
134 if [ -f $$r/../gcc/Makefile ] ; then \
135 if [ -f $$r/../newlib/Makefile ] ; then \
136 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
137 else \
138 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
139 fi; \
140 else \
141 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
142 echo $(CC); \
143 else \
144 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
145 fi; \
146 fi`
147
148CXX = gcc
149CXX_FOR_TARGET = ` \
150 if [ -f $$r/../gcc/Makefile ] ; then \
151 if [ -f $$r/../newlib/Makefile ] ; then \
152 echo $$r/../gcc/xgcc -B$$r/../gcc/ -idirafter $$r/../newlib/targ-include -idirafter $${srcroot}/../newlib/libc/include -nostdinc; \
153 else \
154 echo $$r/../gcc/xgcc -B$$r/../gcc/; \
155 fi; \
156 else \
157 if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
158 echo $(CXX); \
159 else \
160 t='$(program_transform_name)'; echo gcc | sed -e 's/brokensed/brokensed/' $$t; \
161 fi; \
162 fi`
c97b9003 163
4a6afc88
ILT
164# go directly to ld.new in case this ld isn't capable of
165# linking native object on this host. It can be renamed on
166# install.
167LD_PROG = ld.new
168
169all: $(LD_PROG)
170.PHONY: all
58bf66f9 171
7e5c1057 172### Host, target, and site specific Makefile fragments come in here.
63545898 173####
2ee11735 174
74e6b793 175LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
2ee11735 176
32286e08 177# The .cc suffix was used by `make check-cdtest'.
565c93e9
DM
178
179.SUFFIXES: .y $(SUFFIXES) .cc
180
173a0c3d
DM
181# Suppress smart makes who think they know how to automake Yacc files
182.y.c:
183
32286e08
C
184# This rule was used for the check-cdtest target.
185#.cc.o:
186# $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
565c93e9 187
74e6b793 188ALL_CFLAGS = $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS)
77b19d3d 189.c.o:
4a6afc88 190 $(CC) -c $(ALL_CFLAGS) $<
f78e2569 191
eb02fd64 192# for self hosting
959eba20
JO
193BFDLIB = ../bfd/libbfd.a
194LIBIBERTY = ../libiberty/libiberty.a
eb02fd64 195
e93e87cb 196
28d0c3ce
SC
197ALL_EMULATIONS = ea29k.o ealpha.o earmaoutl.o earmoutb.o \
198 ecoff_sparc.o eebmon29k.o \
417ced0d 199 eelf32_sparc.o eelf32bmip.o eelf32lmip.o eelf32ppc.o eelf32ppcle.o \
32286e08
C
200 eelf64_sparc.o eelf_i386.o egld960.o ego32.o eh8300.o \
201 eh8300h.o eh8500.o eh8500b.o eh8500c.o eh8500m.o eh8500s.o \
202 ehp300bsd.o ehp3hpux.o ehppaelf.o ei386aout.o ei386bsd.o \
203 ei386coff.o ei386go32.o ei386linux.o ei386lynx.o ei386mach.o \
417ced0d 204 ei386nbsd.o ei386nw.o elnk960.o em68kaout.o em68kcoff.o em68kelf.o \
e574ddd4
C
205 em68klynx.o em68knbsd.o em88kbcs.o emipsbig.o emipsbsd.o \
206 emipsidt.o emipsidtl.o emipslit.o enews.o ens32knbsd.o eppcnw.o \
e93e87cb 207 eriscix.o esa29200.o eshl.o esh.o esparclynx.o esparcnbsd.o \
32286e08 208 est2000.o esun3.o esun4.o evanilla.o evax.o evsta.o \
28d0c3ce 209 ez8ksim.o ei386pe.o earmpe.o
7e5c1057 210
74e6b793 211CFILES = ldctor.c ldemul.c ldexp.c ldfile.c ldlang.c \
4a6afc88
ILT
212 ldmain.c ldmisc.c ldver.c ldwrite.c lexsup.c \
213 mri.c
eb02fd64 214
74e6b793 215HFILES = config.h ld.h ldctor.h ldemul.h ldexp.h ldfile.h \
4a6afc88
ILT
216 ldlang.h ldlex.h ldmain.h ldmisc.h ldver.h \
217 ldwrite.h mri.h
eb02fd64 218
74e6b793
SS
219GENERATED_CFILES = ldgram.c ldlex.c
220GENERATED_HFILES = ldgram.h ldemul-list.h
eb02fd64 221
74e6b793 222OFILES = ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o \
4a6afc88
ILT
223 ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o \
224 ldfile.o ${EMULATION_OFILES}
eb02fd64 225
82ebe9a2 226LINTSOURCES = $(CFILES) $(GENERATED_CFILES) e*.c
eb02fd64 227
82ebe9a2 228STAGESTUFF = *.o ldscripts/* e*.c
e06ba18d
PB
229
230info: ld.info
4a6afc88 231.PHONY: info
2ee11735 232
32286e08 233ldgram.c: ldgram.y
5ff21fa5 234 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
31e54f5d
RP
235 mv -f y.tab.c ldgram.c
236 mv -f y.tab.h ldgram.h
cc964c6f 237
32286e08
C
238# Separate from ldgram.c so that a parallel make doesn't try to build
239# both ldgram.c and ldgram.h simultaneously.
240ldgram.h: ldgram.c
241
a6152e39 242# EMUL is the name of a file in the emulparams subdir, without the .sh.
4a6afc88
ILT
243ldmain.o: ldmain.c config.status
244 if [ -z "$(EMUL)" ] ; then \
245 echo "you must set a default emulation" 1>&2 ; \
246 exit 1 ; \
247 else \
248 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $< ; \
249 fi
250
82ebe9a2 251ldemul-list.h: Makefile
7e5c1057
PB
252 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
253 for f in `echo " " ${EMULATION_OFILES} "" \
82ebe9a2 254 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
255 echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
256 done;\
257 echo "";\
258 echo "#define EMULATION_LIST \\";\
259 for f in `echo " " ${EMULATION_OFILES} "" \
82ebe9a2 260 | sed -e 's/ e/ ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
261 echo " &ld_$${f}_emulation, \\"; \
262 done;\
4a6afc88
ILT
263 echo " 0") >ldemul-tmp.h
264 mv ldemul-tmp.h ldemul-list.h
7e5c1057 265
4a6afc88 266ldlex.c: ldlex.l
5ff21fa5 267 $(LEX) -I -Cem $(srcdir)/ldlex.l
4a6afc88
ILT
268 -sed -e '/^int.*free();/d' \
269 -e '/^char.*malloc();/d' \
0b2f8d2e 270 -e 's/malloc/xmalloc/g' \
4a6afc88
ILT
271 < lex.yy.c > ldlex.c.new
272 -rm lex.yy.c
273 mv ldlex.c.new ./ldlex.c
19b03b7a 274
82ebe9a2 275# These all start with e so 'make clean' can find them.
c61b4184 276
74e6b793 277GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL} "$(NATIVE_LIB_DIRS)"
c06e55d9 278GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed
7e5c1057 279
82ebe9a2 280esun4.c: $(srcdir)/emulparams/sun4.sh \
ed601bea 281 $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 282 ${GENSCRIPTS} sun4
82ebe9a2 283esun3.c: $(srcdir)/emulparams/sun3.sh \
f7e66391 284 $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 285 ${GENSCRIPTS} sun3
28d0c3ce
SC
286earmpe.c: $(srcdir)/emulparams/armpe.sh \
287 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armpe.sc ${GEN_DEPENDS}
288 ${GENSCRIPTS} armpe
82ebe9a2 289evsta.c: $(srcdir)/emulparams/vsta.sh \
8a432746
ILT
290 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
291 ${GENSCRIPTS} vsta
82ebe9a2 292ego32.c: $(srcdir)/emulparams/go32.sh \
8ddef552 293 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 294 ${GENSCRIPTS} go32
82ebe9a2 295enews.c: $(srcdir)/emulparams/news.sh \
8ddef552 296 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 297 ${GENSCRIPTS} news
82ebe9a2 298evax.c: $(srcdir)/emulparams/vax.sh \
8ddef552 299 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 300 ${GENSCRIPTS} vax
82ebe9a2 301ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
8ddef552 302 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 303 ${GENSCRIPTS} hp300bsd
82ebe9a2 304ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
8ddef552 305 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 306 ${GENSCRIPTS} hp3hpux
28d0c3ce
SC
307ei386pe.c: $(srcdir)/emulparams/i386pe.sh \
308 $(srcdir)/emultempl/i386pe.em $(srcdir)/scripttempl/i386pe.sc ${GEN_DEPENDS}
309 ${GENSCRIPTS} i386pe
82ebe9a2 310ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \
db0a7149
KR
311 $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS}
312 ${GENSCRIPTS} hppaelf
82ebe9a2 313ei386aout.c: $(srcdir)/emulparams/i386aout.sh \
8ddef552 314 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 315 ${GENSCRIPTS} i386aout
82ebe9a2 316ei386go32.c: $(srcdir)/emulparams/i386go32.sh \
6c86b9ff
SC
317 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS}
318 ${GENSCRIPTS} i386go32
82ebe9a2 319ei386mach.c: $(srcdir)/emulparams/i386mach.sh \
3c1af24d
KR
320 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
321 ${GENSCRIPTS} i386mach
82ebe9a2 322eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
8ddef552 323 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
a6152e39 324 ${GENSCRIPTS} ebmon29k
82ebe9a2 325esa29200.c: $(srcdir)/emulparams/sa29200.sh \
8ddef552 326 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
a6152e39 327 ${GENSCRIPTS} sa29200
82ebe9a2 328ea29k.c: $(srcdir)/emulparams/a29k.sh \
8ddef552 329 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
a6152e39 330 ${GENSCRIPTS} a29k
82ebe9a2 331em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
d301e438 332 $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
a6152e39 333 ${GENSCRIPTS} m88kbcs
82ebe9a2 334eh8300.c: $(srcdir)/emulparams/h8300.sh \
8ddef552 335 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
a6152e39 336 ${GENSCRIPTS} h8300
82ebe9a2 337eh8300h.c: $(srcdir)/emulparams/h8300h.sh \
4ab3a31f 338 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
a6152e39 339 ${GENSCRIPTS} h8300h
82ebe9a2 340eh8500.c: $(srcdir)/emulparams/h8500.sh \
8ddef552 341 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
a6152e39 342 ${GENSCRIPTS} h8500
82ebe9a2 343eh8500b.c: $(srcdir)/emulparams/h8500b.sh \
9e0f78c8
SC
344 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS}
345 ${GENSCRIPTS} h8500b
82ebe9a2 346eh8500c.c: $(srcdir)/emulparams/h8500c.sh \
9e0f78c8
SC
347 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS}
348 ${GENSCRIPTS} h8500c
82ebe9a2 349eh8500m.c: $(srcdir)/emulparams/h8500m.sh \
9e0f78c8
SC
350 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS}
351 ${GENSCRIPTS} h8500m
82ebe9a2 352eh8500s.c: $(srcdir)/emulparams/h8500s.sh \
9e0f78c8
SC
353 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS}
354 ${GENSCRIPTS} h8500s
82ebe9a2 355esh.c: $(srcdir)/emulparams/sh.sh \
8ddef552 356 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
a6152e39 357 ${GENSCRIPTS} sh
e93e87cb
SC
358eshl.c: $(srcdir)/emulparams/shl.sh \
359 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
360 ${GENSCRIPTS} shl
82ebe9a2 361est2000.c: $(srcdir)/emulparams/st2000.sh \
8ddef552 362 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
a6152e39 363 ${GENSCRIPTS} st2000
82ebe9a2 364evanilla.c: $(srcdir)/emulparams/vanilla.sh \
8ddef552 365 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
a6152e39 366 ${GENSCRIPTS} vanilla
82ebe9a2 367elnk960.c: $(srcdir)/emulparams/lnk960.sh \
8ddef552 368 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
a6152e39 369 ${GENSCRIPTS} lnk960
82ebe9a2 370egld960.c: $(srcdir)/emulparams/gld960.sh \
8ddef552 371 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
a6152e39 372 ${GENSCRIPTS} gld960
82ebe9a2
KR
373egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \
374 $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
375 ${GENSCRIPTS} gld960coff
376em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
8ddef552 377 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
a6152e39 378 ${GENSCRIPTS} m68kcoff
417ced0d
MM
379em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \
380 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
381 ${GENSCRIPTS} m68kelf
82ebe9a2 382em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \
028f8872 383 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS}
d17eb3db 384 ${GENSCRIPTS} m68klynx
82ebe9a2 385ei386coff.c: $(srcdir)/emulparams/i386coff.sh \
8ddef552 386 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
a6152e39 387 ${GENSCRIPTS} i386coff
82ebe9a2 388ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \
028f8872 389 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS}
d17eb3db 390 ${GENSCRIPTS} i386lynx
82ebe9a2 391emipslit.c: $(srcdir)/emulparams/mipslit.sh \
8ddef552 392 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 393 ${GENSCRIPTS} mipslit
82ebe9a2 394ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
8ddef552 395 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 396 ${GENSCRIPTS} i386bsd
82ebe9a2 397emipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
8ddef552 398 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 399 ${GENSCRIPTS} mipsbig
82ebe9a2
KR
400emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
401 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS}
a6152e39 402 ${GENSCRIPTS} mipsbsd
82ebe9a2 403emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
417ced0d 404 $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 405 ${GENSCRIPTS} mipsidt
82ebe9a2 406emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
417ced0d 407 $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 408 ${GENSCRIPTS} mipsidtl
82ebe9a2 409eelf_i386.c: $(srcdir)/emulparams/elf_i386.sh \
2a9fa50c 410 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
d17eb3db 411 ${GENSCRIPTS} elf_i386
32286e08 412eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \
dd37f215 413 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
32286e08
C
414 ${GENSCRIPTS} elf32bmip
415eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \
5ccef180 416 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
32286e08 417 ${GENSCRIPTS} elf32lmip
82ebe9a2 418ealpha.c: $(srcdir)/emulparams/alpha.sh \
d17eb3db
ILT
419 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS}
420 ${GENSCRIPTS} alpha
82ebe9a2 421ecoff_sparc.c: $(srcdir)/emulparams/coff_sparc.sh \
4a6afc88
ILT
422 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparccoff.sc ${GEN_DEPENDS}
423 ${GENSCRIPTS} coff_sparc
82ebe9a2 424esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \
028f8872
SS
425 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS}
426 ${GENSCRIPTS} sparclynx
82ebe9a2 427eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \
099c286e 428 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
c361ce46 429 ${GENSCRIPTS} elf32ppc
417ced0d
MM
430eelf32ppcle.c: $(srcdir)/emulparams/elf32ppcle.sh \
431 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
432 ${GENSCRIPTS} elf32ppcle
dd37f215
ILT
433eriscix.c: $(srcdir)/emulparams/riscix.sh \
434 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
435 ${GENSCRIPTS} riscix
82ebe9a2
KR
436em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \
437 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
438 ${GENSCRIPTS} m68kaout
cdf71377
KR
439ei386linux.c: $(srcdir)/emulparams/i386linux.sh \
440 $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
441 ${GENSCRIPTS} i386linux
442eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \
443 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
444 ${GENSCRIPTS} elf32_sparc
445eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \
446 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
447 ${GENSCRIPTS} elf64_sparc
448
449epc532machaout.c: $(srcdir)/emulparams/pc532machaout.sh \
450 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
451 ${GENSCRIPTS} pc532machaout
452
417ced0d
MM
453ew65.c: $(srcdir)/emulparams/w65.sh \
454 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS}
455 ${GENSCRIPTS} w65
456
32286e08
C
457ei386nw.c: $(srcdir)/emulparams/i386nw.sh \
458 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
459 ${GENSCRIPTS} i386nw
460eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \
461 $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS}
462 ${GENSCRIPTS} ppcnw
463
464ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \
e93e87cb 465 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
32286e08 466 ${GENSCRIPTS} i386nbsd
e574ddd4 467em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \
e93e87cb 468 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
e574ddd4 469 ${GENSCRIPTS} m68knbsd
32286e08 470ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \
e93e87cb 471 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
32286e08
C
472 ${GENSCRIPTS} ns32knbsd
473esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \
e93e87cb 474 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
32286e08 475 ${GENSCRIPTS} sparcnbsd
28d0c3ce
SC
476earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \
477 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
478 ${GENSCRIPTS} armaoutl
479earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \
480 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS}
481 ${GENSCRIPTS} armaoutb
482ez8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
483 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
484 ${GENSCRIPTS} z8ksim
417ced0d
MM
485
486# start-sanitize-arc
487earcelf.c: $(srcdir)/emulparams/arcelf.sh \
488 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS}
489 ${GENSCRIPTS} arcelf
490# end-sanitize-arc
491# start-sanitize-rce
fb14975b
MT
492erce.c: $(srcdir)/emulparams/rce.sh \
493 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/rce.sc ${GEN_DEPENDS}
494 ${GENSCRIPTS} rce
417ced0d 495# end-sanitize-rce
eb02fd64 496
e77463a1 497$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
74e6b793 498 $(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(EXTRALIBS)
d17eb3db
ILT
499
500# The generated emulation files mostly have the same dependencies.
4a6afc88 501$(EMULATION_OFILES): ../bfd/bfd.h ../bfd/sysdep.h $(INCDIR)/bfdlink.h \
c361ce46
ILT
502 ld.h ldmain.h ldemul.h ldfile.h ldmisc.h ldexp.h ldlang.h config.h \
503 ldctor.h ldexp.h ldlang.h
4a6afc88 504
3a9149a7
JW
505# These targets are for the dejagnu testsuites. The file site.exp
506# contains global variables that all the testsuites will use.
3a9149a7 507
d301e438
JW
508site.exp: ./config.status Makefile
509 @echo "Making a new config file..."
3a9149a7 510 @rm -f ./tmp?
d301e438 511 @touch site.exp
3a9149a7 512 @mv site.exp site.bak
d301e438
JW
513 @echo "## variables are automatically generated by make ##" > ./tmp0
514 @echo "# Do not edit here. If you wish to override these" >> ./tmp0
515 @echo "# values, add them to the last section" >> ./tmp0
3a9149a7
JW
516 @echo "# HOST AND TARGET INFO" >> ./tmp0
517 @echo "set host_os $(host_os)" >> ./tmp0
518 @echo "set host_alias $(host_alias)" >> ./tmp0
519 @echo "set host_cpu $(host_cpu)" >> ./tmp0
520 @echo "set host_vendor $(host_vendor)" >> ./tmp0
521 @echo "set target_os $(target_os)" >> ./tmp0
522 @echo "set target_alias $(target_alias)" >> ./tmp0
523 @echo "set target_cpu $(target_cpu)" >> ./tmp0
524 @echo "set target_vendor $(target_vendor)" >> ./tmp0
525 @echo "set host_triplet $(host_canonical)" >> ./tmp0
526 @echo "set target_triplet $(target_canonical)" >> ./tmp0
527 @echo "# DIRECTORY INFO" >> ./tmp0
d301e438 528 @echo "set objdir `pwd`" >> ./tmp0
d301e438 529 @echo "" >> ./tmp0
32286e08 530 @echo "# LD DEPENDENCIES" >> ./tmp0
3a9149a7
JW
531 @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
532 @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
533 @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
534 @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
535 @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
536 @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
d301e438
JW
537 @echo "" >> ./tmp0
538 @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
539 @cat ./tmp0 > site.exp
540 @cat site.bak | sed \
541 -e '1,/^## Variables generated by.*##/ d' >> site.exp
542 -@rm -f ./tmp?
8ddef552 543
64bb143c 544check: site.exp
32286e08
C
545 r=`pwd`; export r; \
546 srcroot=`cd ${srcdir}; pwd` ; export srcroot ; \
547 EXPECT=${EXPECT} ; export EXPECT ; \
548 if [ -f $$r/../expect/expect ] ; then \
549 TCL_LIBRARY=$${srcroot}/../tcl/library ; \
0128cbae
KR
550 export TCL_LIBRARY ; \
551 else true ; fi ; \
32286e08
C
552 $(RUNTEST) --tool ld --srcdir $(srcdir)/testsuite $(RUNTESTFLAGS) \
553 CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
417ced0d
MM
554 CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
555 CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)"
d301e438 556
8ddef552 557installcheck:
4a6afc88 558.PHONY: check installcheck
e7921bd4 559
7e5c1057 560# Rules for testing by relinking ld itself.
32286e08
C
561# A similar test is in the testsuite. This target is for ease of use
562# when porting ld.
eb02fd64 563
7e5c1057 564ld-partial.o: ld.new
a04f1d00 565 ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
7e5c1057 566ld1: ld-partial.o
a04f1d00 567 ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 568
7e5c1057 569ld1-full: ld.new
a04f1d00 570 ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 571
d20fb445 572ld2: ld1
a04f1d00 573 ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
60048a2c 574
eb02fd64 575ld3: ld2
a04f1d00 576 ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 577
d20fb445
SC
578bootstrap: ld3
579 cmp ld2 ld3
580
4a6afc88
ILT
581.PHONY: bootstrap
582
8ddef552 583# A test program for C++ constructors and destructors.
32286e08
C
584# This test is now in the testsuite.
585#
586#cdtest: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
587# ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
588# cdtest-main.o cdtest-bar.o cdtest-foo.o $(HOSTING_LIBS)
589#
590#cdtest.out: cdtest
591# ./cdtest > cdtest.tmp
592# mv cdtest.tmp cdtest.out
593#
594#cdtest-ur.o: cdtest-main.o cdtest-bar.o cdtest-foo.o ld.new
595# ./ld.new $(HOSTING_EMU) -o cdtest-ur.o -Ur cdtest-main.o \
596# cdtest-bar.o cdtest-foo.o
597#
598#cdtest-ur: cdtest-ur.o
599# ./ld.new $(HOSTING_EMU) -o cdtest-ur $(HOSTING_CRT0) cdtest-ur.o \
600# $(HOSTING_LIBS)
601#
602#cdtest-ur.out: cdtest-ur
603# ./cdtest-ur > cdtest-ur.tmp
604# mv cdtest-ur.tmp cdtest-ur.out
605#
606#check-cdtest: cdtest.out cdtest-ur.out $(srcdir)/cdtest.exp
607# diff $(srcdir)/cdtest.exp cdtest.out
608# diff $(srcdir)/cdtest.exp cdtest-ur.out
609#
610#.PHONY: check-cdtest
4a6afc88 611
d301e438 612# END OF CHECK TARGETS
917bffa7 613
8073190b 614# DOCUMENTATION TARGETS
2412a768
RP
615# Manual configuration file; not usually attached to normal configuration,
616# because almost all configs use "gen" version of manual.
617# Set DOCVER above to change.
618configdoc.texi: ${DOCVER}-doc.texi
034351e3
PB
619 ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
620 ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
621 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
2412a768 622
8073190b 623# TeX output
2412a768 624dvi: ld.dvi
d4e5e3c3 625ld.dvi: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
4a6afc88 626 TEXINPUTS=$(BFDDIR)/doc:$$TEXINPUTS $(TEXI2DVI) $(srcdir)/ld.texinfo
2412a768 627
4b91c519 628ldint.dvi: $(srcdir)/ldint.texinfo
2412a768 629 $(TEXI2DVI) $(srcdir)/ldint.texinfo
8d317d2a 630
8073190b 631# info file for online browsing
4ecfad79 632ld.info: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi
959eba20 633 $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo
eb02fd64 634
4b91c519
PB
635ldint.info: $(srcdir)/ldint.texinfo
636 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
637
4a6afc88
ILT
638.PHONY: dvi
639
954ac2ea 640#separate targets for "ms", "me", and "mm" forms of roff doc
e06ba18d
PB
641# Try to use a recent texi2roff. v2 was put on prep in jan91.
642# If you want an index, see texi2roff doc for postprocessing
643# and add -i to texi2roff invocations below.
644# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
645# correspondint -e lines when later texi2roff's are current)
646# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
647# + @c's deleted explicitly because texi2roff sees texinfo commands in them
648# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
649# + @alphaenumerate is ridiculously new, turned into @enumerate
650
9c7810d6 651ld.ms: $(srcdir)/ld.texinfo
8073190b
RP
652 sed -e '/\\input texinfo/d' \
653 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
654 -e '/^@ifinfo/,/^@end ifinfo/d' \
655 -e '/^@c/d' \
656 -e 's/{.*,,/{/' \
657 -e 's/@ / /g' \
658 -e 's/^@alphaenumerate/@enumerate/g' \
659 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 660 $(srcdir)/ld.texinfo | \
e06ba18d
PB
661 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
662 sed -e 's/---/\\(em/g' \
663 >>ld.ms
8073190b
RP
664
665# index for roff output
666ld-index.ms: ld.ms
667 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
668 sed -e '/: warning:/d' | \
669 texi2index >ld-index.ms
670
954ac2ea 671# roff output (-mm)
9c7810d6 672ld.mm: $(srcdir)/ld.texinfo
954ac2ea
RP
673 sed -e '/\\input texinfo/d' \
674 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
675 -e '/^@ifinfo/,/^@end ifinfo/d' \
676 -e '/^@c/d' \
9c7810d6
RP
677 -e 's/{.*,,/{/' \
678 -e '/@noindent/d' \
e06ba18d
PB
679 -e 's/@ / /g' \
680 -e 's/^@alphaenumerate/@enumerate/g' \
681 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 682 $(srcdir)/ld.texinfo | \
e06ba18d 683 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
9c7810d6
RP
684 sed -e 's/---/\\(em/g' \
685 >ld.mm
954ac2ea
RP
686
687# index for roff output
688ld-index.mm: ld.mm
689 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
690 sed -e '/: warning:/d' | \
691 texi2index >ld-index.mm
692
693# roff output (-me)
9c7810d6 694ld.me: $(srcdir)/ld.texinfo
954ac2ea
RP
695 sed -e '/\\input texinfo/d' \
696 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
697 -e '/^@ifinfo/,/^@end ifinfo/d' \
698 -e '/^@c/d' \
699 -e 's/{.*,,/{/' \
700 -e 's/@ / /g' \
701 -e 's/^@alphaenumerate/@enumerate/g' \
702 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 703 $(srcdir)/ld.texinfo | \
e06ba18d
PB
704 $(TEXI2ROFF) $(TEXI2OPT) -me | \
705 sed -e 's/---/\\(em/g' \
706 >>ld.me
954ac2ea
RP
707
708# index for roff output
709ld-index.me: ld.me
710 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
711 sed -e '/: warning:/d' | \
712 texi2index >ld-index.me
713
e7921bd4 714stage1: force
e06ba18d 715 -mkdir stage1
ab57b174 716 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
e06ba18d 717 -(cd stage1 ; ln -s $(LD_PROG) ld)
f78e2569 718
e7921bd4 719stage2: force
e06ba18d 720 -mkdir stage2
ab57b174 721 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
e06ba18d 722 -(cd stage2 ; ln -s $(LD_PROG) ld)
f78e2569 723
e7921bd4 724stage3: force
e06ba18d 725 -mkdir stage3
ab57b174 726 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
e06ba18d 727 -(cd stage3 ; ln -s $(LD_PROG) ld)
eb02fd64 728
74e6b793 729against = stage2
e46cdcdd
RP
730
731comparison: force
ab57b174 732 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
e46cdcdd 733
e7921bd4 734de-stage1: force
e06ba18d
PB
735 -(cd stage1 ; mv -f * ..)
736 -rm ld
737 -rmdir stage1
e7921bd4
RP
738
739de-stage2: force
e06ba18d
PB
740 -(cd stage2 ; mv -f * ..)
741 -rm ld
742 -rmdir stage2
e7921bd4
RP
743
744de-stage3: force
e06ba18d
PB
745 -(cd stage3 ; mv -f * ..)
746 -rm ld
747 -rmdir stage3
e7921bd4 748
4a6afc88
ILT
749.PHONY: stage1 stage2 stage3 comparison de-stage1 de-stage2 de-stage3
750
ab57b174 751# Stuff that should be included in a distribution:
74e6b793 752LDDISTSTUFF = ldgram.c ldgram.h ldlex.c
ab57b174
ILT
753diststuff: $(LDDISTSTUFF)
754
755mostlyclean:
756 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
083038a7
ILT
757 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out cdtest.tmp
758 -rm -f cdtest-ur cdtest-ur.out cdtest-ur.tmp
82ebe9a2
KR
759 -rm -f $(GENERATED_CFILES) $(GENERATED_HFILES)
760 -rm -fr tmpdir
ab57b174 761clean: mostlyclean
1e45c4c3 762 -rm -f $(LD_PROG) configdoc.texi
417ced0d
MM
763distclean: clean
764 -rm -rf Makefile config.status TAGS ldscripts site.exp site.bak
3c1af24d 765realclean: clean distclean
ab57b174 766 -rm -f $(LDDISTSTUFF)
eb02fd64 767
4a6afc88
ILT
768.PHONY: diststuff mostlyclean clean distclean realclean
769
770lintlog:$(LINTSOURCES) Makefile
2ee11735 771 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
eb02fd64
RP
772| grep -v "pointer casts may be troublesome" \
773| grep -v "possible pointer alignment problem" \
774| grep -v "ignore" \
775| grep -v "conversion from long may lose accuracy" \
776| grep -v "warning: constant argument to NOT" \
777| grep -v "enumeration type clash, operator CAST" \
778| grep -v "warning: constant in conditional context"\
779| grep -v "archive\.c"
780
781
cbb5c2d1
DM
782TAGS:
783 etags -t $(srcdir)/*.[chly] *.[chly]
eb02fd64 784
eb02fd64 785
91b3a2b6 786install:
8ddef552
DM
787 $(INSTALL_XFORM) ld.new $(bindir)/ld
788 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
173a0c3d
DM
789 for f in ldscripts/*; do \
790 $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
d360d135 791 done
9cd039e7 792 -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
56409445 793 rm -f $(tooldir)/bin/ld; \
188ce705 794 ln $(bindir)/$$n $(tooldir)/bin/ld >/dev/null 2>/dev/null \
e357065c 795 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
e06ba18d 796
db0a7149 797install-info: ld.info
82ebe9a2
KR
798 if [ -r ld.info ]; then \
799 dir=. ; \
800 else \
801 dir=$(srcdir) ; \
802 fi ; \
803 for i in `cd $$dir ; echo ld.info*` ; do \
804 $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \
afe3aa73
RP
805 done
806
12fa72d4
SC
807clean-info:
808 -rm -rf *.info*
809
4a6afc88 810.PHONY: install install-info clean-info
eb02fd64 811
4a6afc88
ILT
812# Targets to rebuild dependencies in this Makefile.
813# Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES).
814.dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES)
815 rm -f .dep1
816 $(MAKE) DEP=$(DEP) .dep1
817 sed -f dep.sed <.dep1 >.dep
eb02fd64 818
4a6afc88
ILT
819# This rule really wants a mkdep that runs "gcc -MM".
820.dep1: $(CFILES) $(GENERATED_CFILES)
821 rm -f .dep2
822 echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2
823 $(DEP) -f .dep2 $(ALL_CFLAGS) $?
824 $(srcdir)/../move-if-change .dep2 .dep1
eb02fd64 825
4a6afc88
ILT
826dep.sed: dep-in.sed config.status
827 sed <$(srcdir)/dep-in.sed >dep.sed \
828 -e 's!@INCDIR@!$(INCDIR)!' \
829 -e 's!@srcdir@!$(srcdir)!'
eb02fd64 830
4a6afc88
ILT
831dep: .dep
832 sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile
833 cat .dep >> tmp-Makefile
834 $(srcdir)/../move-if-change tmp-Makefile Makefile
239d28f3 835
4a6afc88
ILT
836dep-in: .dep
837 sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in
838 cat .dep >> tmp-Makefile.in
839 $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in
840
841.PHONY: dep dep-in
239d28f3 842
eb02fd64
RP
843# Dummy target to force execution of dependent targets.
844#
e7921bd4 845force:
eb02fd64 846
4a6afc88 847.PHONY: force
eb02fd64 848
f1eb48b6 849Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 850 $(SHELL) ./config.status
eb02fd64 851
4a6afc88
ILT
852# What appears below is generated by a hacked mkdep using gcc -MM.
853
854# DO NOT DELETE THIS LINE -- mkdep uses it.
855# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
856
dd37f215 857ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88
ILT
858 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
859 $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldmisc.h \
fb5b11ee 860 ldgram.h ldmain.h ldctor.h
dd37f215 861ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88 862 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
cdf71377
KR
863 config.h ld.h ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h \
864 ldmain.h ldemul-list.h
dd37f215 865ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88
ILT
866 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
867 $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \
868 ldgram.h ldlang.h
dd37f215 869ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88 870 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
4725fb48 871 ld.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h ldgram.h \
cdf71377 872 ldlex.h ldemul.h
dd37f215 873ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88 874 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
4725fb48
ILT
875 $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h ld.h ldmain.h \
876 ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \
877 ldctor.h ldfile.h
dd37f215 878ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88 879 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
4725fb48
ILT
880 $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h config.h \
881 ld.h ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \
882 ldemul.h ldlex.h ldfile.h ldctor.h
dd37f215 883ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88 884 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
4725fb48
ILT
885 ld.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \
886 ldfile.h
dd37f215 887ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88
ILT
888 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
889 ld.h ldver.h ldemul.h ldmain.h
dd37f215 890ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88
ILT
891 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
892 $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldwrite.h \
893 ldmisc.h ldgram.h ldmain.h
dd37f215 894lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88 895 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
4725fb48
ILT
896 $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h config.h ld.h \
897 ldmain.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h \
898 ldfile.h ldver.h
dd37f215 899mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
4a6afc88
ILT
900 ../bfd/sysdep.h $(INCDIR)/fopen-same.h ld.h ldexp.h \
901 ldlang.h ldmisc.h mri.h ldgram.h
dd37f215 902ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
4a6afc88
ILT
903 $(INCDIR)/obstack.h ../bfd/sysdep.h $(INCDIR)/fopen-same.h \
904 $(INCDIR)/bfdlink.h ld.h ldexp.h ldver.h ldlang.h ldemul.h \
905 ldfile.h ldmisc.h ldmain.h mri.h ldlex.h
dd37f215
ILT
906ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h ../bfd/sysdep.h \
907 $(INCDIR)/fopen-same.h ld.h ldgram.h ldmisc.h ldexp.h \
908 ldlang.h ldfile.h ldlex.h ldmain.h
239d28f3
SC
909
910# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.194862 seconds and 4 git commands to generate.