]>
Commit | Line | Data |
---|---|---|
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 |
21 | VPATH = @srcdir@ |
22 | srcdir = @srcdir@ | |
3a9149a7 | 23 | objdir = . |
eb02fd64 | 24 | |
d66c832b ILT |
25 | target_alias = @target_alias@ |
26 | prefix = @prefix@ | |
e06ba18d | 27 | |
d66c832b ILT |
28 | program_transform_name = @program_transform_name@ |
29 | exec_prefix = @exec_prefix@ | |
12fa72d4 SC |
30 | bindir = $(exec_prefix)/bin |
31 | libdir = $(exec_prefix)/lib | |
034351e3 | 32 | tooldir = $(exec_prefix)/$(target_alias) |
e06ba18d | 33 | datadir = $(prefix)/lib |
12fa72d4 | 34 | mandir = $(prefix)/man |
e06ba18d PB |
35 | man1dir = $(mandir)/man1 |
36 | man2dir = $(mandir)/man2 | |
37 | man3dir = $(mandir)/man3 | |
38 | man4dir = $(mandir)/man4 | |
39 | man5dir = $(mandir)/man5 | |
40 | man6dir = $(mandir)/man6 | |
41 | man7dir = $(mandir)/man7 | |
42 | man8dir = $(mandir)/man8 | |
43 | man9dir = $(mandir)/man9 | |
12fa72d4 | 44 | infodir = $(prefix)/info |
e06ba18d PB |
45 | includedir = $(prefix)/include |
46 | docdir = $(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 | 50 | scriptdir = $(tooldir)/lib |
e06ba18d PB |
51 | |
52 | SHELL = /bin/sh | |
53 | ||
e0d005f2 | 54 | INSTALL = `cd $(srcdir); pwd`/../install.sh -c |
e06ba18d PB |
55 | INSTALL_PROGRAM = $(INSTALL) |
56 | INSTALL_DATA = $(INSTALL) | |
5ebaf24b | 57 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
c97b9003 DZ |
58 | INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 |
59 | ||
e06ba18d PB |
60 | AR = ar |
61 | AR_FLAGS = qv | |
d66c832b ILT |
62 | CC = @CC@ |
63 | CFLAGS = @CFLAGS@ | |
e06ba18d | 64 | MAKEINFO = makeinfo |
2412a768 | 65 | TEXI2DVI = texi2dvi |
e06ba18d | 66 | RANLIB = ranlib |
bf3acf44 | 67 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
2df68136 | 68 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` |
8c32cf6e | 69 | |
d66c832b ILT |
70 | EMUL = @EMUL@ |
71 | EMULATION_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. | |
208bc89e | 75 | # (The default is usually /lib:/usr/lib:/usr/local/lib, unless building |
917bffa7 | 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 | |
79 | LIB_PATH = | |
80 | ||
959eba20 JO |
81 | BASEDIR = $(srcdir)/.. |
82 | BFDDIR = $(BASEDIR)/bfd | |
83 | INCDIR = $(BASEDIR)/include | |
84 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(BFDDIR) -I$(INCDIR) | |
4a6afc88 | 85 | DEP = mkdep |
2ee11735 | 86 | |
2412a768 RP |
87 | # What version of the manual to build |
88 | DOCVER = gen | |
89 | ||
8073190b | 90 | # Where to find texinfo.tex to format docn with TeX |
d17eb3db | 91 | TEXIDIR = $(srcdir)/../texinfo |
8d317d2a | 92 | |
959eba20 JO |
93 | # Where to find other docs needed to format with TeX |
94 | TEXINPUTS = $(TEXIDIR):$(BFDDIR)/doc:$(srcdir) | |
95 | ||
10a69a37 | 96 | # Whether to get roff to put indexing entries on stderr |
954ac2ea RP |
97 | TEXI2OPT = |
98 | # You neeed this to generate ld-index.ms (or .mm or .me) | |
99 | # TEXI2OPT = -i | |
8073190b | 100 | |
e06ba18d PB |
101 | TEXI2ROFF=texi2roff |
102 | ||
8073190b RP |
103 | # Which roff program to use to generate index for texi2roff'd doc |
104 | ROFF = groff | |
105 | ||
5cdea2ac | 106 | #stuff for self hosting (can be overridden in config file). |
d66c832b ILT |
107 | HOSTING_CRT0 = @HOSTING_CRT0@ |
108 | HOSTING_LIBS = @HOSTING_LIBS@ | |
74e6b793 | 109 | HOSTING_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 |
123 | EXPECT = `if [ -f $$r/../expect/expect ] ; \ |
124 | then echo $$r/../expect/expect ; \ | |
125 | else echo expect ; fi` | |
126 | ||
127 | RUNTEST = `if [ -f $${srcroot}/../dejagnu/runtest ] ; \ | |
128 | then echo $${srcroot}/../dejagnu/runtest ; \ | |
129 | else echo runtest ; fi` | |
099c286e | 130 | |
03372cf4 | 131 | RUNTESTFLAGS = |
32286e08 C |
132 | |
133 | CC_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 \ | |
208bc89e | 144 | echo gcc | sed $(program_transform_name); \ |
32286e08 C |
145 | fi; \ |
146 | fi` | |
147 | ||
148 | CXX = gcc | |
149 | CXX_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 \ | |
208bc89e | 160 | echo gcc | sed $(program_transform_name); \ |
32286e08 C |
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. | |
167 | LD_PROG = ld.new | |
168 | ||
169 | all: $(LD_PROG) | |
170 | .PHONY: all | |
58bf66f9 | 171 | |
74e6b793 | 172 | LINTFLAGS = $(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 | 185 | ALL_CFLAGS = $(INCLUDES) @HDEFINES@ $(CFLAGS) |
77b19d3d | 186 | .c.o: |
4a6afc88 | 187 | $(CC) -c $(ALL_CFLAGS) $< |
f78e2569 | 188 | |
eb02fd64 | 189 | # for self hosting |
959eba20 JO |
190 | BFDLIB = ../bfd/libbfd.a |
191 | LIBIBERTY = ../libiberty/libiberty.a | |
eb02fd64 | 192 | |
65d22248 | 193 | ALL_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 \ |
57aa2887 | 205 | ez8001.o ez8002.o ei386pe.o earmpe.o eelf32vr4300.o eelf32vr4300el.o |
7e5c1057 | 206 | |
74e6b793 | 207 | CFILES = 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 | 211 | HFILES = 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 | 215 | GENERATED_CFILES = ldgram.c ldlex.c |
208bc89e | 216 | GENERATED_HFILES = ldgram.h ldemul-list.h |
eb02fd64 | 217 | |
74e6b793 | 218 | OFILES = 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 | 222 | LINTSOURCES = $(CFILES) $(GENERATED_CFILES) e*.c |
eb02fd64 | 223 | |
82ebe9a2 | 224 | STAGESTUFF = *.o ldscripts/* e*.c |
e06ba18d PB |
225 | |
226 | info: ld.info | |
4a6afc88 | 227 | .PHONY: info |
2ee11735 | 228 | |
32286e08 | 229 | ldgram.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. | |
236 | ldgram.h: ldgram.c | |
237 | ||
4a6afc88 | 238 | ldmain.o: ldmain.c config.status |
d66c832b | 239 | $(CC) -c -DDEFAULT_EMULATION='"$(EMUL)"' -DSCRIPTDIR='"$(scriptdir)"' $(ALL_CFLAGS) $< |
4a6afc88 | 240 | |
82ebe9a2 | 241 | ldemul-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 | 256 | ldlex.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 | 267 | GENSCRIPTS = $(SHELL) $(srcdir)/genscripts.sh ${srcdir} ${libdir} @host_alias@ @target_alias@ ${EMUL} "@NATIVE_LIB_DIRS@" |
c06e55d9 | 268 | GEN_DEPENDS = $(srcdir)/genscripts.sh $(srcdir)/emultempl/stringify.sed |
7e5c1057 | 269 | |
82ebe9a2 | 270 | esun4.c: $(srcdir)/emulparams/sun4.sh \ |
ed601bea | 271 | $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 272 | ${GENSCRIPTS} sun4 |
82ebe9a2 | 273 | esun3.c: $(srcdir)/emulparams/sun3.sh \ |
f7e66391 | 274 | $(srcdir)/emultempl/sunos.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 275 | ${GENSCRIPTS} sun3 |
28d0c3ce | 276 | earmpe.c: $(srcdir)/emulparams/armpe.sh \ |
d66c832b | 277 | $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} |
28d0c3ce | 278 | ${GENSCRIPTS} armpe |
82ebe9a2 | 279 | evsta.c: $(srcdir)/emulparams/vsta.sh \ |
8a432746 ILT |
280 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
281 | ${GENSCRIPTS} vsta | |
82ebe9a2 | 282 | ego32.c: $(srcdir)/emulparams/go32.sh \ |
8ddef552 | 283 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 284 | ${GENSCRIPTS} go32 |
82ebe9a2 | 285 | enews.c: $(srcdir)/emulparams/news.sh \ |
8ddef552 | 286 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 287 | ${GENSCRIPTS} news |
82ebe9a2 | 288 | evax.c: $(srcdir)/emulparams/vax.sh \ |
8ddef552 | 289 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 290 | ${GENSCRIPTS} vax |
82ebe9a2 | 291 | ehp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \ |
8ddef552 | 292 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 293 | ${GENSCRIPTS} hp300bsd |
82ebe9a2 | 294 | ehp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \ |
8ddef552 | 295 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 296 | ${GENSCRIPTS} hp3hpux |
28d0c3ce | 297 | ei386pe.c: $(srcdir)/emulparams/i386pe.sh \ |
d66c832b | 298 | $(srcdir)/emultempl/pe.em $(srcdir)/scripttempl/pe.sc ${GEN_DEPENDS} |
28d0c3ce | 299 | ${GENSCRIPTS} i386pe |
82ebe9a2 | 300 | ehppaelf.c: $(srcdir)/emulparams/hppaelf.sh \ |
db0a7149 KR |
301 | $(srcdir)/emultempl/hppaelf.em $(srcdir)/scripttempl/hppaelf.sc ${GEN_DEPENDS} |
302 | ${GENSCRIPTS} hppaelf | |
82ebe9a2 | 303 | ei386aout.c: $(srcdir)/emulparams/i386aout.sh \ |
8ddef552 | 304 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 305 | ${GENSCRIPTS} i386aout |
82ebe9a2 | 306 | ei386go32.c: $(srcdir)/emulparams/i386go32.sh \ |
6c86b9ff SC |
307 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386go32.sc ${GEN_DEPENDS} |
308 | ${GENSCRIPTS} i386go32 | |
82ebe9a2 | 309 | ei386mach.c: $(srcdir)/emulparams/i386mach.sh \ |
3c1af24d KR |
310 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
311 | ${GENSCRIPTS} i386mach | |
943fbd5b KR |
312 | ei386moss.c: $(srcdir)/emulparams/i386moss.sh \ |
313 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
314 | ${GENSCRIPTS} i386moss | |
315 | ei386msdos.c: $(srcdir)/emulparams/i386msdos.sh \ | |
316 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386msdos.sc ${GEN_DEPENDS} | |
317 | ${GENSCRIPTS} i386msdos | |
82ebe9a2 | 318 | eebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \ |
8ddef552 | 319 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS} |
a6152e39 | 320 | ${GENSCRIPTS} ebmon29k |
82ebe9a2 | 321 | esa29200.c: $(srcdir)/emulparams/sa29200.sh \ |
8ddef552 | 322 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS} |
a6152e39 | 323 | ${GENSCRIPTS} sa29200 |
82ebe9a2 | 324 | ea29k.c: $(srcdir)/emulparams/a29k.sh \ |
8ddef552 | 325 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS} |
a6152e39 | 326 | ${GENSCRIPTS} a29k |
82ebe9a2 | 327 | em88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \ |
d301e438 | 328 | $(srcdir)/emultempl/m88kbcs.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS} |
a6152e39 | 329 | ${GENSCRIPTS} m88kbcs |
82ebe9a2 | 330 | eh8300.c: $(srcdir)/emulparams/h8300.sh \ |
8ddef552 | 331 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS} |
a6152e39 | 332 | ${GENSCRIPTS} h8300 |
82ebe9a2 | 333 | eh8300h.c: $(srcdir)/emulparams/h8300h.sh \ |
4ab3a31f | 334 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS} |
a6152e39 | 335 | ${GENSCRIPTS} h8300h |
82ebe9a2 | 336 | eh8500.c: $(srcdir)/emulparams/h8500.sh \ |
8ddef552 | 337 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} |
a6152e39 | 338 | ${GENSCRIPTS} h8500 |
82ebe9a2 | 339 | eh8500b.c: $(srcdir)/emulparams/h8500b.sh \ |
9e0f78c8 SC |
340 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500b.sc ${GEN_DEPENDS} |
341 | ${GENSCRIPTS} h8500b | |
82ebe9a2 | 342 | eh8500c.c: $(srcdir)/emulparams/h8500c.sh \ |
9e0f78c8 SC |
343 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500c.sc ${GEN_DEPENDS} |
344 | ${GENSCRIPTS} h8500c | |
82ebe9a2 | 345 | eh8500m.c: $(srcdir)/emulparams/h8500m.sh \ |
9e0f78c8 SC |
346 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500m.sc ${GEN_DEPENDS} |
347 | ${GENSCRIPTS} h8500m | |
82ebe9a2 | 348 | eh8500s.c: $(srcdir)/emulparams/h8500s.sh \ |
9e0f78c8 SC |
349 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500s.sc ${GEN_DEPENDS} |
350 | ${GENSCRIPTS} h8500s | |
82ebe9a2 | 351 | esh.c: $(srcdir)/emulparams/sh.sh \ |
8ddef552 | 352 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} |
a6152e39 | 353 | ${GENSCRIPTS} sh |
e93e87cb SC |
354 | eshl.c: $(srcdir)/emulparams/shl.sh \ |
355 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} | |
356 | ${GENSCRIPTS} shl | |
82ebe9a2 | 357 | est2000.c: $(srcdir)/emulparams/st2000.sh \ |
8ddef552 | 358 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS} |
a6152e39 | 359 | ${GENSCRIPTS} st2000 |
82ebe9a2 | 360 | evanilla.c: $(srcdir)/emulparams/vanilla.sh \ |
8ddef552 | 361 | $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS} |
a6152e39 | 362 | ${GENSCRIPTS} vanilla |
82ebe9a2 | 363 | elnk960.c: $(srcdir)/emulparams/lnk960.sh \ |
8ddef552 | 364 | $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} |
a6152e39 | 365 | ${GENSCRIPTS} lnk960 |
82ebe9a2 | 366 | egld960.c: $(srcdir)/emulparams/gld960.sh \ |
8ddef552 | 367 | $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} |
a6152e39 | 368 | ${GENSCRIPTS} gld960 |
82ebe9a2 KR |
369 | egld960coff.c: $(srcdir)/emulparams/gld960coff.sh \ |
370 | $(srcdir)/emultempl/gld960c.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} | |
371 | ${GENSCRIPTS} gld960coff | |
372 | em68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \ | |
8ddef552 | 373 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS} |
a6152e39 | 374 | ${GENSCRIPTS} m68kcoff |
417ced0d MM |
375 | em68kelf.c: $(srcdir)/emulparams/m68kelf.sh \ |
376 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
377 | ${GENSCRIPTS} m68kelf | |
82ebe9a2 | 378 | em68klynx.c: $(srcdir)/emulparams/m68klynx.sh \ |
028f8872 | 379 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68klynx.sc ${GEN_DEPENDS} |
d17eb3db | 380 | ${GENSCRIPTS} m68klynx |
82ebe9a2 | 381 | ei386coff.c: $(srcdir)/emulparams/i386coff.sh \ |
8ddef552 | 382 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS} |
a6152e39 | 383 | ${GENSCRIPTS} i386coff |
82ebe9a2 | 384 | ei386lynx.c: $(srcdir)/emulparams/i386lynx.sh \ |
028f8872 | 385 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386lynx.sc ${GEN_DEPENDS} |
d17eb3db | 386 | ${GENSCRIPTS} i386lynx |
82ebe9a2 | 387 | emipslit.c: $(srcdir)/emulparams/mipslit.sh \ |
8ddef552 | 388 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} |
a6152e39 | 389 | ${GENSCRIPTS} mipslit |
82ebe9a2 | 390 | ei386bsd.c: $(srcdir)/emulparams/i386bsd.sh \ |
8ddef552 | 391 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
a6152e39 | 392 | ${GENSCRIPTS} i386bsd |
82ebe9a2 | 393 | emipsbig.c: $(srcdir)/emulparams/mipsbig.sh \ |
8ddef552 | 394 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} |
a6152e39 | 395 | ${GENSCRIPTS} mipsbig |
82ebe9a2 KR |
396 | emipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \ |
397 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mipsbsd.sc ${GEN_DEPENDS} | |
a6152e39 | 398 | ${GENSCRIPTS} mipsbsd |
82ebe9a2 | 399 | emipsidt.c: $(srcdir)/emulparams/mipsidt.sh \ |
417ced0d | 400 | $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} |
a6152e39 | 401 | ${GENSCRIPTS} mipsidt |
82ebe9a2 | 402 | emipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \ |
417ced0d | 403 | $(srcdir)/emultempl/mipsecoff.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} |
a6152e39 | 404 | ${GENSCRIPTS} mipsidtl |
82ebe9a2 | 405 | eelf_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 | 408 | eelf32bmip.c: $(srcdir)/emulparams/elf32bmip.sh \ |
dd37f215 | 409 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} |
32286e08 C |
410 | ${GENSCRIPTS} elf32bmip |
411 | eelf32lmip.c: $(srcdir)/emulparams/elf32lmip.sh \ | |
5ccef180 | 412 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} |
32286e08 | 413 | ${GENSCRIPTS} elf32lmip |
d66c832b ILT |
414 | eelf32vr4300.c: $(srcdir)/emulparams/elf32vr4300.sh \ |
415 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
416 | ${GENSCRIPTS} elf32vr4300 | |
417 | eelf32vr4300el.c: $(srcdir)/emulparams/elf32vr4300el.sh \ | |
418 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
419 | ${GENSCRIPTS} elf32vr4300el | |
82ebe9a2 | 420 | ealpha.c: $(srcdir)/emulparams/alpha.sh \ |
d17eb3db ILT |
421 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/alpha.sc ${GEN_DEPENDS} |
422 | ${GENSCRIPTS} alpha | |
82ebe9a2 | 423 | ecoff_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 | 426 | esparclynx.c: $(srcdir)/emulparams/sparclynx.sh \ |
028f8872 SS |
427 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sparclynx.sc ${GEN_DEPENDS} |
428 | ${GENSCRIPTS} sparclynx | |
82ebe9a2 | 429 | eelf32ppc.c: $(srcdir)/emulparams/elf32ppc.sh \ |
099c286e | 430 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} |
c361ce46 | 431 | ${GENSCRIPTS} elf32ppc |
943fbd5b | 432 | eelf32lppc.c: $(srcdir)/emulparams/elf32lppc.sh \ |
417ced0d | 433 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} |
943fbd5b | 434 | ${GENSCRIPTS} elf32lppc |
dd37f215 ILT |
435 | eriscix.c: $(srcdir)/emulparams/riscix.sh \ |
436 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
437 | ${GENSCRIPTS} riscix | |
82ebe9a2 KR |
438 | em68kaout.c: $(srcdir)/emulparams/m68kaout.sh \ |
439 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
440 | ${GENSCRIPTS} m68kaout | |
cdf71377 KR |
441 | ei386linux.c: $(srcdir)/emulparams/i386linux.sh \ |
442 | $(srcdir)/emultempl/linux.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
443 | ${GENSCRIPTS} i386linux | |
444 | eelf32_sparc.c: $(srcdir)/emulparams/elf32_sparc.sh \ | |
445 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
446 | ${GENSCRIPTS} elf32_sparc | |
447 | eelf64_sparc.c: $(srcdir)/emulparams/elf64_sparc.sh \ | |
448 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/elf.sc ${GEN_DEPENDS} | |
449 | ${GENSCRIPTS} elf64_sparc | |
450 | ||
451 | epc532machaout.c: $(srcdir)/emulparams/pc532machaout.sh \ | |
452 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
453 | ${GENSCRIPTS} pc532machaout | |
454 | ||
417ced0d MM |
455 | ew65.c: $(srcdir)/emulparams/w65.sh \ |
456 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/w65.sc ${GEN_DEPENDS} | |
457 | ${GENSCRIPTS} w65 | |
458 | ||
32286e08 C |
459 | ei386nw.c: $(srcdir)/emulparams/i386nw.sh \ |
460 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS} | |
461 | ${GENSCRIPTS} i386nw | |
462 | eppcnw.c: $(srcdir)/emulparams/ppcnw.sh \ | |
463 | $(srcdir)/emultempl/elf32.em $(srcdir)/scripttempl/nw.sc ${GEN_DEPENDS} | |
464 | ${GENSCRIPTS} ppcnw | |
465 | ||
466 | ei386nbsd.c: $(srcdir)/emulparams/i386nbsd.sh \ | |
e93e87cb | 467 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
32286e08 | 468 | ${GENSCRIPTS} i386nbsd |
e574ddd4 | 469 | em68knbsd.c: $(srcdir)/emulparams/m68knbsd.sh \ |
e93e87cb | 470 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
e574ddd4 | 471 | ${GENSCRIPTS} m68knbsd |
32286e08 | 472 | ens32knbsd.c: $(srcdir)/emulparams/ns32knbsd.sh \ |
e93e87cb | 473 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
32286e08 C |
474 | ${GENSCRIPTS} ns32knbsd |
475 | esparcnbsd.c: $(srcdir)/emulparams/sparcnbsd.sh \ | |
e93e87cb | 476 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} |
32286e08 | 477 | ${GENSCRIPTS} sparcnbsd |
28d0c3ce SC |
478 | earmaoutl.c: $(srcdir)/emulparams/armaoutl.sh \ |
479 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS} | |
480 | ${GENSCRIPTS} armaoutl | |
481 | earmaoutb.c: $(srcdir)/emulparams/armaoutb.sh \ | |
482 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/armaout.sc ${GEN_DEPENDS} | |
483 | ${GENSCRIPTS} armaoutb | |
65d22248 C |
484 | ez8001.c: $(srcdir)/emulparams/z8001.sh \ |
485 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8000.sc ${GEN_DEPENDS} | |
486 | ${GENSCRIPTS} z8001 | |
487 | ez8002.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 |
491 | earcelf.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 |
496 | erce.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 |
512 | site.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 | 548 | check: 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 | 561 | installcheck: |
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 | 568 | ld-partial.o: ld.new |
a04f1d00 | 569 | ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES) |
7e5c1057 | 570 | ld1: ld-partial.o |
a04f1d00 | 571 | ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 572 | |
7e5c1057 | 573 | ld1-full: ld.new |
a04f1d00 | 574 | ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 575 | |
d20fb445 | 576 | ld2: ld1 |
a04f1d00 | 577 | ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
60048a2c | 578 | |
eb02fd64 | 579 | ld3: ld2 |
a04f1d00 | 580 | ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 581 | |
d20fb445 SC |
582 | bootstrap: 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. | |
622 | configdoc.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 | 628 | dvi: ld.dvi |
d4e5e3c3 | 629 | ld.dvi: $(srcdir)/ld.texinfo configdoc.texi $(BFDDIR)/doc/bfdsumm.texi |
4a6afc88 | 630 | TEXINPUTS=$(BFDDIR)/doc:$$TEXINPUTS $(TEXI2DVI) $(srcdir)/ld.texinfo |
2412a768 | 631 | |
4b91c519 | 632 | ldint.dvi: $(srcdir)/ldint.texinfo |
2412a768 | 633 | $(TEXI2DVI) $(srcdir)/ldint.texinfo |
8d317d2a | 634 | |
8073190b | 635 | # info file for online browsing |
4ecfad79 | 636 | ld.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 |
639 | ldint.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 | 655 | ld.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 | |
670 | ld-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 | 676 | ld.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 | |
692 | ld-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 | 698 | ld.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 | |
713 | ld-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 | 718 | stage1: 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 | 723 | stage2: 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 | 728 | stage3: 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 | 733 | against = stage2 |
e46cdcdd RP |
734 | |
735 | comparison: force | |
ab57b174 | 736 | for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done |
e46cdcdd | 737 | |
e7921bd4 | 738 | de-stage1: force |
e06ba18d PB |
739 | -(cd stage1 ; mv -f * ..) |
740 | -rm ld | |
741 | -rmdir stage1 | |
e7921bd4 RP |
742 | |
743 | de-stage2: force | |
e06ba18d PB |
744 | -(cd stage2 ; mv -f * ..) |
745 | -rm ld | |
746 | -rmdir stage2 | |
e7921bd4 RP |
747 | |
748 | de-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 | 756 | LDDISTSTUFF = ldgram.c ldgram.h ldlex.c |
ab57b174 ILT |
757 | diststuff: $(LDDISTSTUFF) |
758 | ||
759 | mostlyclean: | |
f40d9bc2 | 760 | -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp] config.log |
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 | 765 | clean: mostlyclean |
1e45c4c3 | 766 | -rm -f $(LD_PROG) configdoc.texi |
417ced0d | 767 | distclean: clean |
f40d9bc2 ILT |
768 | -rm -f Makefile config.status TAGS site.exp site.bak config.cache |
769 | -rm -f config.h stamp-h | |
770 | -rm -rf ldscripts | |
4977f3b4 ILT |
771 | maintainer-clean realclean: clean distclean |
772 | @echo "This command is intended for maintainers to use;" | |
773 | @echo "it deletes files that may require special tools to rebuild." | |
ab57b174 | 774 | -rm -f $(LDDISTSTUFF) |
eb02fd64 | 775 | |
4a6afc88 ILT |
776 | .PHONY: diststuff mostlyclean clean distclean realclean |
777 | ||
778 | lintlog:$(LINTSOURCES) Makefile | |
2ee11735 | 779 | $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ |
eb02fd64 RP |
780 | | grep -v "pointer casts may be troublesome" \ |
781 | | grep -v "possible pointer alignment problem" \ | |
782 | | grep -v "ignore" \ | |
783 | | grep -v "conversion from long may lose accuracy" \ | |
784 | | grep -v "warning: constant argument to NOT" \ | |
785 | | grep -v "enumeration type clash, operator CAST" \ | |
786 | | grep -v "warning: constant in conditional context"\ | |
787 | | grep -v "archive\.c" | |
788 | ||
789 | ||
cbb5c2d1 DM |
790 | TAGS: |
791 | etags -t $(srcdir)/*.[chly] *.[chly] | |
eb02fd64 | 792 | |
eb02fd64 | 793 | |
91b3a2b6 | 794 | install: |
8ddef552 DM |
795 | $(INSTALL_XFORM) ld.new $(bindir)/ld |
796 | $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1 | |
173a0c3d DM |
797 | for f in ldscripts/*; do \ |
798 | $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \ | |
d360d135 | 799 | done |
208bc89e | 800 | -n=`echo ld | sed $(program_transform_name)`; \ |
56409445 | 801 | rm -f $(tooldir)/bin/ld; \ |
188ce705 | 802 | ln $(bindir)/$$n $(tooldir)/bin/ld >/dev/null 2>/dev/null \ |
e357065c | 803 | || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld |
e06ba18d | 804 | |
db0a7149 | 805 | install-info: ld.info |
82ebe9a2 KR |
806 | if [ -r ld.info ]; then \ |
807 | dir=. ; \ | |
808 | else \ | |
809 | dir=$(srcdir) ; \ | |
810 | fi ; \ | |
811 | for i in `cd $$dir ; echo ld.info*` ; do \ | |
812 | $(INSTALL_DATA) $$dir/$$i $(infodir)/$$i ; \ | |
afe3aa73 RP |
813 | done |
814 | ||
12fa72d4 SC |
815 | clean-info: |
816 | -rm -rf *.info* | |
817 | ||
4a6afc88 | 818 | .PHONY: install install-info clean-info |
eb02fd64 | 819 | |
4a6afc88 ILT |
820 | # Targets to rebuild dependencies in this Makefile. |
821 | # Have to get rid of .dep1 here so that "$?" later includes all of $(CFILES). | |
208bc89e | 822 | .dep: dep.sed $(CFILES) $(HFILES) $(GENERATED_CFILES) $(GENERATED_HFILES) config.h |
4a6afc88 ILT |
823 | rm -f .dep1 |
824 | $(MAKE) DEP=$(DEP) .dep1 | |
825 | sed -f dep.sed <.dep1 >.dep | |
eb02fd64 | 826 | |
4a6afc88 ILT |
827 | # This rule really wants a mkdep that runs "gcc -MM". |
828 | .dep1: $(CFILES) $(GENERATED_CFILES) | |
829 | rm -f .dep2 | |
830 | echo '# DO NOT DELETE THIS LINE -- mkdep uses it.' > .dep2 | |
831 | $(DEP) -f .dep2 $(ALL_CFLAGS) $? | |
832 | $(srcdir)/../move-if-change .dep2 .dep1 | |
eb02fd64 | 833 | |
4a6afc88 ILT |
834 | dep.sed: dep-in.sed config.status |
835 | sed <$(srcdir)/dep-in.sed >dep.sed \ | |
836 | -e 's!@INCDIR@!$(INCDIR)!' \ | |
d66c832b | 837 | -e 's!@SRCDIR@!$(srcdir)!' |
eb02fd64 | 838 | |
4a6afc88 ILT |
839 | dep: .dep |
840 | sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < Makefile > tmp-Makefile | |
841 | cat .dep >> tmp-Makefile | |
842 | $(srcdir)/../move-if-change tmp-Makefile Makefile | |
239d28f3 | 843 | |
4a6afc88 ILT |
844 | dep-in: .dep |
845 | sed -e '/^..DO NOT DELETE THIS LINE/,$$d' < $(srcdir)/Makefile.in > tmp-Makefile.in | |
846 | cat .dep >> tmp-Makefile.in | |
847 | $(srcdir)/../move-if-change tmp-Makefile.in $(srcdir)/Makefile.in | |
848 | ||
849 | .PHONY: dep dep-in | |
239d28f3 | 850 | |
eb02fd64 RP |
851 | # Dummy target to force execution of dependent targets. |
852 | # | |
e7921bd4 | 853 | force: |
eb02fd64 | 854 | |
4a6afc88 | 855 | .PHONY: force |
eb02fd64 | 856 | |
d66c832b ILT |
857 | Makefile: Makefile.in config.status |
858 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status | |
859 | ||
860 | config.h: stamp-h ; @true | |
ef346f1a ILT |
861 | stamp-h: config.in config.status |
862 | CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status | |
d66c832b | 863 | |
ed753c20 | 864 | config.status: configure configure.host configure.tgt |
d66c832b | 865 | $(SHELL) ./config.status --recheck |
eb02fd64 | 866 | |
4a6afc88 ILT |
867 | # What appears below is generated by a hacked mkdep using gcc -MM. |
868 | ||
869 | # DO NOT DELETE THIS LINE -- mkdep uses it. | |
870 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. | |
871 | ||
dd37f215 | 872 | ldctor.o: ldctor.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 873 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
4a6afc88 | 874 | $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldmisc.h \ |
fb5b11ee | 875 | ldgram.h ldmain.h ldctor.h |
dd37f215 | 876 | ldemul.o: ldemul.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b ILT |
877 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
878 | ld.h ldemul.h ldmisc.h ldexp.h ldlang.h ldfile.h ldmain.h \ | |
879 | ldemul-list.h | |
dd37f215 | 880 | ldexp.o: ldexp.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 881 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
4a6afc88 ILT |
882 | $(INCDIR)/bfdlink.h ld.h ldmain.h ldmisc.h ldexp.h \ |
883 | ldgram.h ldlang.h | |
dd37f215 | 884 | ldfile.o: ldfile.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 885 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
65d22248 C |
886 | $(INCDIR)/bfdlink.h ld.h ldmisc.h ldexp.h ldlang.h \ |
887 | ldfile.h ldmain.h ldgram.h ldlex.h ldemul.h | |
dd37f215 | 888 | ldlang.o: ldlang.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 889 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
4725fb48 ILT |
890 | $(INCDIR)/libiberty.h $(INCDIR)/bfdlink.h ld.h ldmain.h \ |
891 | ldgram.h ldexp.h ldlang.h ldemul.h ldlex.h ldmisc.h \ | |
892 | ldctor.h ldfile.h | |
dd37f215 | 893 | ldmain.o: ldmain.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 894 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
65d22248 | 895 | $(INCDIR)/libiberty.h $(INCDIR)/progress.h $(INCDIR)/bfdlink.h \ |
d66c832b ILT |
896 | ld.h ldmain.h ldmisc.h ldwrite.h ldgram.h ldexp.h ldlang.h \ |
897 | ldemul.h ldlex.h ldfile.h ldctor.h | |
dd37f215 | 898 | ldmisc.o: ldmisc.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 899 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
4725fb48 ILT |
900 | ld.h ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldmain.h \ |
901 | ldfile.h | |
dd37f215 | 902 | ldver.o: ldver.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 903 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
4a6afc88 | 904 | ld.h ldver.h ldemul.h ldmain.h |
dd37f215 | 905 | ldwrite.o: ldwrite.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b | 906 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
4a6afc88 ILT |
907 | $(INCDIR)/bfdlink.h ld.h ldexp.h ldlang.h ldwrite.h \ |
908 | ldmisc.h ldgram.h ldmain.h | |
dd37f215 | 909 | lexsup.o: lexsup.c ../bfd/bfd.h $(INCDIR)/ansidecl.h \ |
d66c832b ILT |
910 | $(INCDIR)/obstack.h sysdep.h config.h $(INCDIR)/fopen-same.h \ |
911 | $(INCDIR)/getopt.h $(INCDIR)/bfdlink.h ld.h ldmain.h \ | |
912 | ldmisc.h ldexp.h ldlang.h ldgram.h ldlex.h ldfile.h \ | |
913 | ldver.h ldemul.h | |
dd37f215 | 914 | mri.o: mri.c ../bfd/bfd.h $(INCDIR)/ansidecl.h $(INCDIR)/obstack.h \ |
d66c832b | 915 | sysdep.h config.h $(INCDIR)/fopen-same.h ld.h ldexp.h \ |
4a6afc88 | 916 | ldlang.h ldmisc.h mri.h ldgram.h |
dd37f215 | 917 | ldgram.o: ldgram.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 ldexp.h ldver.h ldlang.h ldemul.h \ |
920 | ldfile.h ldmisc.h ldmain.h mri.h ldlex.h | |
d66c832b ILT |
921 | ldlex.o: ldlex.c ../bfd/bfd.h $(INCDIR)/obstack.h sysdep.h \ |
922 | config.h $(INCDIR)/fopen-same.h ld.h ldgram.h ldmisc.h \ | |
923 | ldexp.h ldlang.h ldfile.h ldlex.h ldmain.h | |
239d28f3 SC |
924 | |
925 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |