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