aboutsummaryrefslogtreecommitdiff
path: root/gas/Makefile.in
blob: e2815de974749c11f8d498f9e09453db38a14011 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
# Makefile for GNU Assembler
#   Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95, 1996
#   Free Software Foundation, Inc.

# This file is part of GNU GAS.

# GNU GAS is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# GNU GAS is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with GNU GAS; see the file COPYING.  If not, write to
# the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

# The targets for external use include:
# all, doc, proto, install, uninstall, includes, TAGS,
# clean, mostlyclean, distclean, realclean, stage1, stage2, stage3, stage4.

# Variables that exist for you to override.
# See below for how to change them for certain systems.

VPATH = @srcdir@
srcdir = @srcdir@
srcroot = $(srcdir)/..

target_alias = @target_alias@
prefix = @prefix@

program_transform_name = @program_transform_name@
exec_prefix = @exec_prefix@
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
tooldir = $(exec_prefix)/$(target_alias)

datadir = $(prefix)/lib
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
docdir = $(datadir)/doc

VERSION=cygnus-2.6

SHELL = /bin/sh

INSTALL = $${srcroot}/install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)'
INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1

DISTSTUFF= make-gas.com m68k-parse.c

AR = ar
AR_FLAGS = qv
BISON = `if [ -f ../bison/bison ] ; then echo ../bison/bison -y -L../bison/bison ; else echo bison -y ; fi`
BISONFLAGS =
MAKEINFO = makeinfo
TEXI2DVI = texi2dvi
RANLIB = ranlib
CC = @CC@
CFLAGS = -g
LDFLAGS =
HLDFLAGS = @HLDFLAGS@

MAKEOVERRIDES=

EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
          echo $${rootme}/../expect/expect ; \
          else echo expect ; fi`

FLAGS_TO_PASS = \
	"prefix=$(prefix)" \
	"exec_prefix=$(exec_prefix)" \
	"tooldir=$(tooldir)" \
	"AR=$(AR)" \
	"AR_FLAGS=$(AR_FLAGS)" \
	"CC=$(CC)" \
	"CFLAGS=$(CFLAGS)" \
	"RANLIB=$(RANLIB)" \
	"LOADLIBES=$(LOADLIBES)" \
	"LDFLAGS=$(LDFLAGS)" \
	"BISON=$(BISON)" \
	"LEX=$(LEX)" \
	"MAKEINFO=$(MAKEINFO)" \
	"INSTALL=$(INSTALL)" \
	"INSTALL_DATA=$(INSTALL_DATA)" \
	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)"

RUNTEST = `if [ -f $${srcdir}/../dejagnu/runtest ] ; then \
		echo $${srcdir}/../dejagnu/runtest ; else echo runtest; \
	   fi`
RUNTESTFLAGS=

# Lists of files for various purposes.

REAL_SOURCES = \
	$(srcdir)/app.c \
	$(srcdir)/as.c \
	$(srcdir)/atof-generic.c \
	$(srcdir)/bignum-copy.c \
	$(srcdir)/cond.c \
	$(srcdir)/expr.c \
	$(srcdir)/flonum-konst.c \
	$(srcdir)/flonum-copy.c \
	$(srcdir)/flonum-mult.c \
	$(srcdir)/frags.c \
	$(srcdir)/hash.c \
	$(srcdir)/input-file.c \
	$(srcdir)/input-scrub.c \
	$(srcdir)/literal.c \
	$(srcdir)/messages.c \
	$(srcdir)/output-file.c \
	$(srcdir)/read.c \
	$(srcdir)/subsegs.c \
	$(srcdir)/symbols.c \
	$(srcdir)/write.c \
	$(srcdir)/listing.c \
	$(srcdir)/ecoff.c \
	$(srcdir)/stabs.c

# in an expedient order
LINKED_SOURCES = \
	targ-cpu.c \
	obj-format.c \
	atof-targ.c

SOURCES = $(LINKED_SOURCES) $(REAL_SOURCES)

REAL_HEADERS = \
	$(srcdir)/as.h \
	$(srcdir)/bignum.h \
	$(srcdir)/expr.h \
	$(srcdir)/flonum.h \
	$(srcdir)/frags.h \
	$(srcdir)/hash.h \
	$(srcdir)/input-file.h \
	$(srcdir)/listing.h \
	$(srcdir)/tc.h \
	$(srcdir)/obj.h \
	$(srcdir)/read.h \
	$(srcdir)/struc-symbol.h \
	$(srcdir)/subsegs.h \
	$(srcdir)/symbols.h \
	$(srcdir)/write.h \
	$(srcdir)/ecoff.h

LINKED_HEADERS = \
	targ-env.h \
	targ-cpu.h \
	obj-format.h \
	atof-targ.h

HEADERS = $(LINKED_HEADERS) $(REAL_HEADERS)

TE_OBJS=

# @target_frag@

OBJS = \
	targ-cpu.o \
	obj-format.o \
	atof-targ.o \
	app.o \
	as.o \
	atof-generic.o \
	bignum-copy.o \
	cond.o \
	expr.o \
	flonum-konst.o \
	flonum-copy.o \
	flonum-mult.o \
	frags.o \
	hash.o \
	input-file.o \
	input-scrub.o \
	literal.o \
	messages.o \
	output-file.o \
	read.o \
	subsegs.o \
	symbols.o \
	write.o \
	listing.o \
	ecoff.o \
	stabs.o \
	sb.o \
	macro.o \
	@extra_objects@ \
	$(TE_OBJS)

GASPOBJS = \
	gasp.o \
	macro.o \
	sb.o \
	hash.o

all: .gdbinit as.new gasp.new
	@srcroot=`cd $(srcroot); pwd`; export srcroot; \
	(cd doc ; $(MAKE) $(FLAGS_TO_PASS) all)

dvi info install-info clean-info:
	@srcroot=`cd $(srcroot); pwd`; export srcroot; \
	(cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@)

make-gas.com: stamp-mk.com
stamp-mk.com: vmsconf.sh Makefile
	sh $(srcdir)/vmsconf.sh $(OBJS) > new-make.com
	$(srcdir)/../move-if-change new-make.com $(srcdir)/make-gas.com
	touch stamp-mk.com

# Now figure out from those variables how to compile and link.

# This is the variable actually used when we compile.
ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CROSS) $(CFLAGS) $(HDEFINES) $(TDEFINES)

# How to link with both our special library facilities
# and the system's installed libraries.

LIBDEPS = @OPCODES_DEP@ @BFDDEP@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a
LIBS = @OPCODES_LIB@ @BFDLIB@ $(LOCAL_LOADLIBES) ../libiberty/libiberty.a

# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
# so that tm.h and config.h will be found in the compilation
# subdirectory rather than in the source directory.
INCLUDES = -I. -I$(srcdir) -I../bfd -I$(srcdir)/config -I$(srcdir)/../include -I$(srcdir)/.. -I$(srcdir)/../bfd

# Always use -I$(srcdir)/config when compiling.
.c.o:
	$(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $<

# This tells GNU make version 3 not to export all the variables
# defined in this file into the environment.
.NOEXPORT:

# Files to be copied away after each stage in building.
STAGESTUFF = *.o as.new gasp.new

$(OBJS): @ALL_OBJ_DEPS@

as.new: $(OBJS) $(LIBDEPS)
	$(CC) $(HLDFLAGS) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)

$(OBJS): config.h as.h targ-env.h obj-format.h targ-cpu.h flonum.h expr.h \
	struc-symbol.h write.h frags.h hash.h read.h symbols.h tc.h obj.h \
	listing.h bignum.h

gasp.new: $(GASPOBJS) ../libiberty/libiberty.a
	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gasp.new $(GASPOBJS) ../libiberty/libiberty.a $(LOADLIBES)

installcheck:
	@echo No installcheck target is available yet for the GNU assembler.

site.exp: ./Makefile
	@echo "Making a new config file..."
	-@rm -f ./tmp?
	@touch site.exp
	-@mv site.exp site.bak
	@echo "## these variables are automatically generated by make ##" > ./tmp0
	@echo "# Do not edit here. If you wish to override these values," >> ./tmp0
	@echo "# do so in the last section."			>> ./tmp0
	@echo set host_os @host_os@				>> ./tmp0
	@echo set host_alias @host_alias@			>> ./tmp0
	@echo set host_cpu @host_cpu@				>> ./tmp0
	@echo set host_vendor @host_vendor@			>> ./tmp0
	@echo set target_os @target_os@				>> ./tmp0
	@echo set target_alias @target_alias@			>> ./tmp0
	@echo set target_cpu @target_cpu@			>> ./tmp0
	@echo set target_vendor @target_vendor@			>> ./tmp0
	@echo set host_triplet @host@				>> ./tmp0
	@echo set target_triplet @target@			>> ./tmp0
	@echo set target_canonical @target@			>> ./tmp0
	@echo set srcdir ${srcdir}/testsuite			>> ./tmp0
	@echo set exec_prefix ${exec_prefix}			>> ./tmp0
	@echo set objdir `pwd`					>> ./tmp0
	@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
	@sed -e '1,/^## All variables above are.*##/ d' < site.bak >> ./tmp0
	@mv -f ./tmp0 site.exp

check:  site.exp
	if [ -d testsuite ]; then \
	  true; \
	else \
	  mkdir testsuite; \
	fi
	rm -f testsuite/site.exp
	cp site.exp testsuite/site.exp
	rootme=`pwd`; export rootme; \
	srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
	LD_LIBRARY_PATH=$$rootme/../bfd:$$rootme/../opcodes:$$LD_LIBRARY_PATH; \
	export LD_LIBRARY_PATH; \
	cd testsuite; \
	EXPECT=${EXPECT} ; export EXPECT ; \
	if [ -f $${rootme}/../expect/expect ] ; then  \
	   TCL_LIBRARY=$${srcdir}/../tcl/library ; \
	   export TCL_LIBRARY ; fi ; \
	$(RUNTEST) --tool gas --srcdir $${srcdir}/testsuite $(RUNTESTFLAGS)

config.status: configure
	if [ -r config.status ]; then \
	  sh ./config.status --recheck ; \
	else \
	  echo You must configure gas.  Look at the INSTALL file for details. ; \
	  exit 1 ; \
	fi

config.h: config-stamp ; @true
config-stamp: Makefile conf
	-rm -f config.new config-stamp
	echo '/* config.h.  Generated automatically by make.  */' > config.new
	echo '#ifndef GAS_VERSION'			>> config.new
	echo '#define GAS_VERSION "$(VERSION)"'		>> config.new
	echo ''						>> config.new
	cat conf					>> config.new
	echo '#endif /* GAS_VERSION */'			>> config.new
	$(srcdir)/../move-if-change config.new config.h
	touch config-stamp

# Compiling object files from source files.

TARG_CPU_DEP_a29k    =
TARG_CPU_DEP_alpha   = $(srcdir)/config/alpha-opcode.h
# start-sanitize-arc
TARG_CPU_DEP_arc     = $(srcdir)/../include/opcode/arc.h
# end-sanitize-arc
TARG_CPU_DEP_arm     =
TARG_CPU_DEP_generic =
TARG_CPU_DEP_h8300   = $(srcdir)/../include/opcode/h8300.h
TARG_CPU_DEP_h8500   = $(srcdir)/../opcodes/h8500-opc.h
TARG_CPU_DEP_hppa    =
TARG_CPU_DEP_i386    = $(srcdir)/../include/opcode/i386.h
TARG_CPU_DEP_i860    =
TARG_CPU_DEP_i960    =
TARG_CPU_DEP_m68k    = $(srcdir)/../include/opcode/m68k.h \
			$(srcdir)/config/m68k-parse.h subsegs.h
TARG_CPU_DEP_m88k    = $(srcdir)/config/m88k-opcode.h
TARG_CPU_DEP_mips    = $(srcdir)/../include/opcode/mips.h
TARG_CPU_DEP_ns32k   =
TARG_CPU_DEP_ppc     =
# start-sanitize-rce
TARG_CPU_DEP_rce     = $(srcdir)/../opcodes/rce-opc.h
# end-sanitize-rce
TARG_CPU_DEP_sh      = $(srcdir)/../opcodes/sh-opc.h
TARG_CPU_DEP_sparc   =
TARG_CPU_DEP_tahoe   =
TARG_CPU_DEP_vax     =
TARG_CPU_DEP_w65     = $(srcdir)/../opcodes/w65-opc.h
TARG_CPU_DEP_z8k     = $(srcdir)/../opcodes/z8k-opc.h

gasp.o : gasp.c sb.h macro.h config.h
sb.o : sb.c sb.h config.h
macro.o : macro.c macro.h sb.h hash.h config.h
app.o : app.c write.h
as.o : as.c output-file.h write.h subsegs.h sb.h macro.h
atof-generic.o : atof-generic.c
bignum-copy.o : bignum-copy.c
cond.o : cond.c
debug.o : debug.c subsegs.h
expr.o : expr.c
flonum-konst.o : flonum-konst.c
flonum-copy.o : flonum-copy.c
flonum-mult.o : flonum-mult.c
frags.o : frags.c subsegs.h
hash.o : hash.c
input-file.o : input-file.c input-file.h
input-scrub.o : input-scrub.c input-file.h sb.h
listing.o : listing.c input-file.h subsegs.h
literal.o : literal.c subsegs.h
messages.o : messages.c
output-file.o : output-file.c output-file.h
read.o : read.c sb.h macro.h
subsegs.o : subsegs.c subsegs.h
symbols.o : symbols.c subsegs.h
write.o : write.c subsegs.h output-file.h
ecoff.o : ecoff.c ecoff.h \
	$(srcdir)/../include/coff/internal.h $(srcdir)/../include/coff/sym.h \
	$(srcdir)/../include/coff/ecoff.h \
	$(srcdir)/../include/coff/symconst.h \
	$(srcdir)/../include/aout/stab_gnu.h
stabs.o : stabs.c subsegs.h $(srcdir)/../include/aout/stab_gnu.h
atof-targ.o : atof-targ.c
obj-format.o : obj-format.c
targ-cpu.o : targ-cpu.c $(TARG_CPU_DEP_@target_cpu_type@)

obj-elf.o : $(srcdir)/config/obj-elf.c
	$(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-elf.c
obj-ecoff.o : $(srcdir)/config/obj-ecoff.c
	$(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/obj-ecoff.c

e-mipself.o : $(srcdir)/config/e-mipself.c
	$(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipself.c
e-mipsecoff.o : $(srcdir)/config/e-mipsecoff.c
	$(CC) -c $(ALL_CFLAGS) $(CPPFLAGS) $(INCLUDES) $(srcdir)/config/e-mipsecoff.c

# The m68k operand parser.

m68k-parse.c: $(srcdir)/config/m68k-parse.y
	$(BISON) $(BISONFLAGS) $(srcdir)/config/m68k-parse.y
	mv -f y.tab.c m68k-parse.c
m68k-parse.o: m68k-parse.c $(srcdir)/config/m68k-parse.h

# Remake the info files.

doc: $(srcdir)/as.info

$(srcdir)/as.info: $(srcdir)/doc/as.texinfo
	@(cd doc; $(MAKE) $(FLAGS_TO_PASS) as.info; mv as.info $srcdir)	

diststuff: $(DISTSTUFF) info

clean-here:
	-rm -f $(STAGESTUFF) core stamp-mk.com
	-rm -f testsuite/*.o testsuite/*.out \
		testsuite/gas.log testsuite/gas.sum testsuite/site.exp

clean mostlyclean: clean-here
	@cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@

# Like clean but also delete the links made to configure gas.

DISTCLEAN_HERE = config.status Makefile targ-env.h targ-cpu.h \
	targ-cpu.c obj-format.h obj-format.c atof-targ.c TAGS \
	config-stamp config.h conf config.log config.cache .gdbinit \
	testsuite/Makefile testsuite/config.status

distclean: clean-here
	@cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
	-rm -f $(DISTCLEAN_HERE)

maintainer-clean realclean: clean-here
	@echo "This command is intended for maintainers to use;"
	@echo "it deletes files that may require special tools to rebuild."
	@cd doc ; $(MAKE) $(FLAGS_TO_PASS) $@
	-rm -rf $(DISTCLEAN_HERE) $(DISTSTUFF)

# Entry points `install', `includes' and `uninstall'.

# Copy the files into directories where they will be run.
install:
	srcroot=`cd $(srcroot); pwd`; export srcroot; \
	$(INSTALL_XFORM) as.new $(bindir)/as; \
	$(INSTALL_XFORM1) $(srcdir)/doc/as.1 $(man1dir)/as.1; \
	n=`echo as | sed '$(program_transform_name)'`; \
	if [ -d $(tooldir) ]; then \
	  if [ -d $(tooldir)/bin ] ; then true ; else mkdir $(tooldir)/bin ; fi; \
	  rm -f $(tooldir)/bin/as; \
	  ln $(bindir)/$$n $(tooldir)/bin/as >/dev/null 2>/dev/null \
	   || $(INSTALL_PROGRAM) as.new $(tooldir)/bin/as; \
	else true; fi
	srcroot=`cd $(srcroot); pwd`; export srcroot; \
	$(INSTALL_XFORM) gasp.new $(bindir)/gasp

# Cancel installation by deleting the installed files.
uninstall:
	-n=`t='$(program_transform_name)'; echo as | sed $$t`; \
	rm -f $(bindir)/$$n; \
	rm -f $(mandir)/$$n.1
	-n=`t='$(program_transform_name)'; echo gasp | sed $$t`; \
	rm -f $(bindir)/$$n; \

# These exist for maintenance purposes.

tags TAGS: force
	etags $(REAL_HEADERS) $(REAL_SOURCES) $(srcdir)/config/*.[hc] $(srcdir)/README $(srcdir)/Makefile.in

bootstrap: as.new force
	$(MAKE) stage1
	rm -f stage && ln -s stage1 stage
	$(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
	$(MAKE) stage2
	rm -f stage && ln -s stage2 stage
	$(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
	$(MAKE) comparison against=stage2

bootstrap2: force
	rm -f stage && ln -s stage1 stage
	$(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
	$(MAKE) stage2
	rm -f stage && ln -s stage2 stage
	$(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
	$(MAKE) comparison against=stage2

bootstrap3: force
	rm -f stage && ln -s stage2 stage
	$(MAKE) CC="$(CC)" CFLAGS="-O -Bstage/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as.new gasp.new
	$(MAKE) comparison against=stage2

# Copy the object files from a particular stage into a subdirectory.
stage1: force
	-mkdir stage1
	-mv $(STAGESTUFF) stage1
	if [ -f stage1/as.new -a ! -f stage1/as ] ; then (cd stage1 ; ln -s as.new as) ; fi

stage2: force
	-mkdir stage2
	-mv $(STAGESTUFF) stage2
	if [ -f stage2/as.new -a ! -f stage2/as ] ; then (cd stage2 ; ln -s as.new as) ; fi

stage3: force
	-mkdir stage3
	-mv $(STAGESTUFF) stage3
	if [ -f stage3/as.new -a ! -f stage3/as ] ; then (cd stage3 ; ln -s as.new as) ; fi

against=stage2

# This rule is derived from corresponding code in the Makefile.in for gcc.
# The "tail +16c" is to bypass headers which may include timestamps or
# temporary assembly file names.
comparison: force
	x=0 ; \
	for file in *.o ; do \
	  tail +16c ./$$file > tmp-foo1; \
	  if tail +16c ${against}/$$file > tmp-foo2 2>/dev/null ; then \
	    if cmp tmp-foo1 tmp-foo2 ; then \
	      true ; \
	    else \
	      echo $$file differs ; \
	      x=1 ; \
	    fi ; \
	  else true; fi ; \
	done ; \
	exit $$x
	-rm -f tmp-foo*

de-stage1: force
	- (cd stage1 ; rm -f as ; mv -f * ..)
	- rmdir stage1

de-stage2: force
	- (cd stage2 ; rm -f as ; mv -f * ..)
	- rmdir stage2

de-stage3: force
	- (cd stage3 ; rm -f as ; mv -f * ..)
	- rmdir stage3

#In GNU Make, ignore whether `stage*' exists.
.PHONY: stage1 stage2 stage3 stage4 clean mostlyclean realclean distclean
.PHONY: TAGS bootstrap

force:

Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) \
		$(srcdir)/configure.in config.status conf.in
	$(SHELL) ./config.status
.gdbinit: $(srcdir)/gdbinit.in config.status
	$(SHELL) ./config.status