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