]>
Commit | Line | Data |
---|---|---|
28d3e4a3 | 1 | ## @configure_input@ |
fecd2382 | 2 | # Makefile for GNU Assembler |
7420b02b | 3 | # Copyright (C) 1987-1992, 1993 Free Software Foundation, Inc. |
fecd2382 | 4 | |
7420b02b | 5 | # This file is part of GNU GAS. |
fecd2382 | 6 | |
7420b02b JL |
7 | # GNU GAS is free software; you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by | |
9 | # the Free Software Foundation; either version 2, or (at your option) | |
10 | # any later version. | |
fecd2382 | 11 | |
7420b02b JL |
12 | # GNU GAS is distributed in the hope that it will be useful, |
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | # GNU General Public License for more details. | |
fecd2382 | 16 | |
7420b02b JL |
17 | # You should have received a copy of the GNU General Public License |
18 | # along with GNU GAS; see the file COPYING. If not, write to | |
19 | # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
fecd2382 | 20 | |
fecd2382 RP |
21 | # The targets for external use include: |
22 | # all, doc, proto, install, uninstall, includes, TAGS, | |
daa7e184 | 23 | # clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4. |
fecd2382 RP |
24 | |
25 | # Variables that exist for you to override. | |
26 | # See below for how to change them for certain systems. | |
27 | ||
b11fb939 KR |
28 | VPATH = @srcdir@ |
29 | srcdir = @srcdir@ | |
7420b02b | 30 | srcroot = $(srcdir)/.. |
1058238c | 31 | |
fa156ffe | 32 | target_alias = @target_alias@ |
1bc37618 | 33 | prefix = @prefix@ |
1058238c | 34 | |
fa156ffe | 35 | program_transform_name = @program_transform_name@ |
1bc37618 | 36 | exec_prefix = @exec_prefix@ |
787c6bfe RP |
37 | bindir = $(exec_prefix)/bin |
38 | libdir = $(exec_prefix)/lib | |
b63defaa | 39 | tooldir = $(exec_prefix)/$(target_alias) |
787c6bfe | 40 | |
1058238c | 41 | datadir = $(prefix)/lib |
787c6bfe | 42 | mandir = $(prefix)/man |
1058238c RP |
43 | man1dir = $(mandir)/man1 |
44 | man2dir = $(mandir)/man2 | |
45 | man3dir = $(mandir)/man3 | |
46 | man4dir = $(mandir)/man4 | |
47 | man5dir = $(mandir)/man5 | |
48 | man6dir = $(mandir)/man6 | |
49 | man7dir = $(mandir)/man7 | |
50 | man8dir = $(mandir)/man8 | |
51 | man9dir = $(mandir)/man9 | |
787c6bfe | 52 | infodir = $(prefix)/info |
1058238c RP |
53 | includedir = $(prefix)/include |
54 | docdir = $(datadir)/doc | |
55 | ||
aa30c7ee | 56 | VERSION=cygnus-2.5.3 |
c97b9003 | 57 | |
fecd2382 | 58 | SHELL = /bin/sh |
1058238c | 59 | |
7420b02b | 60 | INSTALL = $${srcroot}/install.sh -c |
fecd2382 | 61 | INSTALL_PROGRAM = $(INSTALL) |
1058238c | 62 | INSTALL_DATA = $(INSTALL) |
aa30c7ee | 63 | INSTALL_XFORM = $(INSTALL) -t='-e $(program_transform_name)' |
c97b9003 | 64 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 |
fecd2382 | 65 | |
6d60424f KR |
66 | DISTSTUFF= make-gas.com |
67 | ||
1058238c RP |
68 | AR = ar |
69 | AR_FLAGS = qv | |
f2889110 | 70 | BISON = bison -y |
1058238c | 71 | MAKEINFO = makeinfo |
c97b9003 | 72 | TEXI2DVI = texi2dvi |
fecd2382 | 73 | RANLIB = ranlib |
b11fb939 | 74 | CC = @CC@ |
4b857710 ILT |
75 | CFLAGS = -g |
76 | ||
7420b02b JL |
77 | MAKEOVERRIDES= |
78 | ||
4b857710 ILT |
79 | FLAGS_TO_PASS = \ |
80 | "prefix=$(prefix)" \ | |
81 | "exec_prefix=$(exec_prefix)" \ | |
82 | "tooldir=$(tooldir)" \ | |
83 | "AR=$(AR)" \ | |
84 | "AR_FLAGS=$(AR_FLAGS)" \ | |
85 | "CC=$(CC)" \ | |
86 | "CFLAGS=$(CFLAGS)" \ | |
87 | "RANLIB=$(RANLIB)" \ | |
88 | "LOADLIBES=$(LOADLIBES)" \ | |
89 | "LDFLAGS=$(LDFLAGS)" \ | |
90 | "BISON=$(BISON)" \ | |
91 | "LEX=$(LEX)" \ | |
92 | "MAKEINFO=$(MAKEINFO)" \ | |
93 | "INSTALL=$(INSTALL)" \ | |
94 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
95 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" | |
fecd2382 | 96 | |
5a051773 | 97 | RUNTEST=runtest |
c97b9003 | 98 | CHECKFLAGS= \ |
03372cf4 | 99 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ |
5a051773 | 100 | "RUNTEST=$(RUNTEST)" |
c97b9003 | 101 | |
fecd2382 RP |
102 | # Lists of files for various purposes. |
103 | ||
104 | REAL_SOURCES = \ | |
105 | $(srcdir)/app.c \ | |
106 | $(srcdir)/as.c \ | |
107 | $(srcdir)/atof-generic.c \ | |
108 | $(srcdir)/bignum-copy.c \ | |
109 | $(srcdir)/cond.c \ | |
110 | $(srcdir)/expr.c \ | |
5d53038b | 111 | $(srcdir)/flonum-konst.c \ |
fecd2382 RP |
112 | $(srcdir)/flonum-copy.c \ |
113 | $(srcdir)/flonum-mult.c \ | |
114 | $(srcdir)/frags.c \ | |
115 | $(srcdir)/hash.c \ | |
116 | $(srcdir)/hex-value.c \ | |
117 | $(srcdir)/input-file.c \ | |
118 | $(srcdir)/input-scrub.c \ | |
dffc8b9e | 119 | $(srcdir)/literal.c \ |
fecd2382 RP |
120 | $(srcdir)/messages.c \ |
121 | $(srcdir)/output-file.c \ | |
122 | $(srcdir)/read.c \ | |
fecd2382 RP |
123 | $(srcdir)/subsegs.c \ |
124 | $(srcdir)/symbols.c \ | |
fecd2382 | 125 | $(srcdir)/write.c \ |
3340f7e5 | 126 | $(srcdir)/listing.c \ |
9cc8106c | 127 | $(srcdir)/ecoff.c \ |
b63defaa | 128 | $(srcdir)/stabs.c |
fecd2382 RP |
129 | |
130 | # in an expedient order | |
131 | LINKED_SOURCES = \ | |
132 | targ-cpu.c \ | |
133 | obj-format.c \ | |
134 | atof-targ.c | |
135 | ||
136 | SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES) | |
137 | ||
138 | REAL_HEADERS = \ | |
139 | $(srcdir)/as.h \ | |
140 | $(srcdir)/bignum.h \ | |
141 | $(srcdir)/expr.h \ | |
142 | $(srcdir)/flonum.h \ | |
143 | $(srcdir)/frags.h \ | |
144 | $(srcdir)/hash.h \ | |
145 | $(srcdir)/input-file.h \ | |
542e1629 | 146 | $(srcdir)/listing.h \ |
fecd2382 RP |
147 | $(srcdir)/tc.h \ |
148 | $(srcdir)/obj.h \ | |
149 | $(srcdir)/read.h \ | |
fecd2382 RP |
150 | $(srcdir)/struc-symbol.h \ |
151 | $(srcdir)/subsegs.h \ | |
152 | $(srcdir)/symbols.h \ | |
9cc8106c ILT |
153 | $(srcdir)/write.h \ |
154 | $(srcdir)/ecoff.h | |
fecd2382 RP |
155 | |
156 | LINKED_HEADERS = \ | |
fecd2382 RP |
157 | targ-env.h \ |
158 | targ-cpu.h \ | |
159 | obj-format.h \ | |
160 | atof-targ.h | |
161 | ||
162 | HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS) | |
163 | ||
b11fb939 | 164 | # @target_frag@ |
b3cd8555 | 165 | |
fecd2382 RP |
166 | OBJS = \ |
167 | targ-cpu.o \ | |
168 | obj-format.o \ | |
169 | atof-targ.o \ | |
170 | app.o \ | |
171 | as.o \ | |
172 | atof-generic.o \ | |
173 | bignum-copy.o \ | |
174 | cond.o \ | |
175 | expr.o \ | |
5d53038b | 176 | flonum-konst.o \ |
fecd2382 RP |
177 | flonum-copy.o \ |
178 | flonum-mult.o \ | |
179 | frags.o \ | |
180 | hash.o \ | |
181 | hex-value.o \ | |
182 | input-file.o \ | |
183 | input-scrub.o \ | |
dffc8b9e | 184 | literal.o \ |
fecd2382 RP |
185 | messages.o \ |
186 | output-file.o \ | |
187 | read.o \ | |
fecd2382 RP |
188 | subsegs.o \ |
189 | symbols.o \ | |
fecd2382 | 190 | write.o \ |
3340f7e5 | 191 | listing.o \ |
9cc8106c | 192 | ecoff.o \ |
c751ad19 | 193 | stabs.o \ |
b3cd8555 | 194 | $(TE_OBJS) |
f6b67e4c | 195 | |
c92d9ee9 KR |
196 | # These are objects we know we'll be pulling in from other directories. |
197 | # For VMS, we have to build them explicitly. | |
198 | VMS_OTHER_OBJS = \ | |
b63defaa KR |
199 | ../libiberty/xmalloc.o \ |
200 | ../libiberty/xexit.o \ | |
c92d9ee9 KR |
201 | ../libiberty/obstack.o \ |
202 | ../libiberty/strdup.o \ | |
203 | ../libiberty/strncasecmp.o \ | |
b21e6e53 KR |
204 | ../libiberty/concat.o \ |
205 | ../libiberty/getopt.o \ | |
206 | ../libiberty/getopt1.o \ | |
c92d9ee9 KR |
207 | ../libiberty/getruntime.o |
208 | ||
1df6e266 | 209 | all: .gdbinit as.new gasp.new |
7420b02b JL |
210 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
211 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) all) | |
79a54a5b | 212 | |
7420b02b JL |
213 | dvi info install-info clean-info: |
214 | @srcroot=`cd $(srcroot); pwd`; export srcroot; \ | |
215 | (cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@) | |
fecd2382 | 216 | |
c20c7506 JL |
217 | make-gas.com: stamp-mk.com |
218 | stamp-mk.com: vmsconf.sh Makefile | |
c92d9ee9 | 219 | sh $(srcdir)/vmsconf.sh $(OBJS) $(VMS_OTHER_OBJS) > new-make.com |
c20c7506 JL |
220 | $(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com |
221 | touch stamp-mk.com | |
222 | ||
fecd2382 RP |
223 | # Now figure out from those variables how to compile and link. |
224 | ||
225 | # This is the variable actually used when we compile. | |
420065a5 | 226 | ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES) |
fecd2382 | 227 | |
fecd2382 RP |
228 | # How to link with both our special library facilities |
229 | # and the system's installed libraries. | |
f6b67e4c | 230 | |
b11fb939 | 231 | LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a |
fecd2382 RP |
232 | |
233 | # Specify the directories to be searched for header files. | |
234 | # Both . and srcdir are used, in that order, | |
235 | # so that tm.h and config.h will be found in the compilation | |
236 | # subdirectory rather than in the source directory. | |
c7072f56 | 237 | INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. |
fecd2382 RP |
238 | |
239 | # Always use -I$(srcdir)/config when compiling. | |
240 | .c.o: | |
241 | $(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $< | |
242 | ||
243 | # This tells GNU make version 3 not to export all the variables | |
244 | # defined in this file into the environment. | |
245 | .NOEXPORT: | |
542e1629 | 246 | |
fecd2382 | 247 | # Files to be copied away after each stage in building. |
c20c7506 | 248 | STAGESTUFF = *.o as.new gasp.new |
fecd2382 | 249 | |
b11fb939 | 250 | $(OBJS): @ALL_OBJ_DEPS@ |
c92d9ee9 | 251 | |
7f2cb270 | 252 | as.new: $(OBJS) $(LIBS) |
da0b2bff | 253 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES) |
fecd2382 | 254 | |
84951544 KR |
255 | $(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \ |
256 | struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \ | |
257 | listing.h bignum.h | |
b11fb939 | 258 | |
a5a4b5ac SC |
259 | gasp.new: gasp.o |
260 | $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new gasp.o $(LIBS) $(LOADLIBES) | |
261 | ||
c97b9003 DZ |
262 | installcheck: |
263 | @echo No installcheck target is available yet for the GNU assembler. | |
264 | ||
0b3d0999 | 265 | check: |
c97b9003 DZ |
266 | @(here=`pwd` ; export here ; \ |
267 | cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $(CHECKFLAGS) check) | |
787c6bfe | 268 | |
b11fb939 KR |
269 | config.status: configure |
270 | if [ -r config.status ]; then \ | |
1be01033 | 271 | sh ./config.status --recheck ; \ |
b11fb939 KR |
272 | else \ |
273 | echo You must configure gas. Look at the INSTALL file for details. ; \ | |
274 | exit 1 ; \ | |
275 | fi | |
276 | ||
fc00f451 | 277 | config.h: config-stamp ; @true |
b11fb939 | 278 | config-stamp: Makefile conf |
fc00f451 | 279 | -rm -f config.new config-stamp |
1e84ff7e KR |
280 | echo '/* config.h. Generated automatically by make. */' > config.new |
281 | echo '#ifndef GAS_VERSION' >> config.new | |
b11fb939 KR |
282 | echo '#define GAS_VERSION "$(VERSION)"' >> config.new |
283 | echo '' >> config.new | |
284 | cat conf >> config.new | |
285 | echo '#endif /* GAS_VERSION */' >> config.new | |
fc00f451 KR |
286 | $(srcdir)/../move-if-change config.new config.h |
287 | touch config-stamp | |
288 | ||
fecd2382 RP |
289 | # Compiling object files from source files. |
290 | ||
620a590e | 291 | gasp.o : gasp.c config.h |
84951544 KR |
292 | app.o : app.c write.h |
293 | as.o : as.c output-file.h write.h subsegs.h | |
294 | atof-generic.o : atof-generic.c | |
295 | bignum-copy.o : bignum-copy.c | |
296 | cond.o : cond.c | |
297 | debug.o : debug.c subsegs.h | |
298 | expr.o : expr.c | |
299 | flonum-konst.o : flonum-konst.c | |
300 | flonum-copy.o : flonum-copy.c | |
301 | flonum-mult.o : flonum-mult.c | |
302 | frags.o : frags.c subsegs.h | |
303 | hash.o : hash.c | |
304 | hex-value.o : hex-value.c | |
305 | input-file.o : input-file.c input-file.h | |
306 | input-scrub.o : input-scrub.c input-file.h | |
307 | listing.o : listing.c input-file.h subsegs.h | |
308 | literal.o : literal.c subsegs.h | |
309 | messages.o : messages.c | |
310 | output-file.o : output-file.c output-file.h | |
311 | read.o : read.c | |
312 | subsegs.o : subsegs.c subsegs.h | |
313 | symbols.o : symbols.c subsegs.h | |
314 | write.o : write.c subsegs.h output-file.h | |
315 | ecoff.o : ecoff.c ecoff.h \ | |
316 | $(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \ | |
317 | $(srcdir)/../include/coff/ecoff.h \ | |
318 | $(srcdir)/../include/coff/symconst.h \ | |
319 | $(srcdir)/../include/aout/stab_gnu.h | |
320 | stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h | |
321 | atof-targ.o : atof-targ.c | |
322 | obj-format.o : obj-format.c | |
323 | targ-cpu.o : targ-cpu.c $(TARG_CPU_DEPENDENTS) | |
d1a9e594 | 324 | |
fecd2382 RP |
325 | # Remake the info files. |
326 | ||
921faa52 | 327 | doc: $(srcdir)/as.info |
fecd2382 | 328 | |
921faa52 | 329 | $(srcdir)/as.info: $(srcdir)/doc/as.texinfo |
c97b9003 | 330 | @(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir) |
fecd2382 | 331 | |
6d60424f | 332 | diststuff: $(DISTSTUFF) |
367d6244 | 333 | |
7420b02b | 334 | clean-here: |
f2889110 | 335 | -rm -f $(STAGESTUFF) core stamp-mk.com |
fecd2382 | 336 | |
daa7e184 ILT |
337 | clean mostlyclean: clean-here |
338 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ | |
7420b02b | 339 | @if [ -d testsuite ] ; then \ |
daa7e184 | 340 | cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $@ ; \ |
7420b02b JL |
341 | else true; fi |
342 | ||
fecd2382 | 343 | # Like clean but also delete the links made to configure gas. |
367d6244 | 344 | distclean: clean-here |
daa7e184 | 345 | @cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@ |
7420b02b | 346 | @if [ -d testsuite ] ; then \ |
daa7e184 | 347 | cd testsuite ; $(MAKE) $(FLAGS_TO_PASS) $@ ; \ |
7420b02b | 348 | else true; fi |
b11fb939 | 349 | -rm -f config.status Makefile targ-env.h targ-cpu.h \ |
7420b02b | 350 | targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \ |
f2889110 | 351 | config-stamp config.h conf config.log config.cache .gdbinit |
367d6244 | 352 | realclean: clean distclean |
6d60424f | 353 | -rm -rf $(DISTSTUFF) |
542e1629 | 354 | |
fecd2382 RP |
355 | # Entry points `install', `includes' and `uninstall'. |
356 | ||
357 | # Copy the files into directories where they will be run. | |
542e1629 | 358 | install: |
7420b02b | 359 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
c97b9003 | 360 | $(INSTALL_XFORM) as.new $(bindir)/as; \ |
7420b02b | 361 | $(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \ |
28d3e4a3 | 362 | n=`echo as | sed '$(program_transform_name)'`; \ |
efbfb612 ILT |
363 | if [ -d $(tooldir) ]; then \ |
364 | if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \ | |
365 | rm -f $(tooldir)/bin/as; \ | |
ac7f7dfe | 366 | ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \ |
efbfb612 ILT |
367 | || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \ |
368 | else true; fi | |
a5a4b5ac SC |
369 | srcroot=`cd $(srcroot); pwd`; export srcroot; \ |
370 | $(INSTALL_XFORM) gasp.new $(bindir)/gasp; \ | |
28d3e4a3 | 371 | n=`echo gasp | sed '$(program_transform_name)' `; \ |
a5a4b5ac SC |
372 | if [ -d $(tooldir) ]; then \ |
373 | if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \ | |
374 | rm -f $(tooldir)/bin/gasp; \ | |
ac7f7dfe ILT |
375 | ln $(bindir)/$$n $(tooldir)/bin/gasp >/dev/null 2>/dev/null \ |
376 | || $(INSTALL_PROGRAM) gasp.new $(tooldir)/bin/gasp; \ | |
a5a4b5ac | 377 | else true; fi |
fecd2382 | 378 | |
fecd2382 RP |
379 | # Cancel installation by deleting the installed files. |
380 | uninstall: | |
fa156ffe | 381 | -n=`t='$(program_transform_name)'; echo as | sed $$t`; \ |
7e10f53c ILT |
382 | rm -f $(bindir)/$$n; \ |
383 | rm -f $(mandir)/$$n.1 | |
fa156ffe | 384 | -n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \ |
a5a4b5ac | 385 | rm -f $(bindir)/$$n; \ |
542e1629 | 386 | |
fecd2382 RP |
387 | # These exist for maintenance purposes. |
388 | ||
389 | tags TAGS: force | |
787c6bfe | 390 | etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in |
ac7f7dfe | 391 | |
542e1629 | 392 | bootstrap: as.new force |
fecd2382 | 393 | $(MAKE) stage1 |
3256c4b5 KR |
394 | rm -f stage && ln -s stage1 stage |
395 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
fecd2382 | 396 | $(MAKE) stage2 |
3256c4b5 KR |
397 | rm -f stage && ln -s stage2 stage |
398 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
a01bf1fb | 399 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
400 | |
401 | bootstrap2: force | |
3256c4b5 KR |
402 | rm -f stage && ln -s stage1 stage |
403 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
fecd2382 | 404 | $(MAKE) stage2 |
3256c4b5 KR |
405 | rm -f stage && ln -s stage2 stage |
406 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
da0b2bff | 407 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
408 | |
409 | bootstrap3: force | |
3256c4b5 KR |
410 | rm -f stage && ln -s stage2 stage |
411 | $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new | |
a01bf1fb | 412 | $(MAKE) comparison against=stage2 |
fecd2382 RP |
413 | |
414 | # Copy the object files from a particular stage into a subdirectory. | |
415 | stage1: force | |
416 | -mkdir stage1 | |
417 | -mv $(STAGESTUFF) stage1 | |
81f73963 | 418 | if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi |
fecd2382 RP |
419 | |
420 | stage2: force | |
421 | -mkdir stage2 | |
422 | -mv $(STAGESTUFF) stage2 | |
81f73963 | 423 | if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi |
fecd2382 RP |
424 | |
425 | stage3: force | |
426 | -mkdir stage3 | |
6a3958b2 | 427 | -mv $(STAGESTUFF) stage3 |
81f73963 | 428 | if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi |
fecd2382 | 429 | |
a01bf1fb RP |
430 | against=stage2 |
431 | ||
f2889110 KR |
432 | # This rule is derived from corresponding code in the Makefile.in for gcc. |
433 | # The "tail +16c" is to bypass headers which may include timestamps or | |
434 | # temporary assembly file names. | |
a01bf1fb | 435 | comparison: force |
f2889110 KR |
436 | x=0 ; \ |
437 | for file in $(STAGESTUFF) ; do \ | |
438 | tail +16c ./$$file > tmp-foo1; \ | |
439 | if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \ | |
440 | if cmp tmp-foo1 tmp-foo2 ; then \ | |
441 | true ; \ | |
442 | else \ | |
443 | echo $$file differs ; \ | |
444 | x=1 ; \ | |
445 | fi ; \ | |
446 | else true; fi ; \ | |
447 | done ; \ | |
448 | exit $$x | |
449 | -rm -f tmp-foo* | |
a01bf1fb | 450 | |
6a3958b2 | 451 | de-stage1: force |
b3cd8555 | 452 | - (cd stage1 ; rm -f as ; mv -f * ..) |
6a3958b2 RP |
453 | - rmdir stage1 |
454 | ||
455 | de-stage2: force | |
b3cd8555 | 456 | - (cd stage2 ; rm -f as ; mv -f * ..) |
6a3958b2 RP |
457 | - rmdir stage2 |
458 | ||
459 | de-stage3: force | |
b3cd8555 | 460 | - (cd stage3 ; rm -f as ; mv -f * ..) |
6a3958b2 | 461 | - rmdir stage3 |
fecd2382 | 462 | |
fecd2382 | 463 | #In GNU Make, ignore whether `stage*' exists. |
daa7e184 ILT |
464 | .PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean |
465 | .PHONY: TAGS bootstrap | |
fecd2382 RP |
466 | |
467 | force: | |
468 | ||
fc00f451 | 469 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \ |
1be01033 | 470 | $(srcdir)/configure.in config.status |
a26878d1 | 471 | $(SHELL) ./config.status |
1df6e266 KR |
472 | .gdbinit: $(srcdir)/gdbinit.in config.status |
473 | $(SHELL) ./config.status |