Commit | Line | Data |
---|---|---|
ce4d59e2 | 1 | # Makefile for the GNU linker ld (version 2) |
12fa72d4 | 2 | # Copyright (C) 1989-1992 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 | |
21 | srcdir = . | |
22 | ||
e06ba18d PB |
23 | prefix = /usr/local |
24 | ||
0bb95ac8 | 25 | program_transform_name = |
12fa72d4 SC |
26 | exec_prefix = $(prefix) |
27 | bindir = $(exec_prefix)/bin | |
28 | libdir = $(exec_prefix)/lib | |
034351e3 | 29 | tooldir = $(exec_prefix)/$(target_alias) |
e06ba18d | 30 | datadir = $(prefix)/lib |
12fa72d4 | 31 | mandir = $(prefix)/man |
e06ba18d PB |
32 | man1dir = $(mandir)/man1 |
33 | man2dir = $(mandir)/man2 | |
34 | man3dir = $(mandir)/man3 | |
35 | man4dir = $(mandir)/man4 | |
36 | man5dir = $(mandir)/man5 | |
37 | man6dir = $(mandir)/man6 | |
38 | man7dir = $(mandir)/man7 | |
39 | man8dir = $(mandir)/man8 | |
40 | man9dir = $(mandir)/man9 | |
12fa72d4 | 41 | infodir = $(prefix)/info |
e06ba18d PB |
42 | includedir = $(prefix)/include |
43 | docdir = $(datadir)/doc | |
173a0c3d | 44 | # We put the scripts in the directory $(scriptdir)/ldscripts. |
559d7baf RP |
45 | # We can't put the scripts in $(datadir) because the SEARCH_DIR |
46 | # directives need to be different for native and cross linkers. | |
173a0c3d | 47 | scriptdir = $(tooldir)/lib |
e06ba18d | 48 | |
2cbe4c5f HS |
49 | gcclibdir = $(libdir)/gcc/$(target_alias) |
50 | ||
e06ba18d PB |
51 | SHELL = /bin/sh |
52 | ||
e0d005f2 | 53 | INSTALL = `cd $(srcdir); pwd`/../install.sh -c |
e06ba18d PB |
54 | INSTALL_PROGRAM = $(INSTALL) |
55 | INSTALL_DATA = $(INSTALL) | |
5ebaf24b | 56 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' |
c97b9003 DZ |
57 | INSTALL_XFORM1 = $(INSTALL_XFORM) -b=.1 |
58 | ||
e06ba18d PB |
59 | AR = ar |
60 | AR_FLAGS = qv | |
77b19d3d | 61 | CFLAGS = -g |
e06ba18d | 62 | MAKEINFO = makeinfo |
2412a768 | 63 | TEXI2DVI = texi2dvi |
e06ba18d | 64 | RANLIB = ranlib |
2412a768 | 65 | CC_FOR_BUILD=$(CC) |
bf3acf44 | 66 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
2df68136 | 67 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex ; else echo flex ; fi` |
8c32cf6e | 68 | |
12fa72d4 | 69 | #version=/`./../gcc/gcc -dumpversion` |
092df318 | 70 | version= |
8c32cf6e | 71 | |
ee17cac9 PB |
72 | # Seach path to override the default search path for -lfoo libraries. |
73 | # If LIB_PATH is empty, the ones in the script (if any) are left alone. | |
917bffa7 PB |
74 | # (The default is usually /lib:usr/lib:/usr/local/lib, unless building |
75 | # a cross-linker, in which case the default is empty. See genscripts.sh.) | |
ee17cac9 PB |
76 | # Otherwise, they are replaced with the ones given in LIB_PATH, |
77 | # which may have the form: LIB_PATH=/lib:/usr/local/lib | |
78 | LIB_PATH = | |
79 | ||
2ee11735 | 80 | BASEDIR = ../.. |
d6e467b4 | 81 | INCLUDE = $(srcdir)/../include |
559d7baf | 82 | INCLUDES = -I. -I$(srcdir) -I$(srcdir)/../bfd -I../bfd -I$(INCLUDE) |
2ee11735 | 83 | |
2412a768 RP |
84 | # What version of the manual to build |
85 | DOCVER = gen | |
86 | ||
8073190b | 87 | # Where to find texinfo.tex to format docn with TeX |
8d317d2a RP |
88 | TEXIDIR = $(srcdir)/../texinfo/fsf |
89 | ||
10a69a37 | 90 | # Whether to get roff to put indexing entries on stderr |
954ac2ea RP |
91 | TEXI2OPT = |
92 | # You neeed this to generate ld-index.ms (or .mm or .me) | |
93 | # TEXI2OPT = -i | |
8073190b | 94 | |
e06ba18d PB |
95 | TEXI2ROFF=texi2roff |
96 | ||
8073190b RP |
97 | # Which roff program to use to generate index for texi2roff'd doc |
98 | ROFF = groff | |
99 | ||
5cdea2ac SC |
100 | #stuff for self hosting (can be overridden in config file). |
101 | HOSTING_CRT0=/lib/crt0.o | |
8ddef552 DM |
102 | HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else gcc -print-libgcc-file-name; fi` -lc |
103 | HOSTING_EMU=-m $(EMUL) | |
5cdea2ac | 104 | |
c97b9003 DZ |
105 | C++ = g++ -fgnu-linker |
106 | ||
58bf66f9 KR |
107 | all: |
108 | ||
7e5c1057 | 109 | ### Host, target, and site specific Makefile fragments come in here. |
63545898 | 110 | #### |
2ee11735 | 111 | |
2ee11735 RP |
112 | LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) |
113 | ||
565c93e9 DM |
114 | # The .cc suffix is used by `make check'. |
115 | ||
116 | .SUFFIXES: .y $(SUFFIXES) .cc | |
117 | ||
173a0c3d DM |
118 | # Suppress smart makes who think they know how to automake Yacc files |
119 | .y.c: | |
120 | ||
565c93e9 DM |
121 | .cc.o: |
122 | $(C++) -c -I$(srcdir) $(CFLAGS) $< | |
123 | ||
77b19d3d | 124 | .c.o: |
8ddef552 | 125 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(CFLAGS) $< |
c97b9003 | 126 | |
eb02fd64 RP |
127 | # go directly to ld.new in case this ld isn't capable of |
128 | # linking native object on this host. It can be renamed on | |
129 | # install. | |
e7921bd4 | 130 | LD_PROG = ld.new |
f78e2569 | 131 | |
eb02fd64 | 132 | # for self hosting |
12fa72d4 SC |
133 | BFDLIB=./../bfd/libbfd.a |
134 | LIBIBERTY=./../libiberty/libiberty.a | |
eb02fd64 | 135 | |
ab57b174 | 136 | ALL_EMULATIONS=em_lnk960.o em_sun3.o em_i386aout.o em_go32.o \ |
63545898 | 137 | em_m88kbcs.o em_a29k.o em_news.o em_hp300bsd.o em_hp3hpux.o \ |
4ab3a31f | 138 | em_h8300.o em_h8300h.o em_ebmon29k.o em_sun4.o em_gld960.o \ |
034351e3 | 139 | em_m68kcoff.o em_st2000.o em_sa29200.o \ |
e637dcf0 | 140 | em_vanilla.o em_i386coff.o em_z8ksim.o em_mipslit.o em_i386bsd.o \ |
8ddef552 | 141 | em_mipsbig.o em_mipsbsd.o em_mipsidt.o em_vax.o em_h8500.o \ |
58bf66f9 KR |
142 | em_hppaosf.o em_mipsidtl.o em_sh.o \ |
143 | $(OTHER_EMULATIONS) | |
7e5c1057 | 144 | |
1053ea99 | 145 | EMULATION_OFILES=${ALL_EMULATIONS} |
7e5c1057 | 146 | |
119afd7b | 147 | OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \ |
7e5c1057 | 148 | ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \ |
fc60e4f7 | 149 | ldfile.o relax.o lderror.o ${EMULATION_OFILES} |
eb02fd64 | 150 | |
ce4d59e2 SC |
151 | HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \ |
152 | ldsym.h ldctor.h ldlang.h ldexp.h \ | |
239d28f3 | 153 | ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h |
eb02fd64 RP |
154 | |
155 | MANSOURCES=ld.tex | |
156 | ||
119afd7b | 157 | LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \ |
63545898 | 158 | em_gld.c em_sun3.c em_go32.c em_m88k.c em_ebmon29k.c em_hppaosf.c \ |
2e2bf962 | 159 | ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \ |
fc60e4f7 | 160 | relax.c lderror.c |
eb02fd64 | 161 | |
ab57b174 | 162 | GENERATED_SOURCES=ldgram.c ldlex.c em_*.c ldemul-list.h |
7e5c1057 | 163 | GENERATED_HEADERS=ldgram.h ldemul-list.h |
eb02fd64 | 164 | |
cc964c6f | 165 | LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h |
eb02fd64 | 166 | |
2ee11735 | 167 | BFDSOURCES=../../bfd/common/*.c |
eb02fd64 RP |
168 | |
169 | SOURCES= $(LDSOURCES) $(BFDSOURCES) | |
170 | LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) | |
171 | ||
173a0c3d | 172 | STAGESTUFF = ldscripts/* $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) |
2ee11735 | 173 | |
42b5c739 | 174 | all: $(LD_PROG) |
e06ba18d PB |
175 | |
176 | info: ld.info | |
2ee11735 | 177 | |
173a0c3d | 178 | ldgram.h ldgram.c: ldgram.y |
5ff21fa5 | 179 | $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y |
31e54f5d RP |
180 | mv -f y.tab.c ldgram.c |
181 | mv -f y.tab.h ldgram.h | |
cc964c6f | 182 | |
42b5c739 ILT |
183 | DEF_EMUL = ` if [ -z "$(EMUL)" ] ; then \ |
184 | echo "you must set a default emulation" 1>&2 ; \ | |
185 | exit 1 ; \ | |
186 | else \ | |
187 | echo -DDEFAULT_EMULATION='"$(EMUL)"' ; \ | |
188 | fi` | |
42b5c739 | 189 | |
d20fb445 | 190 | ldmain.o: ldmain.c |
ff76a7db | 191 | $(CC) -c $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(DEF_EMUL) -DSCRIPTDIR='"$(scriptdir)"' $(CFLAGS) $< |
7e5c1057 | 192 | |
42b5c739 | 193 | ldemul-list.h: |
7e5c1057 PB |
194 | (echo "/* This file is automatically generated. DO NOT EDIT! */";\ |
195 | for f in `echo " " ${EMULATION_OFILES} "" \ | |
ab57b174 | 196 | | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \ |
7e5c1057 PB |
197 | echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \ |
198 | done;\ | |
199 | echo "";\ | |
200 | echo "#define EMULATION_LIST \\";\ | |
201 | for f in `echo " " ${EMULATION_OFILES} "" \ | |
ab57b174 | 202 | | sed -e 's/em_/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \ |
7e5c1057 PB |
203 | echo " &ld_$${f}_emulation, \\"; \ |
204 | done;\ | |
205 | echo " 0") >ldemul-list.h | |
206 | ||
207 | ldemul.o: ldemul-list.h | |
d20fb445 | 208 | |
42b5c739 | 209 | ldlex.c: ldlex.l ldgram.h |
5ff21fa5 PB |
210 | $(LEX) -I -Cem $(srcdir)/ldlex.l |
211 | mv lex.yy.c ldlex.c | |
19b03b7a | 212 | |
ab57b174 | 213 | # These all start with em_ so 'make clean' can find them. |
c61b4184 | 214 | |
ff76a7db | 215 | GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${libdir} ${host_alias} ${target_alias} |
8ddef552 | 216 | GEN_DEPENDS=$(srcdir)/genscripts.sh |
7e5c1057 | 217 | |
8ddef552 DM |
218 | em_sun4.c: $(srcdir)/emulparams/sun4.sh \ |
219 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
7e5c1057 | 220 | ${GENSCRIPTS} sun4.sh |
8ddef552 DM |
221 | em_sun3.c: $(srcdir)/emulparams/sun3.sh \ |
222 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
7e5c1057 | 223 | ${GENSCRIPTS} sun3.sh |
8ddef552 DM |
224 | em_go32.c: $(srcdir)/emulparams/go32.sh \ |
225 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
9d1fe8a4 | 226 | ${GENSCRIPTS} go32.sh |
8ddef552 DM |
227 | em_news.c: $(srcdir)/emulparams/news.sh \ |
228 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
7e5c1057 | 229 | ${GENSCRIPTS} news.sh |
8ddef552 DM |
230 | em_vax.c: $(srcdir)/emulparams/vax.sh \ |
231 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
034351e3 | 232 | ${GENSCRIPTS} vax.sh |
8ddef552 DM |
233 | em_hp300bsd.c: $(srcdir)/emulparams/hp300bsd.sh \ |
234 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
1584d069 | 235 | ${GENSCRIPTS} hp300bsd.sh |
8ddef552 DM |
236 | em_hp3hpux.c: $(srcdir)/emulparams/hp3hpux.sh \ |
237 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
63545898 | 238 | ${GENSCRIPTS} hp3hpux.sh |
8ddef552 DM |
239 | em_hppaosf.c: $(srcdir)/emulparams/hppaosf.sh \ |
240 | $(srcdir)/emultempl/hppaosf.em $(srcdir)/scripttempl/hppaosf.sc ${GEN_DEPENDS} | |
63545898 | 241 | ${GENSCRIPTS} hppaosf.sh |
8ddef552 DM |
242 | em_i386aout.c: $(srcdir)/emulparams/i386aout.sh \ |
243 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
7e5c1057 | 244 | ${GENSCRIPTS} i386aout.sh |
8ddef552 DM |
245 | em_ebmon29k.c: $(srcdir)/emulparams/ebmon29k.sh \ |
246 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/ebmon29k.sc ${GEN_DEPENDS} | |
7e5c1057 | 247 | ${GENSCRIPTS} ebmon29k.sh |
8ddef552 DM |
248 | em_sa29200.c: $(srcdir)/emulparams/sa29200.sh \ |
249 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sa29200.sc ${GEN_DEPENDS} | |
fe3e4dfc | 250 | ${GENSCRIPTS} sa29200.sh |
8ddef552 DM |
251 | em_a29k.c: $(srcdir)/emulparams/a29k.sh \ |
252 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/a29k.sc ${GEN_DEPENDS} | |
7e5c1057 | 253 | ${GENSCRIPTS} a29k.sh |
8ddef552 | 254 | em_m88kbcs.c: $(srcdir)/emulparams/m88kbcs.sh \ |
9edc5b2e | 255 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m88kbcs.sc ${GEN_DEPENDS} |
7e5c1057 | 256 | ${GENSCRIPTS} m88kbcs.sh |
8ddef552 DM |
257 | em_h8300.c: $(srcdir)/emulparams/h8300.sh \ |
258 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300.sc ${GEN_DEPENDS} | |
259 | ${GENSCRIPTS} h8300.sh | |
4ab3a31f DE |
260 | em_h8300h.c: $(srcdir)/emulparams/h8300h.sh \ |
261 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8300h.sc ${GEN_DEPENDS} | |
262 | ${GENSCRIPTS} h8300h.sh | |
8ddef552 DM |
263 | em_h8500.c: $(srcdir)/emulparams/h8500.sh \ |
264 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/h8500.sc ${GEN_DEPENDS} | |
265 | ${GENSCRIPTS} h8500.sh | |
266 | em_sh.c: $(srcdir)/emulparams/sh.sh \ | |
267 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/sh.sc ${GEN_DEPENDS} | |
034351e3 | 268 | ${GENSCRIPTS} sh.sh |
8ddef552 DM |
269 | em_st2000.c: $(srcdir)/emulparams/st2000.sh \ |
270 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/st2000.sc ${GEN_DEPENDS} | |
119afd7b | 271 | ${GENSCRIPTS} st2000.sh |
8ddef552 DM |
272 | em_z8ksim.c: $(srcdir)/emulparams/z8ksim.sh \ |
273 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/z8ksim.sc ${GEN_DEPENDS} | |
22a78f0d | 274 | ${GENSCRIPTS} z8ksim.sh |
8ddef552 DM |
275 | em_vanilla.c: $(srcdir)/emulparams/vanilla.sh \ |
276 | $(srcdir)/emultempl/vanilla.em $(srcdir)/scripttempl/vanilla.sc ${GEN_DEPENDS} | |
7e5c1057 | 277 | ${GENSCRIPTS} vanilla.sh |
8ddef552 DM |
278 | em_lnk960.c: $(srcdir)/emulparams/lnk960.sh \ |
279 | $(srcdir)/emultempl/lnk960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} | |
7e5c1057 | 280 | ${GENSCRIPTS} lnk960.sh |
8ddef552 DM |
281 | em_gld960.c: $(srcdir)/emulparams/gld960.sh \ |
282 | $(srcdir)/emultempl/gld960.em $(srcdir)/scripttempl/i960.sc ${GEN_DEPENDS} | |
7e5c1057 | 283 | ${GENSCRIPTS} gld960.sh |
8ddef552 DM |
284 | em_m68kcoff.c: $(srcdir)/emulparams/m68kcoff.sh \ |
285 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/m68kcoff.sc ${GEN_DEPENDS} | |
ab57b174 | 286 | ${GENSCRIPTS} m68kcoff.sh |
8ddef552 DM |
287 | em_i386coff.c: $(srcdir)/emulparams/i386coff.sh \ |
288 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/i386coff.sc ${GEN_DEPENDS} | |
99e6298a | 289 | ${GENSCRIPTS} i386coff.sh |
8ddef552 DM |
290 | em_mipslit.c: $(srcdir)/emulparams/mipslit.sh \ |
291 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
42b5c739 | 292 | ${GENSCRIPTS} mipslit.sh |
8ddef552 DM |
293 | em_i386bsd.c: $(srcdir)/emulparams/i386bsd.sh \ |
294 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
e637dcf0 | 295 | ${GENSCRIPTS} i386bsd.sh |
8ddef552 DM |
296 | em_mipsbig.c: $(srcdir)/emulparams/mipsbig.sh \ |
297 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
e637dcf0 | 298 | ${GENSCRIPTS} mipsbig.sh |
8ddef552 DM |
299 | em_mipsbsd.c: $(srcdir)/emulparams/mipsbsd.sh \ |
300 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/aout.sc ${GEN_DEPENDS} | |
e637dcf0 | 301 | ${GENSCRIPTS} mipsbsd.sh |
8ddef552 DM |
302 | em_mipsidt.c: $(srcdir)/emulparams/mipsidt.sh \ |
303 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
ce7d4b0d | 304 | ${GENSCRIPTS} mipsidt.sh |
8ddef552 DM |
305 | em_mipsidtl.c: $(srcdir)/emulparams/mipsidtl.sh \ |
306 | $(srcdir)/emultempl/generic.em $(srcdir)/scripttempl/mips.sc ${GEN_DEPENDS} | |
98f3d1af | 307 | ${GENSCRIPTS} mipsidtl.sh |
eb02fd64 | 308 | |
e77463a1 | 309 | $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY) |
8ddef552 DM |
310 | $(CC) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) $(CFLAGS) |
311 | ||
312 | ||
313 | # CHECK TARGETS | |
314 | ||
315 | check: bootstrap check-cdtest | |
316 | installcheck: | |
e7921bd4 | 317 | |
7e5c1057 | 318 | # Rules for testing by relinking ld itself. |
eb02fd64 | 319 | |
7e5c1057 | 320 | ld-partial.o: ld.new |
a04f1d00 | 321 | ./ld.new $(HOSTING_EMU) -o ld-partial.o -r $(OFILES) |
7e5c1057 | 322 | ld1: ld-partial.o |
a04f1d00 | 323 | ./ld.new $(HOSTING_EMU) -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 324 | |
7e5c1057 | 325 | ld1-full: ld.new |
a04f1d00 | 326 | ./ld.new $(HOSTING_EMU) -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 327 | |
d20fb445 | 328 | ld2: ld1 |
a04f1d00 | 329 | ./ld1 $(HOSTING_EMU) -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
60048a2c | 330 | |
eb02fd64 | 331 | ld3: ld2 |
a04f1d00 | 332 | ./ld2 $(HOSTING_EMU) -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 333 | |
d20fb445 SC |
334 | bootstrap: ld3 |
335 | cmp ld2 ld3 | |
336 | ||
8ddef552 DM |
337 | # A test program for C++ constructors and destructors. |
338 | ||
ef868186 | 339 | cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o ld.new |
a04f1d00 | 340 | ./ld.new $(HOSTING_EMU) -o cdtest $(HOSTING_CRT0) \ |
917bffa7 PB |
341 | cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS) |
342 | ||
343 | check-cdtest: cdtest $(srcdir)/cdtest.exp | |
344 | ./cdtest >cdtest.out | |
345 | diff $(srcdir)/cdtest.exp cdtest.out | |
346 | ||
8073190b | 347 | # DOCUMENTATION TARGETS |
2412a768 RP |
348 | # Manual configuration file; not usually attached to normal configuration, |
349 | # because almost all configs use "gen" version of manual. | |
350 | # Set DOCVER above to change. | |
351 | configdoc.texi: ${DOCVER}-doc.texi | |
034351e3 PB |
352 | ln -s ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \ |
353 | ln ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi || \ | |
354 | cp ${srcdir}/${DOCVER}-doc.texi ./configdoc.texi | |
2412a768 | 355 | |
8073190b | 356 | # TeX output |
2412a768 | 357 | dvi: ld.dvi |
9c7810d6 | 358 | ld.dvi: $(srcdir)/ld.texinfo |
2412a768 RP |
359 | $(TEXI2DVI) $(srcdir)/ld.texinfo |
360 | ||
4b91c519 | 361 | ldint.dvi: $(srcdir)/ldint.texinfo |
2412a768 | 362 | $(TEXI2DVI) $(srcdir)/ldint.texinfo |
8d317d2a | 363 | |
8073190b | 364 | # info file for online browsing |
2412a768 | 365 | ld.info: $(srcdir)/ld.texinfo configdoc.texi |
e7569ec8 | 366 | $(MAKEINFO) -I$(srcdir)/../bfd/doc -o ld.info $(srcdir)/ld.texinfo |
eb02fd64 | 367 | |
4b91c519 PB |
368 | ldint.info: $(srcdir)/ldint.texinfo |
369 | $(MAKEINFO) -o ldint.info $(srcdir)/ldint.texinfo | |
370 | ||
954ac2ea | 371 | #separate targets for "ms", "me", and "mm" forms of roff doc |
e06ba18d PB |
372 | # Try to use a recent texi2roff. v2 was put on prep in jan91. |
373 | # If you want an index, see texi2roff doc for postprocessing | |
374 | # and add -i to texi2roff invocations below. | |
375 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
376 | # correspondint -e lines when later texi2roff's are current) | |
377 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
378 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
379 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
380 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
381 | ||
9c7810d6 | 382 | ld.ms: $(srcdir)/ld.texinfo |
8073190b RP |
383 | sed -e '/\\input texinfo/d' \ |
384 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
385 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
386 | -e '/^@c/d' \ | |
387 | -e 's/{.*,,/{/' \ | |
388 | -e 's/@ / /g' \ | |
389 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
390 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 391 | $(srcdir)/ld.texinfo | \ |
e06ba18d PB |
392 | $(TEXI2ROFF) $(TEXI2OPT) -ms | \ |
393 | sed -e 's/---/\\(em/g' \ | |
394 | >>ld.ms | |
8073190b RP |
395 | |
396 | # index for roff output | |
397 | ld-index.ms: ld.ms | |
398 | $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \ | |
399 | sed -e '/: warning:/d' | \ | |
400 | texi2index >ld-index.ms | |
401 | ||
954ac2ea | 402 | # roff output (-mm) |
9c7810d6 | 403 | ld.mm: $(srcdir)/ld.texinfo |
954ac2ea RP |
404 | sed -e '/\\input texinfo/d' \ |
405 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
406 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
407 | -e '/^@c/d' \ | |
9c7810d6 RP |
408 | -e 's/{.*,,/{/' \ |
409 | -e '/@noindent/d' \ | |
e06ba18d PB |
410 | -e 's/@ / /g' \ |
411 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
412 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 413 | $(srcdir)/ld.texinfo | \ |
e06ba18d | 414 | $(TEXI2ROFF) $(TEXI2OPT) -mm | \ |
9c7810d6 RP |
415 | sed -e 's/---/\\(em/g' \ |
416 | >ld.mm | |
954ac2ea RP |
417 | |
418 | # index for roff output | |
419 | ld-index.mm: ld.mm | |
420 | $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \ | |
421 | sed -e '/: warning:/d' | \ | |
422 | texi2index >ld-index.mm | |
423 | ||
424 | # roff output (-me) | |
9c7810d6 | 425 | ld.me: $(srcdir)/ld.texinfo |
954ac2ea RP |
426 | sed -e '/\\input texinfo/d' \ |
427 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
428 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
429 | -e '/^@c/d' \ | |
430 | -e 's/{.*,,/{/' \ | |
431 | -e 's/@ / /g' \ | |
432 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
433 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 434 | $(srcdir)/ld.texinfo | \ |
e06ba18d PB |
435 | $(TEXI2ROFF) $(TEXI2OPT) -me | \ |
436 | sed -e 's/---/\\(em/g' \ | |
437 | >>ld.me | |
954ac2ea RP |
438 | |
439 | # index for roff output | |
440 | ld-index.me: ld.me | |
441 | $(ROFF) -me ld.me 2>&1 1>/dev/null | \ | |
442 | sed -e '/: warning:/d' | \ | |
443 | texi2index >ld-index.me | |
444 | ||
445 | ||
cc964c6f SC |
446 | ldlex.o: ldlex.c ldgram.h |
447 | ldgram.o: ldgram.c | |
42b5c739 ILT |
448 | ldexp.o: ldexp.c ldgram.h |
449 | ldctor.o: ldctor.c ldgram.h | |
450 | ldlang.o: ldlang.c ldgram.h | |
451 | ldmain.o: ldmain.c ldgram.h | |
452 | ldwrite.o: ldwrite.c ldgram.h | |
453 | lexsup.o: lexsup.c ldgram.h | |
454 | mri.o: mri.c ldgram.h | |
455 | relax.o: relax.c ldgram.h | |
eb02fd64 | 456 | |
8ddef552 | 457 | h8300.o:h8300.c |
9d1fe8a4 | 458 | h8300xray.o:h8300xray.c |
119afd7b | 459 | st2000.o:st2000.c |
22a78f0d | 460 | z8ksim.o:z8ksim.c |
565a4c76 | 461 | |
e7921bd4 | 462 | stage1: force |
e06ba18d | 463 | -mkdir stage1 |
ab57b174 | 464 | -mv -f $(STAGESTUFF) $(LD_PROG) stage1 |
e06ba18d | 465 | -(cd stage1 ; ln -s $(LD_PROG) ld) |
f78e2569 | 466 | |
e7921bd4 | 467 | stage2: force |
e06ba18d | 468 | -mkdir stage2 |
ab57b174 | 469 | -mv -f $(STAGESTUFF) $(LD_PROG) stage2 |
e06ba18d | 470 | -(cd stage2 ; ln -s $(LD_PROG) ld) |
f78e2569 | 471 | |
e7921bd4 | 472 | stage3: force |
e06ba18d | 473 | -mkdir stage3 |
ab57b174 | 474 | -mv -f $(STAGESTUFF) $(LD_PROG) stage3 |
e06ba18d | 475 | -(cd stage3 ; ln -s $(LD_PROG) ld) |
eb02fd64 | 476 | |
e46cdcdd RP |
477 | against=stage2 |
478 | ||
479 | comparison: force | |
ab57b174 | 480 | for i in $(STAGESTUFF) $(LD_PROG) ; do cmp $$i $(against)/$$i ; done |
e46cdcdd | 481 | |
e7921bd4 | 482 | de-stage1: force |
e06ba18d PB |
483 | -(cd stage1 ; mv -f * ..) |
484 | -rm ld | |
485 | -rmdir stage1 | |
e7921bd4 RP |
486 | |
487 | de-stage2: force | |
e06ba18d PB |
488 | -(cd stage2 ; mv -f * ..) |
489 | -rm ld | |
490 | -rmdir stage2 | |
e7921bd4 RP |
491 | |
492 | de-stage3: force | |
e06ba18d PB |
493 | -(cd stage3 ; mv -f * ..) |
494 | -rm ld | |
495 | -rmdir stage3 | |
e7921bd4 | 496 | |
ab57b174 | 497 | # Stuff that should be included in a distribution: |
63545898 | 498 | LDDISTSTUFF=ldgram.c ldgram.h ldlex.c |
ab57b174 ILT |
499 | diststuff: $(LDDISTSTUFF) |
500 | ||
501 | mostlyclean: | |
502 | -rm -f $(STAGESTUFF) ld.?? ld.??? ldlex.[qp] | |
917bffa7 | 503 | -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out |
ab57b174 ILT |
504 | clean: mostlyclean |
505 | -rm -f $(LD_PROG) | |
506 | distclean: clean | |
173a0c3d | 507 | -rm -fr Makefile config.status TAGS sysdep.h ldscripts |
ab57b174 ILT |
508 | realclean: distclean |
509 | -rm -f $(LDDISTSTUFF) | |
eb02fd64 RP |
510 | |
511 | lintlog:$(SOURCES) Makefile | |
2ee11735 | 512 | $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ |
eb02fd64 RP |
513 | | grep -v "pointer casts may be troublesome" \ |
514 | | grep -v "possible pointer alignment problem" \ | |
515 | | grep -v "ignore" \ | |
516 | | grep -v "conversion from long may lose accuracy" \ | |
517 | | grep -v "warning: constant argument to NOT" \ | |
518 | | grep -v "enumeration type clash, operator CAST" \ | |
519 | | grep -v "warning: constant in conditional context"\ | |
520 | | grep -v "archive\.c" | |
521 | ||
522 | ||
523 | tags TAGS:$(SOURCES) $(HEADERS) | |
19b03b7a | 524 | etags -t $? |
eb02fd64 | 525 | |
eb02fd64 RP |
526 | |
527 | objdump:objdump.c | |
528 | ||
12fa72d4 | 529 | .PHONY: install |
91b3a2b6 | 530 | install: |
8ddef552 DM |
531 | $(INSTALL_XFORM) ld.new $(bindir)/ld |
532 | $(INSTALL_XFORM1) $(srcdir)/ld.1 $(man1dir)/ld.1 | |
173a0c3d DM |
533 | for f in ldscripts/*; do \ |
534 | $(INSTALL_DATA) $$f $(scriptdir)/$$f ; \ | |
d360d135 | 535 | done |
9cd039e7 | 536 | -n=`t='$(program_transform_name)'; echo ld | sed -e "" $$t`; \ |
56409445 ILT |
537 | rm -f $(tooldir)/bin/ld; \ |
538 | ln $(bindir)/$$n $(tooldir)/bin/ld \ | |
e357065c | 539 | || $(INSTALL_PROGRAM) ld.new $(tooldir)/bin/ld |
e06ba18d | 540 | |
91b3a2b6 | 541 | install-info: |
afe3aa73 | 542 | for i in ld.info* ; do \ |
e06ba18d | 543 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
afe3aa73 RP |
544 | done |
545 | ||
12fa72d4 SC |
546 | clean-info: |
547 | -rm -rf *.info* | |
548 | ||
eb02fd64 RP |
549 | #----------------------------------------------------------------------------- |
550 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
551 | # | |
552 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
553 | #----------------------------------------------------------------------------- | |
554 | ||
555 | ver960.c: FORCE | |
556 | rm -f ver960.c | |
557 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
558 | ||
559 | ||
560 | # This target should be invoked before building a new release. | |
561 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
562 | # | |
563 | roll: | |
564 | @V=`cat VERSION` ; \ | |
565 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
566 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
567 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
568 | rm -f VERSION ; \ | |
569 | echo $$V >VERSION ; \ | |
570 | echo Version $$V | |
571 | ||
239d28f3 | 572 | |
e1e5fbfc | 573 | dep: $(LDSOURCES) |
239d28f3 SC |
574 | mkdep $(CFLAGS) $? |
575 | ||
eb02fd64 RP |
576 | # Dummy target to force execution of dependent targets. |
577 | # | |
e7921bd4 | 578 | force: |
eb02fd64 RP |
579 | |
580 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
581 | # have the following string beginning in column 1: #__<hostname>__# | |
582 | # Original Makefile is backed up as 'Makefile.old'. | |
583 | # | |
584 | # Invoke with: make make HOST=xxx | |
585 | # | |
586 | make: | |
587 | -@if test $(HOST)x = x ; then \ | |
588 | echo '\aSpecify "make make HOST=???"'; \ | |
589 | exit 1; \ | |
590 | fi ; \ | |
591 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
592 | if test $$? = 0 ; then \ | |
593 | echo "\aMakefile has already been processed with 'make make'";\ | |
594 | exit 1; \ | |
595 | fi ; \ | |
596 | mv -f Makefile Makefile.old; \ | |
597 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
598 | echo "HOST=$(HOST)" >>Makefile ; \ | |
599 | echo >>Makefile ; \ | |
600 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
601 | ||
602 | #\f | |
603 | ||
f1eb48b6 | 604 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 605 | $(SHELL) ./config.status |
eb02fd64 | 606 | |
eb02fd64 | 607 | ### mode:fundamental *** |
e06ba18d | 608 | ### Local Variables: *** |
eb02fd64 RP |
609 | ### page-delimiter: "^#\f" *** |
610 | ### End: *** | |
611 | ### end of file | |
239d28f3 SC |
612 | |
613 | ||
614 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |