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