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