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