#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 1, or (at your option)
+#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,
# Variables that exist for you to override.
# See below for how to change them for certain systems.
-ALLOCA =
-CFLAGS = -g $(XCFLAGS) -I$(srcdir)/../include
-INTERNAL_CFLAGS = $(CROSS)
-OLDCC = cc
-BISON = bison
-BISONFLAGS = -v
-AR = ar
-OLDAR_FLAGS = qc
-AR_FLAGS = rc
+srcdir = .
+
+prefix = /usr/local
+
+bindir = $(prefix)/bin
+datadir = $(prefix)/lib
+libdir = $(prefix)/lib
+mandir = $(datadir)/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
+
SHELL = /bin/sh
-# on sysV, define this as cp.
+
INSTALL = install -c
-# These permit overriding just for certain files.
INSTALL_PROGRAM = $(INSTALL)
-INSTALL_FILE = $(INSTALL)
+INSTALL_DATA = $(INSTALL)
-# Define this as & to perform parallel make on a Sequent.
-# Note that this has some bugs, and it seems currently necessary
-# to compile all the gen* files first by hand to avoid erroneous results.
-P =
-
-# How to invoke ranlib.
+AR = ar
+AR_FLAGS = qv
+BISON = bison
+MAKEINFO = makeinfo
RANLIB = ranlib
-# Test to use to see whether ranlib exists on the system.
-RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
-
-# CFLAGS for use with OLDCC, for compiling gnulib.
-# NOTE: -O does not work on some Unix systems!
-CCLIBFLAGS = -O
# Version of ar to use when compiling gnulib.
OLDAR = ar
-version=`awk '{print substr ($$4, 2, length ($$4) - 3); }' $(srcdir)/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.
-destdir = /usr/local
-prefix = $(destdir)
-# Directory in which to put the executable for the command `gcc'
-bindir = $(prefix)/bin
-# Directory in which to put the directories used by the compiler.
-libdir = $(prefix)/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)
-
# Additional system libraries to link with.
CLIB=
HOST_CPPFLAGS=$(CPPFLAGS)
# Choose the real default target.
-ALL=as
+ALL=as.new
# End of variables for you to override.
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)
+info:
+install-info:
+
+fake-as: force
+ - rm -f ./as.new
+ cp /bin/as ./fake-as
-# sed inserts variable overrides after the following line.
-####
-\f
# Now figure out from those variables how to compile and link.
# This is the variable actually used when we compile.
# How to link with both our special library facilities
# and the system's installed libraries.
-LIBS = $(CLIB) $(srcdir)/../libiberty`if [ -d $(srcdir)/libiberty.$(target) ] ; then echo .$(target) ; fi`$(subdir)/libiberty.a
+
+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,
# 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$(srcdir)/config
-SUBDIR_INCLUDES = -I.. -I../$(srcdir) -I../$(srcdir)/config
+INCLUDES = -I. -I$(srcdir) -I$(srcdir)/config -I$(srcdir)/../include
+SUBDIR_INCLUDES = -I.. -I$(srcdir) -I$(srcdir)/config
# Always use -I$(srcdir)/config when compiling.
.c.o:
\f
# Files to be copied away after each stage in building.
STAGE_GCC=gcc
-STAGESTUFF = *.o as
+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
-as: $(OBJS) $(LIBDEPS)
- $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as $(OBJS) $(LIBS) $(LOADLIBES)
+as.new: $(OBJS) $(LIBDEPS)
+ -mv -f as.new as.old
+ $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o as.new $(OBJS) $(LIBS) $(LOADLIBES)
objdump:
targ-cpu.o : targ-cpu.c targ-env.h obj-format.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
+ symbols.h tc.h obj.h $(TARG_CPU_DEPENDENTS)
\f
# Compile the libraries to be used by gen*.
\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: as
- $(INSTALL_PROGRAM) as $(libsubdir)/as
+install: $(ALL)
+ $(INSTALL_PROGRAM) $(ALL) $(bindir)/as
# Create the installation directory.
install-dir:
# 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: as force
+bootstrap: $(ALL) force
$(MAKE) stage1
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
$(MAKE) stage2
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as
+ $(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= as
+ $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage1/ $(CFLAGS)" libdir=$(libdir) ALLOCA= $(ALL)
$(MAKE) stage2
- $(MAKE) CC="$(CC)" CFLAGS="-O -Bstage2/ $(CFLAGS)" libdir=$(libdir) ALLOCA= as
- $(MAKE) comparison against-stage2
+ $(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= as
+ $(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
+ 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
for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
de-stage1: force
- - (cd stage1 ; mv -f * ..)
+ - (cd stage1 ; rm as ; mv -f * ..)
- rmdir stage1
de-stage2: force
- - (cd stage2 ; mv -f * ..)
+ - (cd stage2 ; rm as ; mv -f * ..)
- rmdir stage2
de-stage3: force
- - (cd stage3 ; mv -f * ..)
+ - (cd stage3 ; rm as ; mv -f * ..)
- rmdir stage3
# Copy just the executable files from a particular stage into a subdirectory,
force:
-Makefile: $(srcdir)/Makefile.in $(srcdir)/configure
- (cd $(srcdir) ; \
- ./configure +destdir=$(destdir) \
- +norecurse \
- `if [ "$(srcdir)" != "." ] ; then echo +f; fi` \
- $(host) +target=$(target))
+Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
+ $(SHELL) ./config.status