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