Commit | Line | Data |
---|---|---|
d8474a9b | 1 | # Makefile for GNU binary-file utilities |
d8e89b6b | 2 | # Copyright (C) 1989-1992 Free Software Foundation, Inc. |
d8474a9b PB |
3 | |
4 | # This file is part of GNU binutils. | |
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. | |
99a42820 | 19 | |
a10d26a1 | 20 | srcdir = . |
84396dcf | 21 | |
d8e89b6b RP |
22 | prefix = /usr/local |
23 | ||
24 | program_prefix = | |
f478fcf6 | 25 | program_suffix = |
d8e89b6b RP |
26 | exec_prefix = $(prefix) |
27 | bindir = $(exec_prefix)/bin | |
28 | libdir = $(exec_prefix)/lib | |
29 | tooldir = $(libdir) | |
30 | ||
31 | datadir = $(prefix)/lib | |
32 | mandir = $(prefix)/man | |
33 | man1dir = $(mandir)/man1 | |
34 | man2dir = $(mandir)/man2 | |
35 | man3dir = $(mandir)/man3 | |
36 | man4dir = $(mandir)/man4 | |
37 | man5dir = $(mandir)/man5 | |
38 | man6dir = $(mandir)/man6 | |
39 | man7dir = $(mandir)/man7 | |
40 | man8dir = $(mandir)/man8 | |
41 | man9dir = $(mandir)/man9 | |
42 | infodir = $(prefix)/info | |
43 | includedir = $(prefix)/include | |
44 | docdir = $(datadir)/doc | |
84396dcf RP |
45 | |
46 | SHELL = /bin/sh | |
d8e89b6b RP |
47 | |
48 | INSTALL = install -c | |
49 | INSTALL_PROGRAM = $(INSTALL) | |
50 | INSTALL_DATA = $(INSTALL) | |
51 | ||
52 | AR = ar | |
53 | AR_FLAGS = qv | |
54 | CFLAGS = -g | |
d8e89b6b RP |
55 | MAKEINFO = makeinfo |
56 | RANLIB = ranlib | |
9752f9fd | 57 | BISONFLAGS = -d |
c83497f5 | 58 | TEXI2ROFF=texi2roff |
b5132a6b | 59 | |
9752f9fd | 60 | BISON = `if [ -f ../byacc/byacc ] ; then echo ../byacc/byacc ; else echo byacc ; fi` |
45212e5e PB |
61 | # Comment these out if using lex. |
62 | LEX_OPTIONS = -I -Cem | |
63 | LEX = `if [ -f ../flex/flex ] ; then echo ../flex/flex -S../flex/flex.skel ; else echo flex ; fi` | |
64 | ||
8539db10 | 65 | # Distribution version |
455a0d28 | 66 | VERSION=1.97.90 |
8539db10 | 67 | # Distribution name |
d8e89b6b | 68 | DIST_NAME=binutils-${VERSION} |
8539db10 | 69 | |
d8e89b6b | 70 | version=`./../gcc/gcc -dumpversion` |
b5132a6b | 71 | |
6b583720 | 72 | # Where to find texinfo.tex to format docn with TeX |
b7a11ec2 RP |
73 | TEXIDIR = $(srcdir)/../texinfo/fsf |
74 | ||
84396dcf RP |
75 | MANPAGES= ar.1 nm.1 objdump.1 ranlib.1 size.1 strip.1 |
76 | ||
a10d26a1 | 77 | #CC=gcc -Wall |
06a97fbd | 78 | # these two are almost the same program |
a10d26a1 RP |
79 | AR_PROG=ar |
80 | RANLIB_PROG=ranlib | |
99a42820 RP |
81 | |
82 | # copy and strip should be the same program | |
a10d26a1 RP |
83 | COPY_PROG=copy |
84 | STRIP_PROG=strip | |
99a42820 RP |
85 | |
86 | # These should all be the same program too. | |
a10d26a1 RP |
87 | SIZE_PROG=size |
88 | NM_PROG=nm | |
89 | OBJDUMP_PROG=objdump | |
99a42820 | 90 | |
d8e89b6b | 91 | PROGS = $(SIZE_PROG) $(OBJDUMP_PROG) $(NM_PROG) $(AR_PROG) $(STRIP_PROG) $(RANLIB_PROG) |
a01bf1fb | 92 | STAGESTUFF = $(PROGS) *.o |
99a42820 | 93 | |
40773f7f | 94 | BASEDIR = $(srcdir)/.. |
d8e89b6b | 95 | LIBDIR = ./../bfd |
a4ef8601 | 96 | OPCODEDIR = ./../opcodes |
a10d26a1 | 97 | |
a10d26a1 RP |
98 | #### host and target dependant Makefile fragments come in here. |
99 | ### | |
100 | ||
9bba7784 | 101 | INCDIR = $(BASEDIR)/include |
99a42820 | 102 | |
d8e89b6b RP |
103 | .c.o: |
104 | $(CC) -c $(CFLAGS) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES) $< | |
99a42820 | 105 | |
a26878d1 RP |
106 | # When adding .o files, to make VPATH work in Sun Make, you have to |
107 | # also add a foo.o: foo.c line at the bottom of the file. | |
60c80016 | 108 | DISASMS = m68k-pinsn.o i960-pinsn.o i386-pinsn.o sparc-pinsn.o am29k-pinsn.o |
6a3958b2 | 109 | |
99a42820 RP |
110 | #\f |
111 | ## Random definitions | |
112 | # Hopefully all these may be flushed once we get configuration down pat. | |
113 | ||
114 | # alloca only needed for systems which don't have it and when cc != gcc. | |
115 | # ALLOCA = alloca.o | |
116 | ||
117 | # nm tries to malloc enough space for the string table. The old GNU malloc | |
118 | # rounds this up to a power of two (e.g. 5M becomes 8M), and so it might | |
119 | # fail unnecessarily. I've also seen some Unix malloc's fail, even when | |
120 | # there is enough memory. So use the new GNU malloc. | |
121 | # MALLOC = gmalloc.o | |
122 | ||
123 | # Use the GNU getopt unless you have problems with it. | |
124 | # The IRIS version could probably benefit from being assembled with | |
125 | # libmalloc rather than the ordinary malloc. | |
d8e89b6b | 126 | LIBIBERTY = ./../libiberty/libiberty.a |
99a42820 RP |
127 | |
128 | # Code shared by all the binutils. | |
a10d26a1 | 129 | BULIBS = bucomm.o version.o filemode.o |
99a42820 | 130 | |
7a5a3c7b | 131 | ADDL_LIBS = $(MALLOC) $(BULIBS) $(BFD) $(LIBIBERTY) |
99a42820 RP |
132 | |
133 | BFD = $(LIBDIR)/libbfd.a | |
a4ef8601 | 134 | OPCODES = $(OPCODEDIR)/libopcodes.a |
99a42820 RP |
135 | #\f |
136 | ## The rules | |
137 | ||
c83497f5 RP |
138 | all: $(ADDL_LIBS) $(PROGS) |
139 | ||
d8e89b6b | 140 | check: |
dc760829 | 141 | /bin/sh $(srcdir)/sanity.sh . |
d8e89b6b | 142 | |
7d6cc102 RP |
143 | test-install: |
144 | /bin/sh $(srcdir)/sanity.sh $(bindir) | |
145 | ||
d8e89b6b | 146 | info: binutils.info |
a10d26a1 RP |
147 | |
148 | #$(BFD):$(LIBDIR)/../common/*.c | |
149 | # (cd $(LIBDIR); make) | |
99a42820 | 150 | |
a10d26a1 | 151 | $(SIZE_PROG): $(ADDL_LIBS) size.o $(BFD) |
6a3958b2 | 152 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(SIZE_PROG) size.o $(ADDL_LIBS) $(LOADLIBES) |
99a42820 | 153 | |
d8e89b6b RP |
154 | $(COPY_PROG): $(ADDL_LIBS) copy.o not-strip.o $(BFD) |
155 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o not-strip.o $(ADDL_LIBS) $(LOADLIBES) | |
156 | ||
157 | $(STRIP_PROG): $(ADDL_LIBS) copy.o is-strip.o $(BFD) | |
158 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(STRIP_PROG) copy.o is-strip.o $(ADDL_LIBS) $(LOADLIBES) | |
99a42820 | 159 | |
a10d26a1 | 160 | $(NM_PROG): $(ADDL_LIBS) nm.o $(BFD) |
6a3958b2 | 161 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(NM_PROG) nm.o $(ADDL_LIBS) $(LOADLIBES) |
99a42820 | 162 | |
a4ef8601 | 163 | $(OBJDUMP_PROG): $(ADDL_LIBS) size.o objdump.o $(DISASMS) $(BFD) $(OPCODES) |
fd9d7e4a | 164 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(OBJDUMP_PROG) objdump.o $(DISASMS) $(ADDL_LIBS) $(OPCODES) $(LOADLIBES) |
99a42820 | 165 | |
d8e89b6b | 166 | arparse.c:arparse.y |
9752f9fd ME |
167 | $(BISON) $(BISONFLAGS) $(srcdir)/arparse.y |
168 | -mv y.tab.c arparse.c | |
169 | -mv y.tab.h arparse.h | |
d8e89b6b | 170 | |
99a42820 | 171 | |
9752f9fd ME |
172 | arlex.c: arlex.l |
173 | $(LEX) $(LEX_OPTIONS) $(srcdir)/arlex.l | |
174 | mv lex.yy.c arlex.c | |
d8e89b6b RP |
175 | |
176 | $(AR_PROG): $(ADDL_LIBS) ar.o arparse.o arlex.o not-ranlib.o $(BFD) arsup.o | |
177 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o arparse.o arlex.o arsup.o not-ranlib.o $(ADDL_LIBS) $(LOADLIBES) | |
178 | ||
179 | $(RANLIB_PROG): $(ADDL_LIBS) ar.o is-ranlib.o arparse.o arlex.o arsup.o $(BFD) | |
180 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(RANLIB_PROG) ar.o arparse.o arlex.o arsup.o is-ranlib.o $(ADDL_LIBS) $(LOADLIBES) | |
06a97fbd PB |
181 | |
182 | # This rule creates a single binary that switches between ar and ranlib | |
183 | # by looking at argv[0]. Use this kludge to save some disk space. | |
184 | # However, you have to install things by hand. | |
185 | # (That is after 'make install', replace the installed ranlib by a link to ar.) | |
186 | ||
187 | # Alternatively, you can install ranlib.sh as ranlib. | |
188 | ||
189 | ar_with_ranlib: $(ADDL_LIBS) ar.o maybe-ranlib.o $(BFD) | |
190 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(AR_PROG) ar.o maybe-ranlib.o $(ADDL_LIBS) $(LOADLIBES) | |
a10d26a1 RP |
191 | -rm -f $(RANLIB_PROG) |
192 | -ln $(AR_PROG) $(RANLIB_PROG) | |
99a42820 | 193 | |
d8e89b6b RP |
194 | # copy and strip in one binary that uses argv[0] to decide its action. |
195 | ||
196 | copy_with_strip: $(ADDL_LIBS) copy.o maybe-strip.o $(BFD) | |
197 | $(CC) $(LDFLAGS) $(CFLAGS) -o $(COPY_PROG) copy.o maybe-strip.o $(ADDL_LIBS) $(LOADLIBES) | |
a10d26a1 RP |
198 | -rm -f $(STRIP_PROG) |
199 | -ln $(COPY_PROG) $(STRIP_PROG) | |
99a42820 | 200 | |
6a3958b2 RP |
201 | stage1: force |
202 | - mkdir stage1 | |
a01bf1fb | 203 | - mv -f $(STAGESTUFF) stage1 |
6a3958b2 RP |
204 | |
205 | stage2: force | |
206 | - mkdir stage2 | |
a01bf1fb | 207 | - mv -f $(STAGESTUFF) stage2 |
6a3958b2 RP |
208 | |
209 | stage3: force | |
210 | - mkdir stage3 | |
a01bf1fb RP |
211 | - mv -f $(STAGESTUFF) stage3 |
212 | ||
213 | against=stage2 | |
214 | ||
215 | comparison: force | |
216 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
6a3958b2 RP |
217 | |
218 | de-stage1: force | |
219 | - (cd stage1 ; mv -f * ..) | |
220 | - rmdir stage1 | |
221 | ||
222 | de-stage2: force | |
223 | - (cd stage2 ; mv -f * ..) | |
224 | - rmdir stage2 | |
225 | ||
226 | de-stage3: force | |
227 | - (cd stage3 ; mv -f * ..) | |
228 | - rmdir stage3 | |
229 | ||
6b583720 RP |
230 | ###################################################################### |
231 | # DOCUMENTATION TARGETS | |
232 | # TeX output | |
2226a090 RP |
233 | binutils.dvi: $(srcdir)/binutils.texi |
234 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi | |
b7a11ec2 | 235 | texindex binutils.?? |
2226a090 | 236 | TEXINPUTS=${TEXIDIR}:.:$$TEXINPUTS tex $(srcdir)/binutils.texi |
b7a11ec2 | 237 | |
6b583720 | 238 | # info file for online browsing |
2226a090 | 239 | binutils.info: $(srcdir)/binutils.texi |
6141fd50 | 240 | $(MAKEINFO) -o binutils.info $(srcdir)/binutils.texi |
b7a11ec2 | 241 | |
0c10ff03 | 242 | # different targets for -ms, -mm, -me |
c83497f5 RP |
243 | # Try to use a recent texi2roff. v2 was put on prep in jan91. |
244 | # If you want an index, see texi2roff doc for postprocessing | |
245 | # and add -i to texi2roff invocations below. | |
246 | # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete | |
247 | # correspondint -e lines when later texi2roff's are current) | |
248 | # + @ifinfo's deleted explicitly due to texi2roff-2 bug w nested constructs. | |
249 | # + @c's deleted explicitly because texi2roff sees texinfo commands in them | |
250 | # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank | |
251 | # + @alphaenumerate is ridiculously new, turned into @enumerate | |
252 | ||
0c10ff03 | 253 | # roff output (-ms) |
2226a090 | 254 | binutils.ms: $(srcdir)/binutils.texi |
6b583720 RP |
255 | sed -e '/\\input texinfo/d' \ |
256 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
257 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
258 | -e '/^@c/d' \ | |
2226a090 | 259 | -e 's/{.*,,/{/' \ |
c83497f5 RP |
260 | -e 's/@ / /g' \ |
261 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
262 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 263 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 264 | $(TEXI2ROFF) -ms | \ |
c83497f5 RP |
265 | sed -e 's/---/\\(em/g' \ |
266 | >binutils.ms | |
6b583720 | 267 | |
0c10ff03 | 268 | # roff output (-mm) |
c83497f5 RP |
269 | # '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, |
270 | # try leaving them in | |
2226a090 | 271 | binutils.mm: $(srcdir)/binutils.texi |
0c10ff03 RP |
272 | sed -e '/\\input texinfo/d' \ |
273 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
274 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
275 | -e '/^@c/d' \ | |
2226a090 RP |
276 | -e 's/{.*,,/{/' \ |
277 | -e '/@noindent/d' \ | |
c83497f5 RP |
278 | -e 's/@ / /g' \ |
279 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
280 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 281 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 282 | $(TEXI2ROFF) -mm | \ |
2226a090 RP |
283 | sed -e 's/---/\\(em/g' \ |
284 | >binutils.mm | |
0c10ff03 RP |
285 | |
286 | # roff output (-me) | |
2226a090 | 287 | binutils.me: $(srcdir)/binutils.texi |
0c10ff03 RP |
288 | sed -e '/\\input texinfo/d' \ |
289 | -e '/@c TEXI2ROFF-KILL/,/@c END TEXI2ROFF-KILL/d' \ | |
c83497f5 RP |
290 | -e '/^@ifinfo/,/^@end ifinfo/d' \ |
291 | -e '/^@c/d' \ | |
2226a090 | 292 | -e 's/{.*,,/{/' \ |
c83497f5 RP |
293 | -e 's/@ / /g' \ |
294 | -e 's/^@alphaenumerate/@enumerate/g' \ | |
295 | -e 's/^@end alphaenumerate/@end enumerate/g' \ | |
2226a090 | 296 | $(srcdir)/binutils.texi | \ |
d8e89b6b | 297 | $(TEXI2ROFF) -me | \ |
c83497f5 RP |
298 | sed -e 's/---/\\(em/g' \ |
299 | >binutils.me | |
0c10ff03 RP |
300 | |
301 | ||
6b583720 RP |
302 | ###################################################################### |
303 | ||
99a42820 | 304 | clean: |
b7a11ec2 | 305 | -rm -f *.o *~ \#* core $(STAGESTUFF) TAGS binutils.?? binutils.??? |
99a42820 RP |
306 | |
307 | etags tags: TAGS | |
308 | ||
6a3958b2 | 309 | TAGS: force |
99a42820 RP |
310 | etags $(INCDIR)/*.h $(BFDSRC)/*.[hc] *.[hc] |
311 | ||
312 | realclean: clean | |
a01bf1fb | 313 | -rm -f $(STAGESTUFF) TAGS |
99a42820 | 314 | |
c83497f5 | 315 | install: all |
f478fcf6 ILT |
316 | -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \ |
317 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
318 | -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi | |
b5132a6b | 319 | for i in $(PROGS) ; do \ |
f478fcf6 | 320 | $(INSTALL_PROGRAM) $$i $(bindir)/$(program_prefix)$${i}$(program_suffix) ; \ |
99a42820 | 321 | done |
f478fcf6 ILT |
322 | -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \ |
323 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
324 | -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi | |
84396dcf | 325 | for i in $(MANPAGES) ; do \ |
f478fcf6 | 326 | $(INSTALL_DATA) $(srcdir)/$$i $(man1dir)/$(program_prefix)$${i}$(program_suffix) ; \ |
de53632c | 327 | done |
c83497f5 | 328 | |
d8e89b6b | 329 | install-info: info |
f478fcf6 ILT |
330 | -parent=`echo $(infodir)|sed -e 's@/[^/]*$$@@'`; \ |
331 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
332 | -if [ -d $(infodir) ] ; then true ; else mkdir $(infodir) ; fi | |
de53632c | 333 | for i in *.info* ; do \ |
d8e89b6b | 334 | $(INSTALL_DATA) $$i $(infodir)/$$i ; \ |
84396dcf | 335 | done |
99a42820 | 336 | |
d8e89b6b RP |
337 | clean-info: |
338 | -rm -rf *.info* | |
339 | ||
8539db10 PB |
340 | dist: $(DIST_NAME).tar.Z |
341 | ||
d8474a9b | 342 | $(DIST_NAME).tar.Z: |
b27d2046 | 343 | cd ../..; rm -f $(DIST_NAME); ln -s devo $(DIST_NAME) |
45212e5e PB |
344 | make arparse.c arlex.c binutils.mm -f Makefile.in |
345 | cd ../ld; make ldgram.c ldgram.h ldlex.c ld.mm -f Makefile.in | |
d8474a9b | 346 | cd ../..; tar chf - $(DIST_NAME) | compress >$(DIST_NAME).tar.Z |
b27d2046 | 347 | rm -rf ../../$(DIST_NAME) |
8539db10 | 348 | |
d7cce023 JG |
349 | # These get around a bug in Sun Make in SunOS 4.1.1 |
350 | alloca.o:alloca.c | |
a26878d1 | 351 | am29k-pinsn.o: am29k-pinsn.c |
99a42820 | 352 | ar.o: ar.c |
22923083 | 353 | arsup.o: arsup.c |
d7cce023 JG |
354 | bucomm.o: bucomm.c |
355 | copy.o: copy.c | |
d7cce023 | 356 | filemode.o:filemode.c |
a10d26a1 RP |
357 | getopt.o:getopt.c |
358 | getopt1.o:getopt1.c | |
d7cce023 JG |
359 | gmalloc.o:gmalloc.c |
360 | i960-pinsn.o: i960-pinsn.c | |
361 | is-ranlib.o:is-ranlib.c | |
d8e89b6b | 362 | is-strip.o:is-strip.c |
d7cce023 JG |
363 | m68k-pinsn.o: m68k-pinsn.c |
364 | maybe-ranlib.o:maybe-ranlib.c | |
d8e89b6b | 365 | maybe-strip.o:maybe-strip.c |
d7cce023 JG |
366 | nm.o: nm.c |
367 | not-ranlib.o:not-ranlib.c | |
d8e89b6b | 368 | not-strip.o:not-strip.c |
d7cce023 JG |
369 | objdump.o: objdump.c |
370 | size.o: size.c | |
371 | sparc-pinsn.o: sparc-pinsn.c | |
60c80016 | 372 | i386-pinsn.o: i386-pinsn.c |
d7cce023 | 373 | strip.o:strip.c |
d8e89b6b RP |
374 | version.o: $(srcdir)/version.c |
375 | $(CC) $(CFLAGS) -I. -I$(srcdir) -I$(INCDIR) $(HDEFINES) $(TDEFINES) -DVERSION='"$(VERSION)"' -c $(srcdir)/version.c | |
8539db10 | 376 | |
99a42820 RP |
377 | #----------------------------------------------------------------------------- |
378 | # 'STANDARD' GNU/960 TARGETS BELOW THIS POINT | |
379 | # | |
380 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
381 | #----------------------------------------------------------------------------- | |
382 | ||
383 | ver960.c: FORCE | |
384 | rm -f ver960.c | |
385 | echo "char ${TARG}_ver[]= \"${TARG} `cat VERSION`, `date`\";" > ver960.c | |
386 | ||
387 | ||
388 | # Dummy target to force execution of dependent targets. | |
389 | # | |
6a3958b2 | 390 | force: |
99a42820 RP |
391 | |
392 | # Target to uncomment host-specific lines in this makefile. Such lines must | |
393 | # have the following string beginning in column 1: #__<hostname>__# | |
394 | # Original Makefile is backed up as 'Makefile.old'. | |
395 | # | |
396 | # Invoke with: make make HOST=xxx | |
397 | # | |
398 | make: | |
399 | -@if test $(HOST)x = x ; then \ | |
400 | echo '\aSpecify "make make HOST=???"'; \ | |
401 | exit 1; \ | |
402 | fi ; \ | |
403 | grep -s "^#The next line was generated by 'make make'" Makefile; \ | |
404 | if test $$? = 0 ; then \ | |
405 | echo "\aMakefile has already been processed with 'make make'";\ | |
406 | exit 1; \ | |
407 | fi ; \ | |
408 | mv -f Makefile Makefile.old; \ | |
409 | echo "#The next line was generated by 'make make'" >Makefile ; \ | |
410 | echo "HOST=$(HOST)" >>Makefile ; \ | |
411 | echo >>Makefile ; \ | |
412 | sed "s/^#__$(HOST)__#//" < Makefile.old >>Makefile | |
413 | ||
f1eb48b6 | 414 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
a26878d1 | 415 | $(SHELL) ./config.status |
99a42820 RP |
416 | |
417 | ### Local Variables: *** | |
418 | ### mode:fundamental *** | |
419 | ### page-delimiter: "^#\f" *** | |
420 | ### End: *** | |
421 | ### end of file |