# See below for how to change them for certain systems.
ALLOCA =
-CFLAGS = -g $(XCFLAGS) # -I$(srcdir)/../include
+CFLAGS = -g $(XCFLAGS) -I$(srcdir)/../include
INTERNAL_CFLAGS = $(CROSS)
OLDCC = cc
BISON = bison
# Version of ar to use when compiling gnulib.
OLDAR = ar
-version=`./gcc -dumpversion`
+version=`awk '{print substr ($$4, 2, length ($$4) - 3); }' $(unsubdir)/../gcc/version.c`
# Directory where sources are, from where we are.
srcdir = .
# Common prefix for installation directories.
# NOTE: This directory must exist when you start installation.
-prefix = /usr/local
+ddestdir = /usr/local
# Directory in which to put the executable for the command `gcc'
-bindir = $(prefix)/bin
+bindir = $(ddestdir)/bin
# Directory in which to put the directories used by the compiler.
-libdir = $(prefix)/lib
+libdir = $(ddestdir)/lib
# Directory in which the compiler finds executables, libraries, etc.
libsubdir = $(libdir)/gcc/$(target)/$(version)
# Number to put in man-page filename.
manext = 1
# Directory in which to put man pages.
-mandir = $(prefix)/man/man$(manext)
+mandir = $(destdir)/H-independent/man/man$(manext)
# Additional system libraries to link with.
CLIB=
-# Change this to a null string if obstacks are installed in the
-# system library.
-OBSTACK=obstack.o
-
# Specify the rule for actually making gnulib.
GNULIB = gnulib.portable
HOST_CPPFLAGS=$(CPPFLAGS)
# Choose the real default target.
-ALL=gas
+ALL=as.new
# End of variables for you to override.
$(srcdir)/tc.h \
$(srcdir)/obj.h \
$(srcdir)/read.h \
- $(srcdir)/reloc.h \
$(srcdir)/struc-symbol.h \
$(srcdir)/subsegs.h \
$(srcdir)/symbols.h \
xmalloc.o \
xrealloc.o
+#### host, target, and site specific Makefile frags come in here.
+
# Definition of `all' is here so that new rules inserted by sed
# do not specify the default target.
# The real definition is under `all.internal'.
all: $(ALL)
-# sed inserts variable overrides after the following line.
-####
-\f
+fake-as: force
+ - rm -f ./as.new
+ cp /bin/as ./fake-as
+
# Now figure out from those variables how to compile and link.
# This is the variable actually used when we compile.
-ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CFLAGS)
+ALL_CFLAGS = $(INTERNAL_CFLAGS) $(CFLAGS) $(HDEFINES) $(TDEFINES)
# Even if ALLOCA is set, don't use it if compiling with GCC.
USE_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${ALLOCA}; else true; fi`
USE_HOST_ALLOCA= `if [ x"${CC}" = x"${OLDCC}" ] ; then echo ${HOST_PREFIX}${ALLOCA}; else true; fi`
-# Dependency on obstack, alloca, malloc or whatever library facilities
-# are not installed in the system libraries.
-# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
-LIBDEPS= $(OBSTACK) $(ALLOCA) $(MALLOC)
-
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
# We don't use USE_ALLOCA because backquote expansion doesn't work in deps.
# How to link with both our special library facilities
# and the system's installed libraries.
-LIBS = $(OBSTACK) $(USE_ALLOCA) $(MALLOC) $(CLIB)
+
+LIBS = $(LOCAL_LOADLIBES) $(CLIB) $(unsubdir)/../libiberty$(subdir)/libiberty.a
# Likewise, for use in the tools that must run on this machine
# even if we are cross-building GCC.
-HOST_LIBS = $(HOST_PREFIX)$(OBSTACK) $(USE_HOST_ALLOCA) $(HOST_PREFIX)$(MALLOC) $(CLIB)
+HOST_LIBS = $(HOST_PREFIX)$(OBSTACK) $(USE_HOST_ALLOCA) $(HOST_PREFIX)$(MALLOC) $(CLIB)
# Specify the directories to be searched for header files.
# Both . and srcdir are used, in that order,
\f
# Files to be copied away after each stage in building.
STAGE_GCC=gcc
-STAGESTUFF = *.o gas
+STAGESTUFF = *.o as.new
# The files that "belong" in CONFIG_H are deliberately omitted
# because having them there would not be useful in actual practice.
# CONFIG_H = config.h tm.h
CONFIG_H =
\f
-gas: $(OBJS) $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gas $(OBJS) $(LIBS)
+as.new: $(OBJS) $(LIBDEPS)
+ -mv -f as.new as.old
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
+
+objdump:
all.internal: native
# This is what is made with the host's compiler if making a cross assembler.
-native: config.status gas
+native: config.status as
config.status:
@echo You must configure gas. Look at the INSTALL file for details.
# Compiling object files from source files.
-# Note that dependencies on obstack.h are not written
-# because that file is not part of GAS.
-
app.o : app.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
as.o : as.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
atof-generic.o : atof-generic.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
bignum-copy.o : bignum-copy.c as.h host.h \
targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
cond.o : cond.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- obstack.h
+
debug.o : debug.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
subsegs.h
expr.o : expr.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- obstack.h
+
flonum-const.o : flonum-const.c flonum.h bignum.h
flonum-copy.o : flonum-copy.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
flonum-mult.o : flonum-mult.c flonum.h bignum.h
frags.o : frags.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- subsegs.h obstack.h
+ subsegs.h
hash.o : hash.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
hex-value.o : hex-value.c
input-file.o : input-file.c as.h host.h \
targ-env.h obj-format.h targ-cpu.h \
- struc-symbol.h reloc.h write.h flonum.h bignum.h expr.h \
+ struc-symbol.h write.h flonum.h bignum.h expr.h \
frags.h hash.h read.h symbols.h tc.h obj.h input-file.h
input-scrub.o : input-scrub.c /usr/include/errno.h /usr/include/sys/errno.h \
as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
input-file.h
messages.o : messages.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h
-obstack.o : obstack.c obstack.h
+obstack.o : obstack.c
output-file.o : output-file.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
output-file.h
read.o : read.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- obstack.h
+
strstr.o : strstr.c
subsegs.o : subsegs.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- subsegs.h obstack.h
+ subsegs.h
symbols.o : symbols.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- obstack.h subsegs.h
+ subsegs.h
version.o : version.c
write.o : write.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h symbols.h tc.h obj.h \
- subsegs.h obstack.h output-file.h
+ subsegs.h output-file.h
xmalloc.o : xmalloc.c
xrealloc.o : xrealloc.c
atof-targ.o : atof-targ.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
symbols.h tc.h obj.h
obj-format.o : obj-format.c as.h host.h targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
- symbols.h tc.h obj.h obstack.h
+ symbols.h tc.h obj.h
targ-cpu.o : targ-cpu.c targ-env.h obj-format.h \
- targ-cpu.h struc-symbol.h reloc.h \
+ targ-cpu.h struc-symbol.h \
write.h flonum.h bignum.h expr.h frags.h hash.h read.h \
- symbols.h tc.h obj.h obstack.h
-
-# Normally this target is not used; but it is used if you
-# define ALLOCA=alloca.o. In that case, you must get a suitable alloca.c
-# from the GNU Emacs distribution.
-# Note some machines won't allow $(CC) without -S on this source file.
-alloca.o: alloca.c
- $(CC) $(ALL_CFLAGS) $(CPPFLAGS) -S `echo $(srcdir)/alloca.c | sed 's,^\./,,'`
- as alloca.s -o alloca.o
+ symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
+
\f
# Compile the libraries to be used by gen*.
# If we are not cross-building, gen* use the same .o's that cc1 will use,
\f
# Remake the info files.
-doc: $(srcdir)/gas.info
+doc: $(srcdir)/as.info
-$(srcdir)/gas.info: $(srcdir)/gas.texinfo
- makeinfo `echo $(srcdir)/gas.texinfo | sed 's,^\./,,'`
+$(srcdir)/as.info: $(srcdir)/doc/as.texinfo
+ (cd doc; make as.info; mv as.info $srcdir)
\f
# Deletion of files made during compilation.
# Entry points `install', `includes' and `uninstall'.
# Copy the files into directories where they will be run.
-install:
- $(INSTALL_PROGRAM) gas $(bindir)/as
+install: $(ALL)
+# $(INSTALL_PROGRAM) $(ALL) $(libsubdir)/as
+ cp $(ALL) $(bindir)/as.new
+ mv -f $(bindir)/as.new $(bindir)/as
# Create the installation directory.
install-dir:
# Cancel installation by deleting the installed files.
uninstall:
-rm -rf $(libsubdir)
- -rm -rf $(bindir)/gas
+ -rm -rf $(bindir)/as
-rm -rf $(mandir)/gas.$(manext)
\f
# These exist for maintenance purposes.
tags TAGS: force
- etags $(REAL_SOURCES) $(REAL_HEADERS) README Makefile config/*.[hc]
+ etags $(REAL_SOURCES) $(REAL_HEADERS) $(srcdir)/README $(srcdir)/Makefile $(srcdir)/config/*.[hc]
-bootstrap: gas force
+bootstrap: $(ALL) force
$(MAKE) stage1
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
$(MAKE) stage2
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas
- for i in *.o; do cmp $$i stage2/$$i; done
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
+ $(MAKE) comparison against=stage2
bootstrap2: force
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
$(MAKE) stage2
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas
- for i in *.o; do cmp $$i stage2/$$i; done
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
+ $(MAKE) comparison against=stage2
bootstrap3: force
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= gas
- for i in *.o; do cmp $$i stage2/$$i; done
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
+ $(MAKE) comparison against=stage2
# Copy the object files from a particular stage into a subdirectory.
stage1: force
-mkdir stage1
-mv $(STAGESTUFF) stage1
- -(cd stage1 ; ln -s gas as)
+ (cd stage1 ; ln as.new as)
stage2: force
-mkdir stage2
-mv $(STAGESTUFF) stage2
- -(cd stage2 ; ln -s gas as)
-
+ (cd stage2 ; ln as.new as)
stage3: force
-mkdir stage3
- -mv $(STAGESTUFF) $(STAGE_GCC) stage3
- -rm -f stage3/gnulib
- -cp gnulib stage3
- -if $(RANLIB_TEST) ; then $(RANLIB) stage3/gnulib; else true; fi
+ -mv $(STAGESTUFF) stage3
+ (cd stage3 ; ln as.new as)
-stage4: force
- -mkdir stage4
- -mv $(STAGESTUFF) $(STAGE_GCC) stage4
- -rm -f stage4/gnulib
- -cp gnulib stage4
- -if $(RANLIB_TEST) ; then $(RANLIB) stage4/gnulib; else true; fi
+against=stage2
+
+comparison: force
+ for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
+
+de-stage1: force
+ - (cd stage1 ; rm as ; mv -f * ..)
+ - rmdir stage1
+
+de-stage2: force
+ - (cd stage2 ; rm as ; mv -f * ..)
+ - rmdir stage2
+
+de-stage3: force
+ - (cd stage3 ; rm as ; mv -f * ..)
+ - rmdir stage3
# Copy just the executable files from a particular stage into a subdirectory,
# and delete the object files. Use this if you're just verifying a version
force:
-Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
- (cd $(srcdir) ; configure -host=$(host) $(target))
+Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
+ $(SHELL) ./config.status
+