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