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