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