]>
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 | ||
12fa72d4 | 25 | program_prefix = |
b40f9c73 | 26 | program_suffix = |
12fa72d4 SC |
27 | exec_prefix = $(prefix) |
28 | bindir = $(exec_prefix)/bin | |
29 | libdir = $(exec_prefix)/lib | |
5cdea2ac | 30 | tooldir = $(bindir) |
e06ba18d | 31 | datadir = $(prefix)/lib |
12fa72d4 | 32 | mandir = $(prefix)/man |
e06ba18d PB |
33 | man1dir = $(mandir)/man1 |
34 | man2dir = $(mandir)/man2 | |
35 | man3dir = $(mandir)/man3 | |
36 | man4dir = $(mandir)/man4 | |
37 | man5dir = $(mandir)/man5 | |
38 | man6dir = $(mandir)/man6 | |
39 | man7dir = $(mandir)/man7 | |
40 | man8dir = $(mandir)/man8 | |
41 | man9dir = $(mandir)/man9 | |
12fa72d4 | 42 | infodir = $(prefix)/info |
e06ba18d PB |
43 | includedir = $(prefix)/include |
44 | docdir = $(datadir)/doc | |
45 | ||
2cbe4c5f HS |
46 | gcclibdir = $(libdir)/gcc/$(target_alias) |
47 | ||
e06ba18d PB |
48 | SHELL = /bin/sh |
49 | ||
50 | INSTALL = install -c | |
51 | INSTALL_PROGRAM = $(INSTALL) | |
52 | INSTALL_DATA = $(INSTALL) | |
e06ba18d PB |
53 | AR = ar |
54 | AR_FLAGS = qv | |
77b19d3d | 55 | CFLAGS = -g |
e06ba18d PB |
56 | MAKEINFO = makeinfo |
57 | RANLIB = ranlib | |
5ff21fa5 | 58 | HOST_CC=$(CC) |
bf3acf44 RP |
59 | BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi` |
60 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex -S../flex/flex.skel ; 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 |
2ee11735 | 75 | INCLUDES = -I. -I$(srcdir) -I$(INCLUDE) |
2ee11735 | 76 | |
8073190b | 77 | # Where to find texinfo.tex to format docn with TeX |
8d317d2a RP |
78 | TEXIDIR = $(srcdir)/../texinfo/fsf |
79 | ||
10a69a37 | 80 | # Whether to get roff to put indexing entries on stderr |
954ac2ea RP |
81 | TEXI2OPT = |
82 | # You neeed this to generate ld-index.ms (or .mm or .me) | |
83 | # TEXI2OPT = -i | |
8073190b | 84 | |
e06ba18d PB |
85 | TEXI2ROFF=texi2roff |
86 | ||
8073190b RP |
87 | # Which roff program to use to generate index for texi2roff'd doc |
88 | ROFF = groff | |
89 | ||
5cdea2ac SC |
90 | #stuff for self hosting (can be overridden in config file). |
91 | HOSTING_CRT0=/lib/crt0.o | |
92 | HOSTING_LIBS=`if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else echo $(libdir)/libgcc.a; fi` -lc | |
93 | HOSTING_EMU=LDEMULATION=$(EMUL); export LDEMULATION | |
94 | ||
917bffa7 PB |
95 | C++ = g++ -fgnu-linker |
96 | ||
7e5c1057 | 97 | ### Host, target, and site specific Makefile fragments come in here. |
2ee11735 RP |
98 | ### |
99 | ||
2ee11735 RP |
100 | LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) |
101 | ||
917bffa7 | 102 | .SUFFIXES: .y .x .xr .xu .xn .xbn .sc .scu .scr .scn $(SUFFIXES) .cc |
2ee11735 | 103 | |
77b19d3d RP |
104 | .c.o: |
105 | $(CC) -c $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $< | |
106 | ||
917bffa7 PB |
107 | .cc.o: |
108 | $(C++) -c $(CFLAGS) -I$(srcdir) $< | |
109 | ||
eb02fd64 RP |
110 | # go directly to ld.new in case this ld isn't capable of |
111 | # linking native object on this host. It can be renamed on | |
112 | # install. | |
e7921bd4 | 113 | LD_PROG = ld.new |
f78e2569 | 114 | |
eb02fd64 | 115 | # for self hosting |
12fa72d4 SC |
116 | BFDLIB=./../bfd/libbfd.a |
117 | LIBIBERTY=./../libiberty/libiberty.a | |
eb02fd64 | 118 | |
7e5c1057 | 119 | ALL_EMULATIONS=ld__lnk960.o ld__sun3.o ld__i386aout.o \ |
9d1fe8a4 | 120 | ld__go32.o ld__m88kbcs.o ld__a29k.o ld__news.o ld__hp300bsd.o ld__h8300hms.o ld__ebmon29k.o \ |
fe3e4dfc | 121 | ld__sun4.o ld__gld960.o ld__vanilla.o ld__h8300xray.o ld__st2000.o ld__sa29200.o |
7e5c1057 PB |
122 | |
123 | EMULATION_OFILES=${ALL_EMULATIONS} | |
124 | #EMULATION_OFILES=ld__${EMUL}.o ${OTHER_EMULATIONS} | |
125 | ||
119afd7b | 126 | OFILES= ldgram.o ldlex.o lexsup.o ldlang.o mri.o ldctor.o ldmain.o ldindr.o \ |
7e5c1057 | 127 | ldwarn.o ldwrite.o ldexp.o ldemul.o ldver.o ldmisc.o ldsym.o \ |
12fa72d4 | 128 | ldfile.o relax.o lderror.o cplus-dem.o ${EMULATION_OFILES} |
eb02fd64 | 129 | |
ce4d59e2 SC |
130 | HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \ |
131 | ldsym.h ldctor.h ldlang.h ldexp.h \ | |
239d28f3 | 132 | ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h |
eb02fd64 RP |
133 | |
134 | MANSOURCES=ld.tex | |
135 | ||
119afd7b | 136 | LDCSOURCES=ldlang.c lexsup.c ldctor.c mri.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \ |
9d1fe8a4 | 137 | ld__gld.c ld__sun3.c ld__go32.c ld__m88k.c ld__ebmon29k.c \ |
2e2bf962 | 138 | ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c \ |
12fa72d4 | 139 | relax.c lderror.c cplus-dem.c |
eb02fd64 | 140 | |
7e5c1057 PB |
141 | GENERATED_SOURCES=ldgram.c ldlex.c ld__*.c ldemul-list.h |
142 | GENERATED_HEADERS=ldgram.h ldemul-list.h | |
eb02fd64 | 143 | |
cc964c6f | 144 | LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h |
eb02fd64 | 145 | |
2ee11735 | 146 | BFDSOURCES=../../bfd/common/*.c |
eb02fd64 RP |
147 | |
148 | SOURCES= $(LDSOURCES) $(BFDSOURCES) | |
149 | LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) | |
150 | ||
7e5c1057 | 151 | STAGESTUFF = *.x *.x[runN] *.sc[runN] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) $(LD_PROG) mkscript |
2ee11735 | 152 | |
e06ba18d PB |
153 | all: Makefile $(LD_PROG) |
154 | ||
917bffa7 | 155 | check: bootstrap check-cdtest |
e06ba18d | 156 | info: ld.info |
2ee11735 | 157 | |
4976e6ab | 158 | ldgram.h ldgram.c: ldgram.y |
5ff21fa5 | 159 | $(BISON) $(BISONFLAGS) -d $(srcdir)/ldgram.y |
31e54f5d RP |
160 | mv -f y.tab.c ldgram.c |
161 | mv -f y.tab.h ldgram.h | |
cc964c6f | 162 | |
d20fb445 | 163 | ldmain.o: ldmain.c |
77b19d3d | 164 | $(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) -DDEFAULT_EMULATION='"$(EMUL)"' -c $< |
7e5c1057 PB |
165 | |
166 | ldemul-list.h: Makefile | |
167 | (echo "/* This file is automatically generated. DO NOT EDIT! */";\ | |
168 | for f in `echo " " ${EMULATION_OFILES} "" \ | |
169 | | sed -e 's/ld__/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \ | |
170 | echo "extern ld_emulation_xfer_type ld_$${f}_emulation;"; \ | |
171 | done;\ | |
172 | echo "";\ | |
173 | echo "#define EMULATION_LIST \\";\ | |
174 | for f in `echo " " ${EMULATION_OFILES} "" \ | |
175 | | sed -e 's/ld__/ld/g' -e 's/ ld/ /g' -e 's/[.]o//g'`; do \ | |
176 | echo " &ld_$${f}_emulation, \\"; \ | |
177 | done;\ | |
178 | echo " 0") >ldemul-list.h | |
179 | ||
180 | ldemul.o: ldemul-list.h | |
d20fb445 | 181 | |
4976e6ab | 182 | ldlex.c: ldlex.l |
5ff21fa5 PB |
183 | $(LEX) -I -Cem $(srcdir)/ldlex.l |
184 | mv lex.yy.c ldlex.c | |
19b03b7a | 185 | |
c61b4184 PB |
186 | # These all start with ld__ so 'make clean' can find them. |
187 | ||
7e5c1057 PB |
188 | GENSCRIPTS=sh $(srcdir)/genscripts.sh ${srcdir} ${host_alias} ${target_alias} |
189 | GEN_DEPENDS=./mkscript $(srcdir)/genscripts.sh | |
190 | ||
191 | ld__sun4.c: $(srcdir)/sun4.sh \ | |
192 | $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS} | |
193 | ${GENSCRIPTS} sun4.sh | |
194 | ld__sun3.c: $(srcdir)/sun3.sh \ | |
195 | $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS} | |
196 | ${GENSCRIPTS} sun3.sh | |
9d1fe8a4 SC |
197 | ld__go32.c: $(srcdir)/go32.sh \ |
198 | $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS} | |
199 | ${GENSCRIPTS} go32.sh | |
7e5c1057 PB |
200 | ld__news.c: $(srcdir)/news.sh \ |
201 | $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS} | |
202 | ${GENSCRIPTS} news.sh | |
1584d069 PB |
203 | ld__hp300bsd.c: $(srcdir)/hp300bsd.sh \ |
204 | $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS} | |
205 | ${GENSCRIPTS} hp300bsd.sh | |
7e5c1057 PB |
206 | ld__i386aout.c: $(srcdir)/i386aout.sh \ |
207 | $(srcdir)/generic.em $(srcdir)/aout.sc-sh ${GEN_DEPENDS} | |
208 | ${GENSCRIPTS} i386aout.sh | |
209 | ld__ebmon29k.c: $(srcdir)/ebmon29k.sh \ | |
210 | $(srcdir)/generic.em $(srcdir)/ebmon29k.sc-sh ${GEN_DEPENDS} | |
211 | ${GENSCRIPTS} ebmon29k.sh | |
fe3e4dfc SC |
212 | ld__sa29200.c: $(srcdir)/sa29200.sh \ |
213 | $(srcdir)/generic.em $(srcdir)/sa29200.sc-sh ${GEN_DEPENDS} | |
214 | ${GENSCRIPTS} sa29200.sh | |
7e5c1057 PB |
215 | ld__a29k.c: $(srcdir)/a29k.sh \ |
216 | $(srcdir)/generic.em $(srcdir)/a29k.sc-sh ${GEN_DEPENDS} | |
217 | ${GENSCRIPTS} a29k.sh | |
218 | ld__m88kbcs.c: $(srcdir)/m88kbcs.sh \ | |
219 | $(srcdir)/generic.em $(srcdir)/h8300hms.sc-sh ${GEN_DEPENDS} | |
220 | ${GENSCRIPTS} m88kbcs.sh | |
221 | ld__h8300hms.c: $(srcdir)/h8300hms.sh \ | |
222 | $(srcdir)/h8300hms.em $(srcdir)/h8300hms.sc-sh ${GEN_DEPENDS} | |
223 | ${GENSCRIPTS} h8300hms.sh | |
9d1fe8a4 SC |
224 | ld__h8300xray.c: $(srcdir)/h8300xray.sh \ |
225 | $(srcdir)/h8300xray.em $(srcdir)/h8300xray.sc-sh ${GEN_DEPENDS} | |
226 | ${GENSCRIPTS} h8300xray.sh | |
119afd7b RP |
227 | ld__st2000.c: $(srcdir)/st2000.sh \ |
228 | $(srcdir)/st2000.em $(srcdir)/st2000.sc-sh ${GEN_DEPENDS} | |
229 | ${GENSCRIPTS} st2000.sh | |
7e5c1057 PB |
230 | ld__vanilla.c: $(srcdir)/vanilla.sh \ |
231 | $(srcdir)/vanilla.em $(srcdir)/vanilla.sc-sh ${GEN_DEPENDS} | |
232 | ${GENSCRIPTS} vanilla.sh | |
233 | ld__lnk960.c: $(srcdir)/lnk960.sh \ | |
234 | $(srcdir)/lnk960.em $(srcdir)/i960.sc-sh ${GEN_DEPENDS} | |
235 | ${GENSCRIPTS} lnk960.sh | |
236 | ld__gld960.c: $(srcdir)/gld960.sh \ | |
237 | $(srcdir)/gld960.em $(srcdir)/i960.sc-sh ${GEN_DEPENDS} | |
238 | ${GENSCRIPTS} gld960.sh | |
eb02fd64 | 239 | |
e77463a1 | 240 | $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY) |
77b19d3d | 241 | $(CC) $(CFLAGS) $(INCLUDES) $(HDEFINES) $(TDEFINES) $(CDEFINES) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) |
e7921bd4 | 242 | |
7e5c1057 | 243 | # Rules for testing by relinking ld itself. |
eb02fd64 | 244 | |
7e5c1057 PB |
245 | ld-partial.o: ld.new |
246 | $(HOSTING_EMU); ./ld.new -o ld-partial.o -r $(OFILES) | |
247 | ld1: ld-partial.o | |
248 | $(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) ld-partial.o $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) | |
eb02fd64 | 249 | |
7e5c1057 PB |
250 | ld1-full: ld.new |
251 | $(HOSTING_EMU); ./ld.new -o ld1-full $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) | |
eb02fd64 | 252 | |
d20fb445 SC |
253 | ld2: ld1 |
254 | $(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) | |
60048a2c | 255 | |
eb02fd64 | 256 | ld3: ld2 |
e77463a1 | 257 | $(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) |
eb02fd64 | 258 | |
d20fb445 SC |
259 | bootstrap: ld3 |
260 | cmp ld2 ld3 | |
261 | ||
917bffa7 PB |
262 | cdtest: cdtest-main.o cdtest-func.o cdtest-foo.o |
263 | $(HOSTING_EMU); ./ld.new -o cdtest $(HOSTING_CRT0) \ | |
264 | cdtest-main.o cdtest-func.o cdtest-foo.o $(HOSTING_LIBS) | |
265 | ||
266 | check-cdtest: cdtest $(srcdir)/cdtest.exp | |
267 | ./cdtest >cdtest.out | |
268 | diff $(srcdir)/cdtest.exp cdtest.out | |
269 | ||
8073190b RP |
270 | ###################################################################### |
271 | # DOCUMENTATION TARGETS | |
272 | # TeX output | |
9c7810d6 RP |
273 | ld.dvi: $(srcdir)/ld.texinfo |
274 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo | |
8d317d2a | 275 | texindex ld.?? |
9c7810d6 | 276 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo |
8d317d2a | 277 | |
8073190b | 278 | # info file for online browsing |
9c7810d6 | 279 | ld.info: $(srcdir)/ld.texinfo |
e06ba18d | 280 | $(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo |
eb02fd64 | 281 | |
954ac2ea | 282 | #separate targets for "ms", "me", and "mm" forms of roff doc |
e06ba18d PB |
283 | # Try to use a recent texi2roff. v2 was put on prep in jan91. |
284 | # If you want an index, see texi2roff doc for postprocessing | |
285 | # and add -i to texi2roff invocations below. | |
286 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
287 | # correspondint -e lines when later texi2roff's are current) | |
288 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
289 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
290 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
291 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
292 | ||
9c7810d6 | 293 | ld.ms: $(srcdir)/ld.texinfo |
8073190b RP |
294 | sed -e '/\\input texinfo/d' \ |
295 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
296 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
297 | -e '/^@c/d' \ | |
298 | -e 's/{.*,,/{/' \ | |
299 | -e 's/@ / /g' \ | |
300 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
301 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 302 | $(srcdir)/ld.texinfo | \ |
e06ba18d PB |
303 | $(TEXI2ROFF) $(TEXI2OPT) -ms | \ |
304 | sed -e 's/---/\\(em/g' \ | |
305 | >>ld.ms | |
8073190b RP |
306 | |
307 | # index for roff output | |
308 | ld-index.ms: ld.ms | |
309 | $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \ | |
310 | sed -e '/: warning:/d' | \ | |
311 | texi2index >ld-index.ms | |
312 | ||
954ac2ea | 313 | # roff output (-mm) |
9c7810d6 | 314 | ld.mm: $(srcdir)/ld.texinfo |
954ac2ea RP |
315 | sed -e '/\\input texinfo/d' \ |
316 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
317 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
318 | -e '/^@c/d' \ | |
9c7810d6 RP |
319 | -e 's/{.*,,/{/' \ |
320 | -e '/@noindent/d' \ | |
e06ba18d PB |
321 | -e 's/@ / /g' \ |
322 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
323 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 324 | $(srcdir)/ld.texinfo | \ |
e06ba18d | 325 | $(TEXI2ROFF) $(TEXI2OPT) -mm | \ |
9c7810d6 RP |
326 | sed -e 's/---/\\(em/g' \ |
327 | >ld.mm | |
954ac2ea RP |
328 | |
329 | # index for roff output | |
330 | ld-index.mm: ld.mm | |
331 | $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \ | |
332 | sed -e '/: warning:/d' | \ | |
333 | texi2index >ld-index.mm | |
334 | ||
335 | # roff output (-me) | |
9c7810d6 | 336 | ld.me: $(srcdir)/ld.texinfo |
954ac2ea RP |
337 | sed -e '/\\input texinfo/d' \ |
338 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
e06ba18d PB |
339 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
340 | -e '/^@c/d' \ | |
341 | -e 's/{.*,,/{/' \ | |
342 | -e 's/@ / /g' \ | |
343 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
344 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
9c7810d6 | 345 | $(srcdir)/ld.texinfo | \ |
e06ba18d PB |
346 | $(TEXI2ROFF) $(TEXI2OPT) -me | \ |
347 | sed -e 's/---/\\(em/g' \ | |
348 | >>ld.me | |
954ac2ea RP |
349 | |
350 | # index for roff output | |
351 | ld-index.me: ld.me | |
352 | $(ROFF) -me ld.me 2>&1 1>/dev/null | \ | |
353 | sed -e '/: warning:/d' | \ | |
354 | texi2index >ld-index.me | |
355 | ||
356 | ||
8073190b RP |
357 | ###################################################################### |
358 | ||
12fa72d4 | 359 | ./mkscript: $(srcdir)/mkscript.c |
5ff21fa5 | 360 | $(HOST_CC) -o mkscript $(srcdir)/mkscript.c |
f78e2569 | 361 | |
cc964c6f SC |
362 | ldlex.c: ldlex.l ldgram.h |
363 | ldlex.o: ldlex.c ldgram.h | |
364 | ldgram.o: ldgram.c | |
365 | ldgram.c:ldgram.y | |
eb02fd64 | 366 | |
7e5c1057 | 367 | h8300hms.o:h8300hms.c |
9d1fe8a4 | 368 | h8300xray.o:h8300xray.c |
119afd7b | 369 | st2000.o:st2000.c |
565a4c76 | 370 | |
e7921bd4 | 371 | stage1: force |
e06ba18d PB |
372 | -mkdir stage1 |
373 | -mv -f $(STAGESTUFF) stage1 | |
374 | -(cd stage1 ; ln -s $(LD_PROG) ld) | |
f78e2569 | 375 | |
e7921bd4 | 376 | stage2: force |
e06ba18d PB |
377 | -mkdir stage2 |
378 | -mv -f $(STAGESTUFF) stage2 | |
379 | -(cd stage2 ; ln -s $(LD_PROG) ld) | |
f78e2569 | 380 | |
e7921bd4 | 381 | stage3: force |
e06ba18d PB |
382 | -mkdir stage3 |
383 | -mv -f $(STAGESTUFF) stage3 | |
384 | -(cd stage3 ; ln -s $(LD_PROG) ld) | |
eb02fd64 | 385 | |
e46cdcdd RP |
386 | against=stage2 |
387 | ||
388 | comparison: force | |
389 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
390 | ||
e7921bd4 | 391 | de-stage1: force |
e06ba18d PB |
392 | -(cd stage1 ; mv -f * ..) |
393 | -rm ld | |
394 | -rmdir stage1 | |
e7921bd4 RP |
395 | |
396 | de-stage2: force | |
e06ba18d PB |
397 | -(cd stage2 ; mv -f * ..) |
398 | -rm ld | |
399 | -rmdir stage2 | |
e7921bd4 RP |
400 | |
401 | de-stage3: force | |
e06ba18d PB |
402 | -(cd stage3 ; mv -f * ..) |
403 | -rm ld | |
404 | -rmdir stage3 | |
e7921bd4 RP |
405 | |
406 | clean: | |
7e5c1057 PB |
407 | -rm -f TAGS $(STAGESTUFF) |
408 | -rm -f ld.?? ld.??? ldlex.[qp] | |
917bffa7 | 409 | -rm -f ld ld1 ld2 ld3 *.o y.output cdtest cdtest.out |
eb02fd64 RP |
410 | |
411 | lintlog:$(SOURCES) Makefile | |
2ee11735 | 412 | $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ |
eb02fd64 RP |
413 | | grep -v "pointer casts may be troublesome" \ |
414 | | grep -v "possible pointer alignment problem" \ | |
415 | | grep -v "ignore" \ | |
416 | | grep -v "conversion from long may lose accuracy" \ | |
417 | | grep -v "warning: constant argument to NOT" \ | |
418 | | grep -v "enumeration type clash, operator CAST" \ | |
419 | | grep -v "warning: constant in conditional context"\ | |
420 | | grep -v "archive\.c" | |
421 | ||
422 | ||
423 | tags TAGS:$(SOURCES) $(HEADERS) | |
19b03b7a | 424 | etags -t $? |
eb02fd64 | 425 | |
eb02fd64 RP |
426 | |
427 | objdump:objdump.c | |
428 | ||
12fa72d4 | 429 | .PHONY: install |
e7921bd4 | 430 | install: $(LD_PROG) |
b40f9c73 DZ |
431 | -rm -f $(bindir)/$(program_prefix)ld$(program_suffix) |
432 | $(INSTALL_PROGRAM) ld.new $(bindir)/$(program_prefix)ld$(program_suffix) | |
119afd7b | 433 | -rm -f $(tooldir)/ld |
b40f9c73 DZ |
434 | if [ -d $(tooldir) ]; then $(INSTALL_PROGRAM) ld.new $(tooldir)/ld; else true; fi |
435 | -rm -f $(man1dir)/$(program_prefix)ld$(program_suffix).1 | |
436 | $(INSTALL_DATA) $(srcdir)/gld.1 $(man1dir)/$(program_prefix)ld$(program_suffix).1 | |
e06ba18d PB |
437 | |
438 | install-info: info | |
afe3aa73 | 439 | for i in ld.info* ; do \ |
e06ba18d | 440 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
afe3aa73 RP |
441 | done |
442 | ||
12fa72d4 SC |
443 | clean-info: |
444 | -rm -rf *.info* | |
445 | ||
eb02fd64 RP |
446 | #----------------------------------------------------------------------------- |
447 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
448 | # | |
449 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
450 | #----------------------------------------------------------------------------- | |
451 | ||
452 | ver960.c: FORCE | |
453 | rm -f ver960.c | |
454 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
455 | ||
456 | ||
457 | # This target should be invoked before building a new release. | |
458 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
459 | # | |
460 | roll: | |
461 | @V=`cat VERSION` ; \ | |
462 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
463 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
464 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
465 | rm -f VERSION ; \ | |
466 | echo $$V >VERSION ; \ | |
467 | echo Version $$V | |
468 | ||
239d28f3 | 469 | |
e1e5fbfc | 470 | dep: $(LDSOURCES) |
239d28f3 SC |
471 | mkdep $(CFLAGS) $? |
472 | ||
eb02fd64 RP |
473 | # Dummy target to force execution of dependent targets. |
474 | # | |
e7921bd4 | 475 | force: |
eb02fd64 RP |
476 | |
477 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
478 | # have the following string beginning in column 1: #__<hostname>__# | |
479 | # Original Makefile is backed up as 'Makefile.old'. | |
480 | # | |
481 | # Invoke with: make make HOST=xxx | |
482 | # | |
483 | make: | |
484 | -@if test $(HOST)x = x ; then \ | |
485 | echo '\aSpecify "make make HOST=???"'; \ | |
486 | exit 1; \ | |
487 | fi ; \ | |
488 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
489 | if test $$? = 0 ; then \ | |
490 | echo "\aMakefile has already been processed with 'make make'";\ | |
491 | exit 1; \ | |
492 | fi ; \ | |
493 | mv -f Makefile Makefile.old; \ | |
494 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
495 | echo "HOST=$(HOST)" >>Makefile ; \ | |
496 | echo >>Makefile ; \ | |
497 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
498 | ||
499 | #\f | |
500 | ||
f1eb48b6 | 501 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 502 | $(SHELL) ./config.status |
eb02fd64 | 503 | |
eb02fd64 | 504 | ### mode:fundamental *** |
e06ba18d | 505 | ### Local Variables: *** |
eb02fd64 RP |
506 | ### page-delimiter: "^#\f" *** |
507 | ### End: *** | |
508 | ### end of file | |
239d28f3 SC |
509 | |
510 | ||
511 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |