Changed CXX back to g++. ../gcc/xgcc breaks the cdtest because of <assert.h>
[deliverable/binutils-gdb.git] / ld / Makefile.in
CommitLineData
ce4d59e2 1# Makefile for the GNU linker ld (version 2)
3a9149a7 2# Copyright (C) 1989-1993 Free Software Foundation, Inc.
ce4d59e2
SC
3
4# This file is part of GNU ld..
5
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
eb02fd64
RP
20
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 49
2cbe4c5f
HS
50gcclibdir = $(libdir)/gcc/$(target_alias)
51
e06ba18d
PB
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
77b19d3d 62CFLAGS = -g
e06ba18d 63MAKEINFO = makeinfo
2412a768 64TEXI2DVI = texi2dvi
e06ba18d 65RANLIB = ranlib
2412a768 66CC_FOR_BUILD=$(CC)
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
12fa72d4 70#version=/`./../gcc/gcc -dumpversion`
092df318 71version=
8c32cf6e 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)
2ee11735 85
2412a768
RP
86# What version of the manual to build
87DOCVER = gen
88
8073190b 89# Where to find texinfo.tex to format docn with TeX
8d317d2a
RP
90TEXIDIR = $(srcdir)/../texinfo/fsf
91
959eba20
JO
92# Where to find other docs needed to format with TeX
93TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir)
94
10a69a37 95# Whether to get roff to put indexing entries on stderr
954ac2ea
RP
96TEXI2OPT =
97# You neeed this to generate ld-index.ms (or .mm or .me)
98# TEXI2OPT = -i
8073190b 99
e06ba18d
PB
100TEXI2ROFF=texi2roff
101
8073190b
RP
102# Which roff program to use to generate index for texi2roff'd doc
103ROFF = groff
104
5cdea2ac
SC
105#stuff for self hosting (can be overridden in config file).
106HOSTING_CRT0=/lib/crt0.o
8ddef552
DM
107HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc
108HOSTING_EMU=-m $(EMUL)
5cdea2ac 109
3a9149a7
JW
110CXX = `if [ -f ../gcc/xgcc ] ; then \
111 echo ../gcc/xgcc -B../gcc/; \
112 else echo gcc; \
113 fi`
114CXXFLAGS = -fgnu-linker
115
8a6665ae
JW
116# FIX_ME: using ../gcc/xgcc breaks the cdtest.
117CXX= g++
118
3a9149a7
JW
119# Setup the testing framework, if you have one
120RUNTEST = runtest
121RUNTEST_FLAGS =
122RUNTEST_CC = `if [ -f ../gcc/xgcc ] ; then \
123 echo ../gcc/xgcc -B../gcc/; \
124 else echo gcc; \
125 fi`
126RUNTEST_CFLAGS = $(CFLAGS)
127RUNTEST_CXX = `if [ -f ../gcc/xgcc ] ; then \
128 echo ../gcc/xgcc -B../gcc/; \
129 else echo gcc; \
130 fi`
131RUNTEST_CXXFLAGS = $(CXXFLAGS)
c97b9003 132
58bf66f9
KR
133all:
134
7e5c1057 135### Host, target, and site specific Makefile fragments come in here.
63545898 136####
2ee11735 137
2ee11735
RP
138LINTFLAGS = $(INCLUDES) $(EXTRA_DEF)
139
565c93e9
DM
140# The .cc suffix is used by `make check'.
141
142.SUFFIXES: .y $(SUFFIXES) .cc
143
173a0c3d
DM
144# Suppress smart makes who think they know how to automake Yacc files
145.y.c:
146
565c93e9 147.cc.o:
3a9149a7 148 $(CXX) -c -I$(srcdir) $(CXXFLAGS) $(CFLAGS) $<
565c93e9 149
77b19d3d 150.c.o:
8ddef552 151 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $<
c97b9003 152
eb02fd64
RP
153# go directly to ld.new in case this ld isn't capable of
154# linking native object on this host. It can be renamed on
155# install.
e7921bd4 156LD_PROG = ld.new
f78e2569 157
eb02fd64 158# for self hosting
959eba20
JO
159BFDLIB = ../bfd/libbfd.a
160LIBIBERTY = ../libiberty/libiberty.a
eb02fd64 161
0750b974 162ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \
63545898 163 em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \
4ab3a31f 164 em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \
034351e3 165 em_m68kcoff.o em_st2000.o em_sa29200.o \
e637dcf0 166 em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \
8ddef552 167 em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \
58bf66f9
KR
168 em_hppaosf.o em_mipsidtl.o em_sh.o \
169 $(OTHER_EMULATIONS)
7e5c1057 170
959eba20
JO
171# This is now set by configure.in.
172#EMULATION_OFILES=${ALL_EMULATIONS}
7e5c1057 173
119afd7b 174OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \
7e5c1057 175 ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \
fc60e4f7 176 ldfile.o relax.o lderror.o ${EMULATION_OFILES}
eb02fd64 177
ce4d59e2
SC
178HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \
179 ldsym.h ldctor.h ldlang.h ldexp.h \
239d28f3 180 ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h
eb02fd64
RP
181
182MANSOURCES=ld.tex
183
119afd7b 184LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \
63545898 185 em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \
2e2bf962 186 ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \
fc60e4f7 187 relax.c lderror.c
eb02fd64 188
ab57b174 189GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h
7e5c1057 190GENERATED_HEADERS=ldgram.h ldemul-list.h
eb02fd64 191
cc964c6f 192LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h
eb02fd64 193
2ee11735 194BFDSOURCES=../../bfd/common/*.c
eb02fd64
RP
195
196SOURCES= $(LDSOURCES) $(BFDSOURCES)
197LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES)
198
959eba20 199STAGESTUFF = *.o ldscripts/* $(GENERATED_SOURCES) $(GENERATED_HEADERS)
2ee11735 200
42b5c739 201all: $(LD_PROG)
e06ba18d
PB
202
203info: ld.info
2ee11735 204
173a0c3d 205ldgram.h ldgram.c: ldgram.y
5ff21fa5 206 $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y
31e54f5d
RP
207 mv -f y.tab.c ldgram.c
208 mv -f y.tab.h ldgram.h
cc964c6f 209
a6152e39 210# EMUL is the name of a file in the emulparams subdir, without the .sh.
42b5c739
ILT
211DEF_EMUL = ` if [ -z "$(EMUL)" ] ; then \
212 echo "you must set a default emulation" 1>&2 ; \
213 exit 1 ; \
214 else \
215 echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \
216 fi`
42b5c739 217
959eba20
JO
218ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
219 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
220 $(INCDIR)/fopen-same.h config.h ld.h \
221 ldmain.h ldmisc.h ldwrite.h ./ldgram.h \
222 ldsym.h ldlang.h ldemul.h ldlex.h \
223 ldfile.h ldindr.h ldwarn.h ldctor.h \
224 lderror.h
ff76a7db 225 $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $<
7e5c1057 226
820c446c 227ldemul-list.h: Makefile
7e5c1057
PB
228 (echo "/* This file is automatically generated. DO NOT EDIT! */";\
229 for f in `echo " " ${EMULATION_OFILES} "" \
ab57b174 230 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
231 echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \
232 done;\
233 echo "";\
234 echo "#define EMULATION_LIST \\";\
235 for f in `echo " " ${EMULATION_OFILES} "" \
ab57b174 236 | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \
7e5c1057
PB
237 echo " &ld_$${f}_emulation, \\"; \
238 done;\
239 echo " 0") >ldemul-list.h
240
42b5c739 241ldlex.c: ldlex.l ldgram.h
5ff21fa5
PB
242 $(LEX) -I -Cem $(srcdir)/ldlex.l
243 mv lex.yy.c ldlex.c
19b03b7a 244
ab57b174 245# These all start with em_ so 'make clean' can find them.
c61b4184 246
a6152e39 247GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} ${EMUL}
8ddef552 248GEN_DEPENDS=$(srcdir)/genscripts.sh
7e5c1057 249
8ddef552
DM
250em_sun4.c: $(srcdir)/emulparams/sun4.sh \
251 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 252 ${GENSCRIPTS} sun4
8ddef552
DM
253em_sun3.c: $(srcdir)/emulparams/sun3.sh \
254 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 255 ${GENSCRIPTS} sun3
8ddef552
DM
256em_go32.c: $(srcdir)/emulparams/go32.sh \
257 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 258 ${GENSCRIPTS} go32
8ddef552
DM
259em_news.c: $(srcdir)/emulparams/news.sh \
260 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 261 ${GENSCRIPTS} news
8ddef552
DM
262em_vax.c: $(srcdir)/emulparams/vax.sh \
263 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 264 ${GENSCRIPTS} vax
8ddef552
DM
265em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \
266 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 267 ${GENSCRIPTS} hp300bsd
8ddef552
DM
268em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \
269 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 270 ${GENSCRIPTS} hp3hpux
8ddef552
DM
271em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \
272 $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS}
a6152e39 273 ${GENSCRIPTS} hppaosf
8ddef552
DM
274em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \
275 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 276 ${GENSCRIPTS} i386aout
8ddef552
DM
277em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \
278 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS}
a6152e39 279 ${GENSCRIPTS} ebmon29k
8ddef552
DM
280em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \
281 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS}
a6152e39 282 ${GENSCRIPTS} sa29200
8ddef552
DM
283em_a29k.c: $(srcdir)/emulparams/a29k.sh \
284 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS}
a6152e39 285 ${GENSCRIPTS} a29k
8ddef552 286em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \
d301e438 287 $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS}
a6152e39 288 ${GENSCRIPTS} m88kbcs
8ddef552
DM
289em_h8300.c: $(srcdir)/emulparams/h8300.sh \
290 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS}
a6152e39 291 ${GENSCRIPTS} h8300
4ab3a31f
DE
292em_h8300h.c: $(srcdir)/emulparams/h8300h.sh \
293 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS}
a6152e39 294 ${GENSCRIPTS} h8300h
8ddef552
DM
295em_h8500.c: $(srcdir)/emulparams/h8500.sh \
296 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS}
a6152e39 297 ${GENSCRIPTS} h8500
8ddef552
DM
298em_sh.c: $(srcdir)/emulparams/sh.sh \
299 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS}
a6152e39 300 ${GENSCRIPTS} sh
8ddef552
DM
301em_st2000.c: $(srcdir)/emulparams/st2000.sh \
302 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS}
a6152e39 303 ${GENSCRIPTS} st2000
8ddef552
DM
304em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \
305 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS}
a6152e39 306 ${GENSCRIPTS} z8ksim
8ddef552
DM
307em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \
308 $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS}
a6152e39 309 ${GENSCRIPTS} vanilla
8ddef552
DM
310em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \
311 $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
a6152e39 312 ${GENSCRIPTS} lnk960
8ddef552
DM
313em_gld960.c: $(srcdir)/emulparams/gld960.sh \
314 $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS}
a6152e39 315 ${GENSCRIPTS} gld960
8ddef552
DM
316em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \
317 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS}
a6152e39 318 ${GENSCRIPTS} m68kcoff
8ddef552
DM
319em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \
320 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS}
a6152e39 321 ${GENSCRIPTS} i386coff
8ddef552
DM
322em_mipslit.c: $(srcdir)/emulparams/mipslit.sh \
323 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 324 ${GENSCRIPTS} mipslit
8ddef552
DM
325em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \
326 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 327 ${GENSCRIPTS} i386bsd
8ddef552
DM
328em_mipsbig.c: $(srcdir)/emulparams/mipsbig.sh \
329 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 330 ${GENSCRIPTS} mipsbig
8ddef552
DM
331em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \
332 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS}
a6152e39 333 ${GENSCRIPTS} mipsbsd
8ddef552
DM
334em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \
335 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 336 ${GENSCRIPTS} mipsidt
8ddef552
DM
337em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \
338 $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS}
a6152e39 339 ${GENSCRIPTS} mipsidtl
eb02fd64 340
e77463a1 341$(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY)
959eba20
JO
342 $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES)
343
344# This list of dependencies was generated by doing a make with gcc -MM
345# saving the output in a file and removing the gcc commands
346# changing "../../devo/ld/../bfd" to "$(BFDDIR)"
347# removing "../../devo/ld/"
348# changing "../include" to "$(INCDIR)"
349
350ldgram.o: ldgram.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \
351 ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h \
352 ld.h ldexp.h ldver.h ldlang.h \
353 ldemul.h ldfile.h ldmisc.h mri.h
354ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h ./ldgram.h
355lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
356 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
357 $(INCDIR)/fopen-same.h ldlex.h ld.h \
358 ldexp.h ./ldgram.h ldmisc.h
359ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
360 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
361 $(INCDIR)/fopen-same.h ld.h ldmain.h \
362 ldsym.h ./ldgram.h ldwarn.h ldlang.h \
363 ldexp.h ldemul.h ldlex.h ldmisc.h \
364 ldindr.h ldctor.h
365mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
366 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
367 $(INCDIR)/fopen-same.h ld.h ldlang.h \
368 mri.h ./ldgram.h ldexp.h
369ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
370 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
371 $(INCDIR)/fopen-same.h ld.h ldlang.h \
372 ldsym.h ldmisc.h ldexp.h ./ldgram.h
373ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
374 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
375 $(INCDIR)/fopen-same.h config.h ld.h \
376 ldmain.h ldmisc.h ldwrite.h ./ldgram.h \
377 ldsym.h ldlang.h ldemul.h ldlex.h \
378 ldfile.h ldindr.h ldwarn.h ldctor.h \
379 lderror.h
380ldindr.o: ldindr.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
381 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
382 $(INCDIR)/fopen-same.h ld.h ldsym.h \
383 ldmisc.h
384ldwarn.o: ldwarn.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
385 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
386 $(INCDIR)/fopen-same.h ldsym.h ldwarn.h \
387 ldmisc.h
388ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
389 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
390 $(INCDIR)/fopen-same.h ldlang.h ld.h \
391 ldwrite.h ldmisc.h ldsym.h ./ldgram.h \
392 relax.h
393ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
394 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
395 $(INCDIR)/fopen-same.h ld.h ldmain.h \
396 ldmisc.h ldexp.h ./ldgram.h ldsym.h \
397 ldlang.h
398ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
399 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
400 $(INCDIR)/fopen-same.h config.h ld.h \
401 ldemul.h ldmisc.h ./ldemul-list.h
402ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
403 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
404 $(INCDIR)/fopen-same.h ldver.h ldemul.h
405ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
406 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
407 $(INCDIR)/fopen-same.h ld.h ldmisc.h \
408 ldlang.h ldlex.h
409ldsym.o: ldsym.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
410 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
411 $(INCDIR)/fopen-same.h ld.h ldsym.h \
412 ldmisc.h ldlang.h
413ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
414 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
415 $(INCDIR)/fopen-same.h ldmisc.h ldlang.h \
416 ldfile.h
417relax.o: relax.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
418 $(INCDIR)/obstack.h $(BFDDIR)/seclet.h $(INCDIR)/coff/internal.h \
419 ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h $(INCDIR)/fopen-same.h \
420 ldlang.h ld.h ldwrite.h ldmisc.h \
421 ldsym.h ./ldgram.h relax.h
422lderror.o: lderror.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \
423 $(INCDIR)/obstack.h ../bfd/sysdep.h $(BFDDIR)/hosts/std-host.h \
424 $(INCDIR)/fopen-same.h $(BFDDIR)/seclet.h ld.h \
425 ldmisc.h
8ddef552 426
3a9149a7
JW
427# CYGNUS LOCAL targets.
428# These targets are for the dejagnu testsuites. The file site.exp
429# contains global variables that all the testsuites will use.
430# There is a current debate as to how and where to generate test
431# outputs. Rob feels each test should be built in $(objdir) with
432# a unique name. Cassidy feels that we should create a directory
433# called $(objdir)/tmpdir and do the work there. This way, there
434# is no potential conflict with existing objects, ie: as there
435# was in the past with loop.o and flow.o, and, there is no chance
436# of filling /tmp, which would cause other problems. Lastly, this
437# allow retention of the testcase name making debugging easier.
438#
439testdir = $(objdir)/tmpdir
440
d301e438 441site.exp: ./config.status Makefile
3a9149a7 442 @if [ -d $(testdir) ]; then true; else mkdir $(testdir); fi
d301e438 443 @echo "Making a new config file..."
3a9149a7 444 @rm -f ./tmp?
d301e438 445 @touch site.exp
3a9149a7 446 @mv site.exp site.bak
d301e438
JW
447 @echo "## variables are automatically generated by make ##" > ./tmp0
448 @echo "# Do not edit here. If you wish to override these" >> ./tmp0
449 @echo "# values, add them to the last section" >> ./tmp0
3a9149a7
JW
450 @echo "# HOST AND TARGET INFO" >> ./tmp0
451 @echo "set host_os $(host_os)" >> ./tmp0
452 @echo "set host_alias $(host_alias)" >> ./tmp0
453 @echo "set host_cpu $(host_cpu)" >> ./tmp0
454 @echo "set host_vendor $(host_vendor)" >> ./tmp0
455 @echo "set target_os $(target_os)" >> ./tmp0
456 @echo "set target_alias $(target_alias)" >> ./tmp0
457 @echo "set target_cpu $(target_cpu)" >> ./tmp0
458 @echo "set target_vendor $(target_vendor)" >> ./tmp0
459 @echo "set host_triplet $(host_canonical)" >> ./tmp0
460 @echo "set target_triplet $(target_canonical)" >> ./tmp0
461 @echo "# DIRECTORY INFO" >> ./tmp0
d301e438 462 @echo "set objdir `pwd`" >> ./tmp0
3a9149a7 463 @echo "set tmpdir `cd $(testdir); pwd`" >> ./tmp0
d301e438
JW
464 @echo "" >> ./tmp0
465 @echo "# LD DEPENDANCIES" >> ./tmp0
3a9149a7
JW
466 @echo "set OFILES \"$(OFILES)\"" >> ./tmp0
467 @echo "set BFDLIB \"$(BFDLIB)\"" >> ./tmp0
468 @echo "set LIBIBERTY \"$(LIBIBERTY)\"" >> ./tmp0
469 @echo "set HOSTING_EMU \"$(HOSTING_EMU)\"" >> ./tmp0
470 @echo "set HOSTING_CRT0 \"$(HOSTING_CRT0)\"" >> ./tmp0
471 @echo "set HOSTING_LIBS \"$(HOSTING_LIBS)\"" >> ./tmp0
d301e438
JW
472 @echo "" >> ./tmp0
473 @echo "## Variables generated by configure. Do Not Edit ##" >> ./tmp0
474 @cat ./tmp0 > site.exp
475 @cat site.bak | sed \
476 -e '1,/^## Variables generated by.*##/ d' >> site.exp
477 -@rm -f ./tmp?
8ddef552 478
959eba20 479check: ld.new site.exp
3a9149a7
JW
480 $(RUNTEST) --tool ld \
481 --srcdir $(srcdir)/testsuite $(RUNTEST_FLAGS) \
482 CC="$(RUNTEST_CC)" CFLAGS="$(RUNTEST_CFLAGS)" \
483 CXX="$(RUNTEST_CXX)" CXXFLAGS="$(RUNTEST_CXXFLAGS)"
d301e438 484
8ddef552 485installcheck:
e7921bd4 486
7e5c1057 487# Rules for testing by relinking ld itself.
eb02fd64 488
7e5c1057 489ld-partial.o: ld.new
a04f1d00 490 ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES)
7e5c1057 491ld1: ld-partial.o
a04f1d00 492 ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 493
7e5c1057 494ld1-full: ld.new
a04f1d00 495 ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 496
d20fb445 497ld2: ld1
a04f1d00 498 ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
60048a2c 499
eb02fd64 500ld3: ld2
a04f1d00 501 ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS)
eb02fd64 502
d20fb445
SC
503bootstrap: ld3
504 cmp ld2 ld3
505
8ddef552
DM
506# A test program for C++ constructors and destructors.
507
ef868186 508cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new
a04f1d00 509 ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \
917bffa7
PB
510 cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS)
511
512check-cdtest: cdtest $(srcdir)/cdtest.exp
513 ./cdtest >cdtest.out
514 diff $(srcdir)/cdtest.exp cdtest.out
d301e438 515# END OF CHECK TARGETS
917bffa7 516
8073190b 517# DOCUMENTATION TARGETS
2412a768
RP
518# Manual configuration file; not usually attached to normal configuration,
519# because almost all configs use "gen" version of manual.
520# Set DOCVER above to change.
521configdoc.texi: ${DOCVER}-doc.texi
034351e3
PB
522 ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
523 ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \
524 cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi
2412a768 525
8073190b 526# TeX output
2412a768 527dvi: ld.dvi
959eba20 528ld.dvi: $(srcdir)/ld.texinfo $(srcdir)/configdoc.texi
2412a768
RP
529 $(TEXI2DVI) $(srcdir)/ld.texinfo
530
4b91c519 531ldint.dvi: $(srcdir)/ldint.texinfo
2412a768 532 $(TEXI2DVI) $(srcdir)/ldint.texinfo
8d317d2a 533
8073190b 534# info file for online browsing
2412a768 535ld.info: $(srcdir)/ld.texinfo configdoc.texi
959eba20 536 $(MAKEINFO) -I$(BFDDIR)/doc -o ld.info $(srcdir)/ld.texinfo
eb02fd64 537
4b91c519
PB
538ldint.info: $(srcdir)/ldint.texinfo
539 $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo
540
954ac2ea 541#separate targets for "ms", "me", and "mm" forms of roff doc
e06ba18d
PB
542# Try to use a recent texi2roff. v2 was put on prep in jan91.
543# If you want an index, see texi2roff doc for postprocessing
544# and add -i to texi2roff invocations below.
545# Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete
546# correspondint -e lines when later texi2roff's are current)
547# + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs.
548# + @c's deleted explicitly because texi2roff sees texinfo commands in them
549# + @ (that's at-BLANK) not recognized by texi2roff, turned into blank
550# + @alphaenumerate is ridiculously new, turned into @enumerate
551
9c7810d6 552ld.ms: $(srcdir)/ld.texinfo
8073190b
RP
553 sed -e '/\\input texinfo/d' \
554 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
555 -e '/^@ifinfo/,/^@end ifinfo/d' \
556 -e '/^@c/d' \
557 -e 's/{.*,,/{/' \
558 -e 's/@ / /g' \
559 -e 's/^@alphaenumerate/@enumerate/g' \
560 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 561 $(srcdir)/ld.texinfo | \
e06ba18d
PB
562 $(TEXI2ROFF) $(TEXI2OPT) -ms | \
563 sed -e 's/---/\\(em/g' \
564 >>ld.ms
8073190b
RP
565
566# index for roff output
567ld-index.ms: ld.ms
568 $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \
569 sed -e '/: warning:/d' | \
570 texi2index >ld-index.ms
571
954ac2ea 572# roff output (-mm)
9c7810d6 573ld.mm: $(srcdir)/ld.texinfo
954ac2ea
RP
574 sed -e '/\\input texinfo/d' \
575 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
576 -e '/^@ifinfo/,/^@end ifinfo/d' \
577 -e '/^@c/d' \
9c7810d6
RP
578 -e 's/{.*,,/{/' \
579 -e '/@noindent/d' \
e06ba18d
PB
580 -e 's/@ / /g' \
581 -e 's/^@alphaenumerate/@enumerate/g' \
582 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 583 $(srcdir)/ld.texinfo | \
e06ba18d 584 $(TEXI2ROFF) $(TEXI2OPT) -mm | \
9c7810d6
RP
585 sed -e 's/---/\\(em/g' \
586 >ld.mm
954ac2ea
RP
587
588# index for roff output
589ld-index.mm: ld.mm
590 $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \
591 sed -e '/: warning:/d' | \
592 texi2index >ld-index.mm
593
594# roff output (-me)
9c7810d6 595ld.me: $(srcdir)/ld.texinfo
954ac2ea
RP
596 sed -e '/\\input texinfo/d' \
597 -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \
e06ba18d
PB
598 -e '/^@ifinfo/,/^@end ifinfo/d' \
599 -e '/^@c/d' \
600 -e 's/{.*,,/{/' \
601 -e 's/@ / /g' \
602 -e 's/^@alphaenumerate/@enumerate/g' \
603 -e 's/^@end alphaenumerate/@end enumerate/g' \
9c7810d6 604 $(srcdir)/ld.texinfo | \
e06ba18d
PB
605 $(TEXI2ROFF) $(TEXI2OPT) -me | \
606 sed -e 's/---/\\(em/g' \
607 >>ld.me
954ac2ea
RP
608
609# index for roff output
610ld-index.me: ld.me
611 $(ROFF) -me ld.me 2>&1 1>/dev/null | \
612 sed -e '/: warning:/d' | \
613 texi2index >ld-index.me
614
e7921bd4 615stage1: force
e06ba18d 616 -mkdir stage1
ab57b174 617 -mv -f $(STAGESTUFF) $(LD_PROG) stage1
e06ba18d 618 -(cd stage1 ; ln -s $(LD_PROG) ld)
f78e2569 619
e7921bd4 620stage2: force
e06ba18d 621 -mkdir stage2
ab57b174 622 -mv -f $(STAGESTUFF) $(LD_PROG) stage2
e06ba18d 623 -(cd stage2 ; ln -s $(LD_PROG) ld)
f78e2569 624
e7921bd4 625stage3: force
e06ba18d 626 -mkdir stage3
ab57b174 627 -mv -f $(STAGESTUFF) $(LD_PROG) stage3
e06ba18d 628 -(cd stage3 ; ln -s $(LD_PROG) ld)
eb02fd64 629
e46cdcdd
RP
630against=stage2
631
632comparison: force
ab57b174 633 for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done
e46cdcdd 634
e7921bd4 635de-stage1: force
e06ba18d
PB
636 -(cd stage1 ; mv -f * ..)
637 -rm ld
638 -rmdir stage1
e7921bd4
RP
639
640de-stage2: force
e06ba18d
PB
641 -(cd stage2 ; mv -f * ..)
642 -rm ld
643 -rmdir stage2
e7921bd4
RP
644
645de-stage3: force
e06ba18d
PB
646 -(cd stage3 ; mv -f * ..)
647 -rm ld
648 -rmdir stage3
e7921bd4 649
ab57b174 650# Stuff that should be included in a distribution:
63545898 651LDDISTSTUFF=ldgram.c ldgram.h ldlex.c
ab57b174
ILT
652diststuff: $(LDDISTSTUFF)
653
654mostlyclean:
655 -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp]
917bffa7 656 -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out
ab57b174
ILT
657clean: mostlyclean
658 -rm -f $(LD_PROG)
659distclean: clean
d301e438 660 -rm -fr Makefile config.status TAGS sysdep.h ldscripts site.exp
ab57b174
ILT
661realclean: distclean
662 -rm -f $(LDDISTSTUFF)
eb02fd64
RP
663
664lintlog:$(SOURCES) Makefile
2ee11735 665 $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \
eb02fd64
RP
666| grep -v "pointer casts may be troublesome" \
667| grep -v "possible pointer alignment problem" \
668| grep -v "ignore" \
669| grep -v "conversion from long may lose accuracy" \
670| grep -v "warning: constant argument to NOT" \
671| grep -v "enumeration type clash, operator CAST" \
672| grep -v "warning: constant in conditional context"\
673| grep -v "archive\.c"
674
675
cbb5c2d1
DM
676TAGS:
677 etags -t $(srcdir)/*.[chly] *.[chly]
eb02fd64 678
eb02fd64 679
12fa72d4 680.PHONY: install
91b3a2b6 681install:
8ddef552
DM
682 $(INSTALL_XFORM) ld.new $(bindir)/ld
683 $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1
173a0c3d
DM
684 for f in ldscripts/*; do \
685 $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \
d360d135 686 done
9cd039e7 687 -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \
56409445
ILT
688 rm -f $(tooldir)/bin/ld; \
689 ln $(bindir)/$$n $(tooldir)/bin/ld \
e357065c 690 || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld
e06ba18d 691
91b3a2b6 692install-info:
afe3aa73 693 for i in ld.info* ; do \
e06ba18d 694 $(INSTALL_DATA) $$i $(infodir)/$$i ; \
afe3aa73
RP
695 done
696
12fa72d4
SC
697clean-info:
698 -rm -rf *.info*
699
eb02fd64
RP
700#-----------------------------------------------------------------------------
701# 'STANDARD' GNU/960 TARGETS BELOW THIS POINT
702#
703# 'VERSION' file must be present and contain a string of the form "x.y"
704#-----------------------------------------------------------------------------
705
706ver960.c: FORCE
707 rm -f ver960.c
708 echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c
709
710
711# This target should be invoked before building a new release.
712# 'VERSION' file must be present and contain a string of the form "x.y"
713#
714roll:
715 @V=`cat VERSION` ; \
716 MAJ=`sed 's/\..*//' VERSION` ; \
717 MIN=`sed 's/.*\.//' VERSION` ; \
718 V=$$MAJ.`expr $$MIN + 1` ; \
719 rm -f VERSION ; \
720 echo $$V >VERSION ; \
721 echo Version $$V
722
239d28f3 723
e1e5fbfc 724dep: $(LDSOURCES)
239d28f3
SC
725 mkdep $(CFLAGS) $?
726
eb02fd64
RP
727# Dummy target to force execution of dependent targets.
728#
e7921bd4 729force:
eb02fd64
RP
730
731# Target to uncomment host-specific lines in this makefile. Such lines must
732# have the following string beginning in column 1: #__<hostname>__#
733# Original Makefile is backed up as 'Makefile.old'.
734#
735# Invoke with: make make HOST=xxx
736#
737make:
738 -@if test $(HOST)x = x ; then \
739 echo '\aSpecify "make make HOST=???"'; \
740 exit 1; \
741 fi ; \
742 grep -s "^#The next line was generated by 'make make'" Makefile; \
743 if test $$? = 0 ; then \
744 echo "\aMakefile has already been processed with 'make make'";\
745 exit 1; \
746 fi ; \
747 mv -f Makefile Makefile.old; \
748 echo "#The next line was generated by 'make make'" >Makefile ; \
749 echo "HOST=$(HOST)" >>Makefile ; \
750 echo >>Makefile ; \
751 sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile
752
753#\f
754
f1eb48b6 755Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
a26878d1 756 $(SHELL) ./config.status
eb02fd64 757
eb02fd64 758### mode:fundamental ***
e06ba18d 759### Local Variables: ***
eb02fd64
RP
760### page-delimiter: "^#\f" ***
761### End: ***
762### end of file
239d28f3
SC
763
764
765# IF YOU PUT ANYTHING HERE IT WILL GO AWAY
This page took 0.124074 seconds and 4 git commands to generate.