]>
Commit | Line | Data |
---|---|---|
f9ea3c98 SC |
1 | # Makefile for the GNU linker ld (version 2) |
2 | # Copyright (C) 1989-1991 Free Software Foundation, Inc. | |
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 | ||
20 | # | |
21 | # $Id$ | |
22 | # | |
23 | ||
24 | srcdir = . | |
25 | ||
26 | ddestdir = /usr/local | |
27 | ||
28 | #version=/`$(unsubdir)/../gcc$(subdir)/gcc -dumpversion` | |
29 | version= | |
30 | bindir = $(ddestdir)/bin | |
31 | gcclibdir = $(ddestdir)/lib/gcc/$(target_alias)$(version) | |
32 | ||
33 | # Seach path to override the default search path for -lfoo libraries. | |
34 | # If LIB_PATH is empty, the ones in the script (if any) are left alone. | |
35 | # Otherwise, they are replaced with the ones given in LIB_PATH, | |
36 | # which may have the form: LIB_PATH=/lib:/usr/local/lib | |
37 | LIB_PATH = | |
38 | ||
39 | INSTALL = install -c | |
40 | INSTALL_PROGRAM = $(INSTALL) | |
41 | INSTALL_FILE = $(INSTALL) | |
42 | ||
43 | BASEDIR = ../.. | |
44 | INCLUDE = $(srcdir)/../include | |
45 | INCLUDES = -I. -I$(srcdir) -I$(INCLUDE) | |
46 | MINUS_G = -g | |
47 | ||
48 | # Where to find texinfo.tex to format docn with TeX | |
49 | TEXIDIR = $(srcdir)/../texinfo/fsf | |
50 | ||
51 | # Whether to get roff to put indexing entries on stderr | |
52 | TEXI2OPT = | |
53 | # You neeed this to generate ld-index.ms (or .mm or .me) | |
54 | # TEXI2OPT = -i | |
55 | ||
56 | MAKEINFO=makeinfo | |
57 | TEXI2ROFF=texi2roff | |
58 | ||
59 | # Which roff program to use to generate index for texi2roff'd doc | |
60 | ROFF = groff | |
61 | ||
62 | BISON = bison | |
63 | BISONFLAGS = -v | |
64 | ||
65 | SCRIPTS = ldgld68k.sc ldgld.sc \ | |
66 | ldlnk960.sc ldlnk960r.sc ldgld960.sc \ | |
67 | i386aout.sc ldm88k.sc ldglda29k.sc news.sc h8300hds.sc ebmon29k.sc | |
68 | ||
69 | #### target and host dependent Makefile fragments come in here. | |
70 | HDEFINES=-O -D__MSDOS__ -D__GO32__ | |
71 | TDEFINES= | |
72 | CDEFINES= | |
73 | ### | |
74 | ||
75 | CFLAGS = $(INCLUDES) $(MINUS_G) $(HDEFINES) $(TDEFINES) $(CDEFINES) | |
76 | LINTFLAGS = $(INCLUDES) $(EXTRA_DEF) | |
77 | ||
78 | .SUFFIXES: .y .x .xr .xu .xn .xN .sc .scu .scr .scn | |
79 | ||
80 | # go directly to ld.new in case this ld isn't capable of | |
81 | # linking native object on this host. It can be renamed on | |
82 | # install. | |
83 | LD_PROG = ld.new | |
84 | ||
85 | # A .sc script file is needed for each emulation mode. | |
86 | # sed is used to transform this script into two variant forms: | |
87 | # A .scr script is for linking without relocation (-r flag). | |
88 | # A .scu script is like .scr, but *do* create constructors. | |
89 | # A .scn script is for linking with -N flag (mix text and data on same page). | |
90 | # A .scN script is for linking with -N flag (mix text and data on same page). | |
91 | # The diference is that segments should (need) not be page aligned. | |
92 | ||
93 | # A sed pattern to translate .sc to .scu: | |
94 | SED_MAKE_RELOC_WITH_CONSTRUCTORS=\ | |
95 | -e "/If relocating/,/End if relocating/d" \ | |
96 | -e "/=/s/[_a-zA-Z.]* *= .*//g" \ | |
97 | -e '/>/s/} *> *[a-zA-Z]*/}/' \ | |
98 | -e "/text/s/[.]text .*:/.text :/" \ | |
99 | -e "/data/s/[.]data .*:/.data :/" | |
100 | # A sed pattern to translate .scu to .scr: | |
101 | SED_REMOVE_CONSTRUCTORS= -e /CONSTRUCTORS/d | |
102 | ||
103 | .sc.scu: | |
104 | sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $< >$*.scu | |
105 | .scu.scr: | |
106 | sed $(SED_REMOVE_CONSTRUCTORS) < $< >$*.scr | |
107 | ||
108 | # Each builtin script file is included as a C string literal. | |
109 | # These are generated by the mkscript filter. | |
110 | .sc.x: | |
111 | if [ "x"$(LIB_PATH) = "x" ]; then ./mkscript < $< >$*.x ; \ | |
112 | else \ | |
113 | (sed <$< -e '/SEARCH_DIR(.*)/d' ; \ | |
114 | echo $(LIB_PATH) | tr ':' ' ' | sed -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\1);/g';) | ./mkscript >$*.x;\ | |
115 | fi | |
116 | ||
117 | # The .xn script is used if the -n flag is given (write-protect text).. | |
118 | # Sunos starts the text segment for demand-paged binaries at 0x2020 | |
119 | # and other binaries at 0x2000, since the exec header is paged in | |
120 | # with the text. Some other Unix variants do the same. | |
121 | # For -n and -N flags the offset of the exec header must be removed. | |
122 | # This sed script does this if the master script contains | |
123 | # a line of the form ".text 0xAAAA BLOCK(0xBBBB):" - the | |
124 | # output will contain ".text 0xBBBB:". (For Sunos AAAA=2020 and BBBB=2000.) | |
125 | .x.xn: | |
126 | sed -e '/text/s/\.text .* BLOCK(\([^)]*\)):/.text \1:/' < $< >$*.xn | |
127 | ||
128 | # The .xN script is used if the -N flag is given (don't write-protect text). | |
129 | # This is like -n, except that the data segment need not be page-aligned. | |
130 | # So get rid of commands for page-alignment: We assume these use ALIGN | |
131 | # with a hex constant that end with 00, since any normal page size is be | |
132 | # at least divisible by 256. We use the 00 to avoid matching | |
133 | # anything that tries to align of (say) 8-byte boundaries. | |
134 | .xn.xN: | |
135 | sed -e '/ALIGN/s/ALIGN( *0x[0-9a-fA-F]*00 *)/./' < $< >$*.xN | |
136 | ||
137 | # The xu and xr scripts don't search libraries, so LIB_PATH doesn't matter. | |
138 | .sc.xu: | |
139 | sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) < $< | ./mkscript >$*.xu | |
140 | .sc.xr: | |
141 | sed $(SED_MAKE_RELOC_WITH_CONSTRUCTORS) $(SED_REMOVE_CONSTRUCTORS) \ | |
142 | < $< | ./mkscript >$*.xr | |
143 | ||
144 | # for self hosting | |
145 | BFDLIB=../bfd/libbfd.a | |
146 | LIBIBERTY=../libiberty/libiberty.a | |
147 | ||
148 | OFILES= ldgram.o ldlex.o ldlang.o ldctor.o ldmain.o ldindr.o \ | |
149 | ldwarn.o ldwrite.o ldexp.o ldlnk960.o ld__gld68k.o ld__i386aout.o \ | |
150 | ld__m88k.o ld__glda29k.o ld__news.o h8300hds.o ld__ebmon29k.o \ | |
151 | ld__gld.o ldgld960.o ldemul.o ldver.o ldmisc.o ldsym.o ldvanilla.o ldfile.o | |
152 | ||
153 | HEADERS=config.h ldmain.h ldmain.h ldwarn.h ldmisc.h ldindr.h \ | |
154 | ldsym.h ldctor.h ldlang.h ldexp.h \ | |
155 | ldlex.h ldwrite.h ldver.h ldemul.h ldfile.h ldgram.h ld.h | |
156 | ||
157 | MANSOURCES=ld.tex | |
158 | ||
159 | LDCSOURCES=ldlang.c ldctor.c ldindr.c ldmain.c ldwrite.c ldwarn.c ldlnk960.c \ | |
160 | ld__gld.c ld__gld68k.c ld__m88k.c ld__ebmon29k.c \ | |
161 | ldgld960.c ldemul.c ldver.c ldmisc.c ldexp.c ldsym.c ldfile.c ldvanilla.c | |
162 | ||
163 | GENERATED_SOURCES=ldgram.c ldlex.c ldgram.h ld__*.c | |
164 | GENERATED_HEADERS=ldgram.h | |
165 | ||
166 | LDSOURCES=$(LDCSOURCES) ldgram.y ldlex.l ldgram.h | |
167 | ||
168 | BFDSOURCES=../../bfd/common/*.c | |
169 | ||
170 | SOURCES= $(LDSOURCES) $(BFDSOURCES) | |
171 | LINTSOURCES= $(LDCSOURCES) $(BFDSOURCES) $(GENERATED_SOURCES) | |
172 | ||
173 | STAGESTUFF = *.x *.x[ru] *.sc[ru] $(GENERATED_SOURCES) $(GENERATED_HEADERS) $(OFILES) $(LD_PROG) mkscript | |
174 | ||
175 | all: $(LD_PROG) | |
176 | ||
177 | all-info: ld.info | |
178 | ||
179 | ldgram.h ldgram.c: ldgram.y | |
180 | $(BISON) $(BISONFLAGS) -d ldgram.y | |
181 | mv -f y.tab.c ldgram.c | |
182 | mv -f y.tab.h ldgram.h | |
183 | ||
184 | ldlex.c: ldlex.l | |
185 | lex -t ldlex.l >ldlex.c | |
186 | ||
187 | # These all start with ld__ so 'make clean' can find them. | |
188 | ||
189 | ld__gld.c: $(srcdir)/ldtemplate | |
190 | sed -e s/"<ldtarget>"/ldgld/g -e s/"<arch>"/m68k/g \ | |
191 | -e s/"<target>"//g -e s/"<TARGET>"//g <$(srcdir)/ldtemplate >$@ | |
192 | ld__news.c: $(srcdir)/ldtemplate | |
193 | sed -e s/"<ldtarget>"/news/g -e s/"<arch>"/m68k/g \ | |
194 | -e s/"<target>"/news/g -e s/"<TARGET>"/NEWS/g <$(srcdir)/ldtemplate >$@ | |
195 | ||
196 | ld__i386aout.c: $(srcdir)/ldtemplate | |
197 | sed -e s/"<ldtarget>"/i386aout/g -e s/"<arch>"/i386/g \ | |
198 | -e s/"<target>"/i386aout/g -e s/"<TARGET>"/I386AOUT/g <$(srcdir)/ldtemplate >$@ | |
199 | ||
200 | ||
201 | ld__ebmon29k.c: $(srcdir)/ldtemplate | |
202 | sed -e s/"<ldtarget>"/ebmon29k/g -e s/"<arch>"/a29k/g \ | |
203 | -e s/"gld<target>"/ebmon29k/g -e s/"GLD<TARGET>"/EBMON29K/g \ | |
204 | -e s/"<ldtarget>.x"/ebmon.x/ <$(srcdir)/ldtemplate >$@ | |
205 | ||
206 | ld__gld68k.c: $(srcdir)/ldtemplate | |
207 | sed -e s/"<ldtarget>"/ldgld68k/g -e s/"<arch>"/m68k/g \ | |
208 | -e s/"<target>"/68k/g -e s/"<TARGET>"/68K/g <$(srcdir)/ldtemplate >$@ | |
209 | ld__glda29k.c: $(srcdir)/ldtemplate | |
210 | sed -e s/"<ldtarget>"/ldglda29k/g -e s/"<arch>"/a29k/g \ | |
211 | -e s/"<target>"/29k/g -e s/"<TARGET>"/29K/g <$(srcdir)/ldtemplate >$@ | |
212 | ld__m88k.c: $(srcdir)/ldtemplate | |
213 | sed -e s/"<ldtarget>"/ldm88k/g -e s/"<arch>"/m88k/g \ | |
214 | -e s/"<target>"/m88kbcs/g -e s/"<TARGET>"/M88KBCS/g <$(srcdir)/ldtemplate >$@ | |
215 | ||
216 | # The .c files for these are generated from ldtemplete. | |
217 | ld__gld.o: ./mkscript ldgld.x ldgld.xr ldgld.xu ldgld.xn ldgld.xN | |
218 | ld__news.o: ./mkscript news.x news.xr news.xu news.xn news.xN | |
219 | ld__i386aout.o: ./mkscript i386aout.x i386aout.xr i386aout.xu i386aout.xn i386aout.xN | |
220 | ld__ebmon29k.o: ./mkscript ebmon29k.x ebmon29k.xr ebmon29k.xu \ | |
221 | ebmon29k.xn ebmon29k.xN | |
222 | ld__gld68k.o: ./mkscript ldgld68k.x ldgld68k.xr ldgld68k.xu \ | |
223 | ldgld68k.xn ldgld68k.xN | |
224 | ld__glda29k.o: ./mkscript ldglda29k.x ldglda29k.xr ldglda29k.xu \ | |
225 | ldglda29k.xn ldglda29k.xN | |
226 | ld__m88k.o: ./mkscript ldm88k.x ldm88k.xr ldm88k.xu ldm88k.xn ldm88k.xN | |
227 | ||
228 | # The .c files for these are (for now) specially written (not ldtemplete). | |
229 | ldgld960.o: ./mkscript ldgld960.x | |
230 | ldlnk960.o: ./mkscript ldlnk960.x ldlnk960.xr | |
231 | h8300hds.o: ./mkscript h8300hds.x | |
232 | ||
233 | ||
234 | #$(BFDLIB): $(BFDSOURCES) | |
235 | # (cd ../bfd; make) | |
236 | ||
237 | $(LD_PROG): $(OFILES) $(BFDLIB) $(LIBIBERTY) | |
238 | $(CC) $(CFLAGS) $(LDFLAGS) -o $(LD_PROG) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(LOADLIBES) | |
239 | ||
240 | # (cd ../bfd; make) | |
241 | # LDEMULATION=gld; export LDEMULATION; GNUTARGET=a.out-sunos-big;./ldok -format a.out-sunos-big -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib | |
242 | # gld -o ld /lib/crt0.o $(OFILES) $(BFDLIB) $(LIBIBERTY) -lc /usr/local/lib/gcc/sparc/1.91/gnulib | |
243 | # $(CC) -Bstatic -o ld.new $(OFILES) $(BFDLIB) $(LIBIBERTY) | |
244 | ||
245 | ||
246 | ld1: ld.new | |
247 | $(HOSTING_EMU); ./ld.new -o ld1 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) | |
248 | ||
249 | ld2: ld1 | |
250 | $(HOSTING_EMU); ./ld1 -o ld2 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) | |
251 | ||
252 | ld3: ld2 | |
253 | $(HOSTING_EMU); ./ld2 -o ld3 $(HOSTING_CRT0) $(OFILES) $(BFDLIB) $(LIBIBERTY) $(HOSTING_LIBS) | |
254 | ||
255 | ###################################################################### | |
256 | # DOCUMENTATION TARGETS | |
257 | # TeX output | |
258 | ld.dvi: $(srcdir)/ld.texinfo | |
259 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo | |
260 | texindex ld.?? | |
261 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/ld.texinfo | |
262 | ||
263 | # info file for online browsing | |
264 | ld.info: $(srcdir)/ld.texinfo | |
265 | $(MAKEINFO) -o ld.info $(srcdir)/ld.texinfo | |
266 | ||
267 | #separate targets for "ms", "me", and "mm" forms of roff doc | |
268 | # Try to use a recent texi2roff. v2 was put on prep in jan91. | |
269 | # If you want an index, see texi2roff doc for postprocessing | |
270 | # and add -i to texi2roff invocations below. | |
271 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
272 | # correspondint -e lines when later texi2roff's are current) | |
273 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
274 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
275 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
276 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
277 | ||
278 | ld.ms: $(srcdir)/ld.texinfo | |
279 | sed -e '/\\input texinfo/d' \ | |
280 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
281 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
282 | -e '/^@c/d' \ | |
283 | -e 's/{.*,,/{/' \ | |
284 | -e 's/@ / /g' \ | |
285 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
286 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
287 | $(srcdir)/ld.texinfo | \ | |
288 | $(TEXI2ROFF) $(TEXI2OPT) -ms | \ | |
289 | sed -e 's/---/\\(em/g' \ | |
290 | >>ld.ms | |
291 | ||
292 | # index for roff output | |
293 | ld-index.ms: ld.ms | |
294 | $(ROFF) -ms ld.ms 2>&1 1>/dev/null | \ | |
295 | sed -e '/: warning:/d' | \ | |
296 | texi2index >ld-index.ms | |
297 | ||
298 | # roff output (-mm) | |
299 | ld.mm: $(srcdir)/ld.texinfo | |
300 | sed -e '/\\input texinfo/d' \ | |
301 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
302 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
303 | -e '/^@c/d' \ | |
304 | -e 's/{.*,,/{/' \ | |
305 | -e '/@noindent/d' \ | |
306 | -e 's/@ / /g' \ | |
307 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
308 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
309 | $(srcdir)/ld.texinfo | \ | |
310 | $(TEXI2ROFF) $(TEXI2OPT) -mm | \ | |
311 | sed -e 's/---/\\(em/g' \ | |
312 | >ld.mm | |
313 | ||
314 | # index for roff output | |
315 | ld-index.mm: ld.mm | |
316 | $(ROFF) -mm ld.mm 2>&1 1>/dev/null | \ | |
317 | sed -e '/: warning:/d' | \ | |
318 | texi2index >ld-index.mm | |
319 | ||
320 | # roff output (-me) | |
321 | ld.me: $(srcdir)/ld.texinfo | |
322 | sed -e '/\\input texinfo/d' \ | |
323 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
324 | -e '/^@ifinfo/,/^@end ifinfo/d' \ | |
325 | -e '/^@c/d' \ | |
326 | -e 's/{.*,,/{/' \ | |
327 | -e 's/@ / /g' \ | |
328 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
329 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
330 | $(srcdir)/ld.texinfo | \ | |
331 | $(TEXI2ROFF) $(TEXI2OPT) -me | \ | |
332 | sed -e 's/---/\\(em/g' \ | |
333 | >>ld.me | |
334 | ||
335 | # index for roff output | |
336 | ld-index.me: ld.me | |
337 | $(ROFF) -me ld.me 2>&1 1>/dev/null | \ | |
338 | sed -e '/: warning:/d' | \ | |
339 | texi2index >ld-index.me | |
340 | ||
341 | ||
342 | ###################################################################### | |
343 | ||
344 | mkscript: $(srcdir)/mkscript.c | |
345 | $(CC) $(CFLAGS) $(LDFLAGS) -o mkscript $(srcdir)/mkscript.c $(LOADLIBES) | |
346 | ||
347 | ldlex.c: ldlex.l ldgram.h | |
348 | ldlex.o: ldlex.c ldgram.h | |
349 | ldgram.o: ldgram.c | |
350 | ldgram.c: ldgram.y | |
351 | ||
352 | ldgld68k.x : ldgld68k.sc | |
353 | ldgld68kUr.x : ldgld68kUr.sc | |
354 | ldgld68kr.x : ldgld68kr.sc | |
355 | h8300hds.x: h8300hds.sc | |
356 | ldgld.x : ldgld.sc | |
357 | ldgldUr.x : ldgldUr.sc | |
358 | ldgldr.x : ldgldr.sc | |
359 | ldlnk960.x : ldlnk960.sc | |
360 | ldlnk960r.x : ldlnk960r.sc | |
361 | ldgld960.x : ldgld960.sc | |
362 | ldgldm88k.x : ldgldm88k.sc | |
363 | ldm88kUr.x : ldm88kUr.sc | |
364 | ldm88kr.x: ldm88kr.sc | |
365 | ldm88k.x: ldm88k.sc | |
366 | news.x: news.sc | |
367 | i386aout.x: i386aout.sc | |
368 | h8300hds.x: h8300hds.sc | |
369 | h8300hds.o: h8300hds.c | |
370 | ldgld68k.x: ldgld68k.sc | |
371 | ldglda29k.x : ldglda29k.sc | |
372 | ldglda29kr.x : ldglda29kr.sc | |
373 | ldglda29kUr.x : ldglda29kUr.sc | |
374 | ||
375 | ebmon29k.x : ebmon29k.sc | |
376 | ebmon29kr.x : ebmon29kr.sc | |
377 | ebmon29kUr.x : ebmon29kUr.sc | |
378 | ||
379 | stage1: force | |
380 | - mkdir stage1 | |
381 | - mv -f $(STAGESTUFF) stage1 | |
382 | - (cd stage1 ; ln -s $(LD_PROG) ld) | |
383 | ||
384 | stage2: force | |
385 | - mkdir stage2 | |
386 | - mv -f $(STAGESTUFF) stage2 | |
387 | - (cd stage2 ; ln -s $(LD_PROG) ld) | |
388 | ||
389 | stage3: force | |
390 | - mkdir stage3 | |
391 | - mv -f $(STAGESTUFF) stage3 | |
392 | - (cd stage3 ; ln -s $(LD_PROG) ld) | |
393 | ||
394 | against=stage2 | |
395 | ||
396 | comparison: force | |
397 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
398 | ||
399 | de-stage1: force | |
400 | - (cd stage1 ; mv -f * ..) | |
401 | - rm ld | |
402 | - rmdir stage1 | |
403 | ||
404 | de-stage2: force | |
405 | - (cd stage2 ; mv -f * ..) | |
406 | - rm ld | |
407 | - rmdir stage2 | |
408 | ||
409 | de-stage3: force | |
410 | - (cd stage3 ; mv -f * ..) | |
411 | - rm ld | |
412 | - rmdir stage3 | |
413 | ||
414 | clean: | |
415 | - rm -f TAGS $(OFILES) $(GENERATED_SOURCES) $(GENERATED_HEADERS) | |
416 | - rm -f *.x *.x[runN] *.sc[runN] | |
417 | - rm -f ld.?? ld.??? | |
418 | - rm -f ld ld1 ld2 ld3 ld.new mkscript *.o y.output | |
419 | ||
420 | lintlog: $(SOURCES) Makefile | |
421 | $(LINT) -abhxzn $(LINTFLAGS) $(LINTSOURCES) \ | |
422 | | grep -v "pointer casts may be troublesome" \ | |
423 | | grep -v "possible pointer alignment problem" \ | |
424 | | grep -v "ignore" \ | |
425 | | grep -v "conversion from long may lose accuracy" \ | |
426 | | grep -v "warning: constant argument to NOT" \ | |
427 | | grep -v "enumeration type clash, operator CAST" \ | |
428 | | grep -v "warning: constant in conditional context"\ | |
429 | | grep -v "archive\.c" | |
430 | ||
431 | ||
432 | tags TAGS: $(SOURCES) $(HEADERS) | |
433 | etags -t $? | |
434 | ||
435 | ||
436 | objdump: objdump.c | |
437 | ||
438 | install: $(LD_PROG) | |
439 | $(INSTALL_PROGRAM) ld.new $(ddestdir)/bin/ld | |
440 | $(INSTALL_PROGRAM) ld.new $(gcclibdir)/ld | |
441 | ||
442 | install-info: all-info | |
443 | for i in ld.info* ; do \ | |
444 | echo Installing $$i... ; \ | |
445 | (cp $$i $(idestdir)/info/$$i.new \ | |
446 | && mv -f $(idestdir)/info/$$i.new $(idestdir)/info/$$i) \ | |
447 | || exit 1 ; \ | |
448 | done | |
449 | ||
450 | # Something like the following might make sense for install, but doesn't work | |
451 | # - it is too fragile, depending on a gcc binary int the right place. | |
452 | # Perhaps using gcc/version.c might work? | |
453 | # # If $(gcclibdir) exists, install ld there, and put a link to it | |
454 | # # from $(bindir); otherwise put ld in $(bindir). | |
455 | # if ([ -x $(unsubdir)/../gcc$(subdir)/gcc -a -d $(gcclibdir) ]); then \ | |
456 | # $(INSTALL_PROGRAM) ld.new $(gcclibdir)/ld; \ | |
457 | # cd $(bindir); rm -f ld; ln -s $(gcclibdir)/ld ld; \ | |
458 | # else \ | |
459 | # $(INSTALL_PROGRAM) ld.new $(bindir)/ld; \ | |
460 | # fi | |
461 | ||
462 | #----------------------------------------------------------------------------- | |
463 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
464 | # | |
465 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
466 | #----------------------------------------------------------------------------- | |
467 | ||
468 | ver960.c: FORCE | |
469 | rm -f ver960.c | |
470 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
471 | ||
472 | ||
473 | # This target should be invoked before building a new release. | |
474 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
475 | # | |
476 | roll: | |
477 | @V=`cat VERSION` ; \ | |
478 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
479 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
480 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
481 | rm -f VERSION ; \ | |
482 | echo $$V >VERSION ; \ | |
483 | echo Version $$V | |
484 | ||
485 | ||
486 | dep: $(LDSOURCES) | |
487 | mkdep $(CFLAGS) $? | |
488 | ||
489 | # Dummy target to force execution of dependent targets. | |
490 | # | |
491 | force: | |
492 | ||
493 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
494 | # have the following string beginning in column 1: #__<hostname>__# | |
495 | # Original Makefile is backed up as 'Makefile.old'. | |
496 | # | |
497 | # Invoke with: make make HOST=xxx | |
498 | # | |
499 | make: | |
500 | -@if test $(HOST)x = x ; then \ | |
501 | echo '\aSpecify "make make HOST=???"'; \ | |
502 | exit 1; \ | |
503 | fi ; \ | |
504 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
505 | if test $$? = 0 ; then \ | |
506 | echo "\aMakefile has already been processed with 'make make'";\ | |
507 | exit 1; \ | |
508 | fi ; \ | |
509 | mv -f Makefile Makefile.old; \ | |
510 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
511 | echo "HOST=$(HOST)" >>Makefile ; \ | |
512 | echo >>Makefile ; \ | |
513 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
514 | ||
515 | #\f | |
516 | ||
517 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) | |
518 | $(SHELL) ./config.status | |
519 | ||
520 | ### Local Variables: *** | |
521 | ### mode:fundamental *** | |
522 | ### page-delimiter: "^#\f" *** | |
523 | ### End: *** | |
524 | ### end of file | |
525 | ||
526 | ||
527 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |