Skip to content
Snippets Groups Projects
Makefile.in 1.11 MiB
Newer Older

# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
Jason Merrill's avatar
Jason Merrill committed
#
# Makefile for directory with subdirs to build.
#   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation
Jason Merrill's avatar
Jason Merrill committed
#
# This file 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 of the License, or
# (at your option) any later version.
Jason Merrill's avatar
Jason Merrill committed
# This program 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.
Jason Merrill's avatar
Jason Merrill committed
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Jason Merrill's avatar
Jason Merrill committed
#

# -------------------------------
# Standard Autoconf-set variables
# -------------------------------
VPATH=@srcdir@

build_alias=@build_alias@
host_alias=@host_alias@
target_alias=@target_alias@
program_transform_name = @program_transform_name@

prefix = @prefix@
exec_prefix = @exec_prefix@

srcdir = @srcdir@

bindir = @bindir@
sbindir = @sbindir@
libexecdir = @libexecdir@
datadir = @datadir@
sysconfdir = @sysconfdir@
sharedstatedir = @sharedstatedir@
localstatedir = @localstatedir@
libdir = @libdir@
includedir = @includedir@
oldincludedir = @oldincludedir@
infodir = @infodir@
mandir = @mandir@
Jason Merrill's avatar
Jason Merrill committed
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
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
LN = @LN@
LN_S = @LN_S@
Jason Merrill's avatar
Jason Merrill committed

# -------------------------------------------------
# Miscellaneous non-standard autoconf-set variables
# -------------------------------------------------
Jason Merrill's avatar
Jason Merrill committed

# The gcc driver likes to know the arguments it was configured with.
TOPLEVEL_CONFIGURE_ARGUMENTS=@TOPLEVEL_CONFIGURE_ARGUMENTS@
Jason Merrill's avatar
Jason Merrill committed

tooldir = @tooldir@
build_tooldir = @build_tooldir@
Jason Merrill's avatar
Jason Merrill committed

Jason Merrill's avatar
Jason Merrill committed

# This is the name of the environment variable used for the path to
# the libraries.
RPATH_ENVVAR = @RPATH_ENVVAR@
Jason Merrill's avatar
Jason Merrill committed

# This is the list of directories to be built for the build system.
BUILD_CONFIGDIRS = libiberty
# Build programs are put under this directory.
BUILD_SUBDIR = @build_subdir@
# This is set by the configure script to the arguments to use when configuring
# directories built for the build system.
BUILD_CONFIGARGS = @build_configargs@ --with-build-subdir="$(BUILD_SUBDIR)"

# This is the list of variables to export in the environment when
# configuring any subdirectory.  It must also be exported whenever
# recursing into a build directory in case that directory's Makefile
# re-runs configure.
BASE_EXPORTS = \
	FLEX="$(FLEX)"; export FLEX; \
	LEX="$(LEX)"; export LEX; \
	BISON="$(BISON)"; export BISON; \
	YACC="$(YACC)"; export YACC; \
	M4="$(M4)"; export M4; \
	MAKEINFO="$(MAKEINFO)"; export MAKEINFO;

# This is the list of variables to export in the environment when
# configuring subdirectories for the build system.
	AR="$(AR_FOR_BUILD)"; export AR; \
	AS="$(AS_FOR_BUILD)"; export AS; \
	CC="$(CC_FOR_BUILD)"; export CC; \
	CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
	CXX="$(CXX_FOR_BUILD)"; export CXX; \
	CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
	GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
	GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \
	DLLTOOL="$(DLLTOOL_FOR_BUILD)"; export DLLTOOL; \
	LD="$(LD_FOR_BUILD)"; export LD; \
	LDFLAGS="$(LDFLAGS_FOR_BUILD)"; export LDFLAGS; \
	NM="$(NM_FOR_BUILD)"; export NM; \
	RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
	WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES;

# This is the list of directories to built for the host system.
SUBDIRS = @configdirs@
# This is set by the configure script to the arguments to use when configuring
# directories built for the host system.
HOST_CONFIGARGS = @host_configargs@
# Host programs are put under this directory, which is . except if building
# with srcdir=..
HOST_SUBDIR = @host_subdir@
# This is the list of variables to export in the environment when
# configuring subdirectories for the host system.  We need to pass
# some to the GCC configure because of its hybrid host/target nature.
	CC="$(CC)"; export CC; \
	CFLAGS="$(CFLAGS)"; export CFLAGS; \
	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
	CXX="$(CXX)"; export CXX; \
	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
	AR="$(AR)"; export AR; \
	AS="$(AS)"; export AS; \
	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
	DLLTOOL="$(DLLTOOL)"; export DLLTOOL; \
	LD="$(LD)"; export LD; \
	LDFLAGS="$(LDFLAGS)"; export LDFLAGS; \
	NM="$(NM)"; export NM; \
	RANLIB="$(RANLIB)"; export RANLIB; \
	WINDRES="$(WINDRES)"; export WINDRES; \
	OBJCOPY="$(OBJCOPY)"; export OBJCOPY; \
	OBJDUMP="$(OBJDUMP)"; export OBJDUMP; \
	AR_FOR_TARGET="$(AR_FOR_TARGET)"; export AR_FOR_TARGET; \
	AS_FOR_TARGET="$(AS_FOR_TARGET)"; export AS_FOR_TARGET; \
	GCC_FOR_TARGET="$(GCC_FOR_TARGET)"; export GCC_FOR_TARGET; \
	LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
	NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
	OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
	RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
	TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
	GMPLIBS="$(HOST_GMPLIBS)"; export GMPLIBS; \
	GMPINC="$(HOST_GMPINC)"; export GMPINC; \
@if gcc-bootstrap
	$(RPATH_ENVVAR)=`echo "$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR); \
@endif gcc-bootstrap
	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);
	CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
	  $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
	  -B$(build_tooldir)/bin/"; export CC_FOR_BUILD;

# This is set by the configure script to the list of directories which
# should be built using the target tools.
TARGET_CONFIGDIRS = @target_configdirs@
# Target libraries are put under this directory:
TARGET_SUBDIR = @target_subdir@
# This is set by the configure script to the arguments to use when configuring
# directories built for the target.
TARGET_CONFIGARGS = @target_configargs@ --with-target-subdir="$(TARGET_SUBDIR)"
# This is the list of variables to export in the environment when
# configuring subdirectories for the host system.
	AR="$(AR_FOR_TARGET)"; export AR; \
	CC="$(CC_FOR_TARGET)"; export CC; \
	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
	CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
	GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
Geoffrey Keating's avatar
Geoffrey Keating committed
	LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
	OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
	RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
Geoffrey Keating's avatar
Geoffrey Keating committed
	STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
	WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
	$(RPATH_ENVVAR)=`echo "$(HOST_LIB_PATH)$(TARGET_LIB_PATH)$$$(RPATH_ENVVAR)" | sed 's,::*,:,g;s,^:*,,;s,:*$$,,'`; export $(RPATH_ENVVAR);

RAW_CXX_TARGET_EXPORTS = \
	$(BASE_TARGET_EXPORTS) \
	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;

NORMAL_TARGET_EXPORTS = \
	$(BASE_TARGET_EXPORTS) \
	CXX="$(CXX_FOR_TARGET)"; export CXX;
# Where to find GMP
HOST_GMPLIBS = @gmplibs@
HOST_GMPINC = @gmpinc@

# ----------------------------------------------
# Programs producing files for the BUILD machine
# ----------------------------------------------

SHELL = @config_shell@

# pwd command to use.  Allow user to override default by setting PWDCMD in
# the environment to account for automounters.  The make variable must not
# be called PWDCMD, otherwise the value set here is passed to make
# subprocesses and overrides the setting from the user's environment.
# Don't use PWD since it is a common shell environment variable and we
# don't want to corrupt it.
PWD_COMMAND = $${PWDCMD-pwd}

# compilers to use to create programs which must be run in the build
# environment.
CC_FOR_BUILD = @CC_FOR_BUILD@
CFLAGS_FOR_BUILD = @CFLAGS_FOR_BUILD@

CXX_FOR_BUILD = $(CXX)

# Special variables passed down in EXTRA_GCC_FLAGS.  They are defined
# here so that they can be overridden by Makefile fragments.
BUILD_PREFIX = @BUILD_PREFIX@
BUILD_PREFIX_1 = @BUILD_PREFIX_1@
Jason Merrill's avatar
Jason Merrill committed

# Flags to pass to stage2 and later makes.  They are defined
# here so that they can be overridden by Makefile fragments.
BOOT_CFLAGS= -g -O2
BISON = @BISON@
YACC = @YACC@
FLEX = @FLEX@
LEX = @LEX@
M4 = @M4@
MAKEINFO = @MAKEINFO@
EXPECT = @EXPECT@
RUNTEST = @RUNTEST@
Jason Merrill's avatar
Jason Merrill committed

# This just becomes part of the MAKEINFO definition passed down to
# sub-makes.  It lets flags be given on the command line while still
# using the makeinfo from the object tree.
# (Default to avoid splitting info files by setting the threshold high.)
MAKEINFOFLAGS = --split-size=5000000
Jason Merrill's avatar
Jason Merrill committed

# ---------------------------------------------
# Programs producing files for the HOST machine
# ---------------------------------------------
Jason Merrill's avatar
Jason Merrill committed

AS = @AS@
AR = @AR@
AR_FLAGS = rc
CC = @CC@
CXX = @CXX@
DLLTOOL = @DLLTOOL@
LD = @LD@
RANLIB = @RANLIB@
WINDRES = @WINDRES@
Jason Merrill's avatar
Jason Merrill committed

CFLAGS = @CFLAGS@
LDFLAGS = 
LIBCFLAGS = $(CFLAGS)
CXXFLAGS = @CXXFLAGS@
LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates

# -----------------------------------------------
# Programs producing files for the TARGET machine
# -----------------------------------------------
FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
Jason Merrill's avatar
Jason Merrill committed

AR_FOR_TARGET=@AR_FOR_TARGET@
AS_FOR_TARGET=@AS_FOR_TARGET@
CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET)

# If GCC_FOR_TARGET is not overriden on the command line, then this
# variable is passed down to the gcc Makefile, where it is used to
# build libgcc2.a.  We define it here so that it can itself be
# overridden on the command line.
GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET)
DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
LD_FOR_TARGET=@LD_FOR_TARGET@

Geoffrey Keating's avatar
Geoffrey Keating committed
LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
NM_FOR_TARGET=@NM_FOR_TARGET@
OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
Geoffrey Keating's avatar
Geoffrey Keating committed
STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
WINDRES_FOR_TARGET=@WINDRES_FOR_TARGET@
Jason Merrill's avatar
Jason Merrill committed

COMPILER_AS_FOR_TARGET=@COMPILER_AS_FOR_TARGET@
COMPILER_LD_FOR_TARGET=@COMPILER_LD_FOR_TARGET@
COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_TARGET@

# During gcc bootstrap, if we use some random cc for stage1 then
# CFLAGS will be just -g.  We want to ensure that TARGET libraries
# (which we know are built with gcc) are built with optimizations so
# prepend -O2 when setting CFLAGS_FOR_TARGET.
CFLAGS_FOR_TARGET = -O2 $(CFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET)
LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
LDFLAGS_FOR_TARGET = 

# ------------------------------------
# Miscellaneous targets and flag lists
# ------------------------------------

# The first rule in the file had better be this one.  Don't put any above it.
# This lives here to allow makefile fragments to contain dependencies.
Jason Merrill's avatar
Jason Merrill committed
#### host and target specific makefile fragments come in here.
@target_makefile_frag@
@alphaieee_frag@
@ospace_frag@
@host_makefile_frag@
Jason Merrill's avatar
Jason Merrill committed
###

# This is the list of directories that may be needed in RPATH_ENVVAR
# so that prorgams built for the target machine work.
Diego Novillo's avatar
Diego Novillo committed
TARGET_LIB_PATH = $(TARGET_LIB_PATH_libstdc++-v3)$(TARGET_LIB_PATH_libmudflap)$(TARGET_LIB_PATH_libssp)$(TARGET_LIB_PATH_libgomp)$(HOST_LIB_PATH_gcc)

@if target-libstdc++-v3
TARGET_LIB_PATH_libstdc++-v3 = $$r/$(TARGET_SUBDIR)/libstdc++-v3/.libs:
@endif target-libstdc++-v3

@if target-libmudflap
TARGET_LIB_PATH_libmudflap = $$r/$(TARGET_SUBDIR)/libmudflap/.libs:
@endif target-libmudflap

@if target-libssp
TARGET_LIB_PATH_libssp = $$r/$(TARGET_SUBDIR)/libssp/.libs:
@endif target-libssp

Diego Novillo's avatar
Diego Novillo committed
@if target-libgomp
TARGET_LIB_PATH_libgomp = $$r/$(TARGET_SUBDIR)/libgomp/.libs:
@endif target-libgomp



# This is the list of directories that may be needed in RPATH_ENVVAR
# so that programs built for the host machine work.
HOST_LIB_PATH = $(HOST_LIB_PATH_bfd)$(HOST_LIB_PATH_opcodes)

# Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
@if gcc
HOST_LIB_PATH_gcc = $$r/$(HOST_SUBDIR)/gcc:$$r/$(HOST_SUBDIR)/prev-gcc:
@endif gcc


@if bfd
HOST_LIB_PATH_bfd = \
  $$r/$(HOST_SUBDIR)/bfd/.:$$r/$(HOST_SUBDIR)/prev-bfd/.:
@endif bfd

@if opcodes
HOST_LIB_PATH_opcodes = \
  $$r/$(HOST_SUBDIR)/opcodes/.:$$r/$(HOST_SUBDIR)/prev-opcodes/.:
@endif opcodes


Jason Merrill's avatar
Jason Merrill committed
# Flags to pass down to all sub-makes.
BASE_FLAGS_TO_PASS = \
	"RPATH_ENVVAR=$(RPATH_ENVVAR)" \
	"TARGET_SUBDIR=$(TARGET_SUBDIR)" \
	"bindir=$(bindir)" \
	"datadir=$(datadir)" \
	"exec_prefix=$(exec_prefix)" \
	"includedir=$(includedir)" \
	"infodir=$(infodir)" \
	"libdir=$(libdir)" \
	"libexecdir=$(libexecdir)" \
	"oldincludedir=$(oldincludedir)" \
	"prefix=$(prefix)" \
	"sbindir=$(sbindir)" \
	"sharedstatedir=$(sharedstatedir)" \
	"sysconfdir=$(sysconfdir)" \
	"target_alias=$(target_alias)" \
	"BISON=$(BISON)" \
	"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
	"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
	"CXX_FOR_BUILD=$(CXX_FOR_BUILD)" \
	"EXPECT=$(EXPECT)" \
	"INSTALL=$(INSTALL)" \
	"INSTALL_DATA=$(INSTALL_DATA)" \
	"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
	"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
	"LEX=$(LEX)" \
	"M4=$(M4)" \
	"MAKE=$(MAKE)" \
	"RUNTEST=$(RUNTEST)" \
	"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
	"SHELL=$(SHELL)" \
	"YACC=$(YACC)" \
	"AR_FLAGS=$(AR_FLAGS)" \
	"BOOT_CFLAGS=$(BOOT_CFLAGS)" \
	"BOOT_LDFLAGS=$(BOOT_LDFLAGS)" \
	"CFLAGS=$(CFLAGS)" \
	"CXXFLAGS=$(CXXFLAGS)" \
	"LDFLAGS=$(LDFLAGS)" \
	"LIBCFLAGS=$(LIBCFLAGS)" \
	"LIBCXXFLAGS=$(LIBCXXFLAGS)" \
	"STAGE1_CFLAGS=$(STAGE1_CFLAGS)" \
	"STAGE1_LANGUAGES=$(STAGE1_LANGUAGES)" \
	"AR_FOR_TARGET=$(AR_FOR_TARGET)" \
	"AS_FOR_TARGET=$(AS_FOR_TARGET)" \
	"CC_FOR_TARGET=$(CC_FOR_TARGET)" \
	"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
	"CPPFLAGS_FOR_TARGET=$(CPPFLAGS_FOR_TARGET)" \
	"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
	"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
	"DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
	"GCJ_FOR_TARGET=$(GCJ_FOR_TARGET)" \
	"GFORTRAN_FOR_TARGET=$(GFORTRAN_FOR_TARGET)" \
	"LD_FOR_TARGET=$(LD_FOR_TARGET)" \
Geoffrey Keating's avatar
Geoffrey Keating committed
	"LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \
	"LDFLAGS_FOR_TARGET=$(LDFLAGS_FOR_TARGET)" \
	"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
	"LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
	"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
	"OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \
	"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
Geoffrey Keating's avatar
Geoffrey Keating committed
	"STRIP_FOR_TARGET=$(STRIP_FOR_TARGET)" \
	"WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
	"CONFIG_SHELL=$(SHELL)" \
	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" 
Jason Merrill's avatar
Jason Merrill committed

# We leave this in just in case, but it is not needed anymore.
RECURSE_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS)
Jason Merrill's avatar
Jason Merrill committed
# Flags to pass down to most sub-makes, in which we're building with
# the host environment.
EXTRA_HOST_FLAGS = \
	'AR=$(AR)' \
	'AS=$(AS)' \
	'CC=$(CC)' \
	'CXX=$(CXX)' \
	'DLLTOOL=$(DLLTOOL)' \
	'LD=$(LD)' \
Jason Merrill's avatar
Jason Merrill committed
	'NM=$(NM)' \
	'RANLIB=$(RANLIB)' \
Jason Merrill's avatar
Jason Merrill committed
	'WINDRES=$(WINDRES)'

FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS)

# Flags that are concerned with the location of the X11 include files
# and library files
#
# NOTE: until the top-level is getting the values via autoconf, it only
# causes problems to have this top-level Makefile overriding the autoconf-set
# values in child directories.  Only variables that don't conflict with
# autoconf'ed ones should be passed by X11_FLAGS_TO_PASS for now.
#
X11_FLAGS_TO_PASS = \
	'X11_EXTRA_CFLAGS=$(X11_EXTRA_CFLAGS)' \
	'X11_EXTRA_LIBS=$(X11_EXTRA_LIBS)'

# Flags to pass down to makes which are built with the target environment.
# The double $ decreases the length of the command line; those variables
# are set in BASE_FLAGS_TO_PASS, and the sub-make will expand them.  The
# COMPILER_ prefixed variables are not passed down so we expand them here.
Jason Merrill's avatar
Jason Merrill committed
EXTRA_TARGET_FLAGS = \
	'AR=$$(AR_FOR_TARGET)' \
Jason Merrill's avatar
Jason Merrill committed
	'CC=$$(CC_FOR_TARGET)' \
	'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
	'CXX=$$(CXX_FOR_TARGET)' \
	'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
	'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
	'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
Jason Merrill's avatar
Jason Merrill committed
	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
	'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
	'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
Jason Merrill's avatar
Jason Merrill committed
	'WINDRES=$$(WINDRES_FOR_TARGET)'

TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)

# Flags to pass down to gcc.  gcc builds a library, libgcc.a, so it
# unfortunately needs the native compiler and the target ar and
# ranlib.
# If any variables are added here, they must be added to do-*, below.
# The BUILD_* variables are a special case, which are used for the gcc
Jason Merrill's avatar
Jason Merrill committed
# cross-building scheme.
EXTRA_GCC_FLAGS = \
	'BUILD_PREFIX=$(BUILD_PREFIX)' \
	'BUILD_PREFIX_1=$(BUILD_PREFIX_1)' \
Jason Merrill's avatar
Jason Merrill committed
	"GCC_FOR_TARGET=$(GCC_FOR_TARGET)" \
	"`echo 'LANGUAGES=$(LANGUAGES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
	"`echo 'STMP_FIXPROTO=$(STMP_FIXPROTO)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
	"`echo 'LIMITS_H_TEST=$(LIMITS_H_TEST)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
	"`echo 'LIBGCC2_CFLAGS=$(LIBGCC2_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
	"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
	"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`" \
	"`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"
Jason Merrill's avatar
Jason Merrill committed

GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
Jason Merrill's avatar
Jason Merrill committed

Nathanael Nerode's avatar
Nathanael Nerode committed
.PHONY: configure-host
configure-host:  \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-ash \
    maybe-configure-autoconf \
    maybe-configure-automake \
    maybe-configure-bash \
    maybe-configure-bfd \
    maybe-configure-opcodes \
    maybe-configure-binutils \
    maybe-configure-bison \
    maybe-configure-byacc \
    maybe-configure-bzip2 \
    maybe-configure-dejagnu \
    maybe-configure-diff \
    maybe-configure-dosutils \
    maybe-configure-etc \
    maybe-configure-fastjar \
    maybe-configure-fileutils \
    maybe-configure-findutils \
    maybe-configure-find \
Geoffrey Keating's avatar
Geoffrey Keating committed
    maybe-configure-fixincludes \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-flex \
    maybe-configure-gas \
    maybe-configure-gcc \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-gawk \
    maybe-configure-gettext \
    maybe-configure-gnuserv \
    maybe-configure-gprof \
    maybe-configure-gzip \
    maybe-configure-hello \
    maybe-configure-indent \
    maybe-configure-intl \
    maybe-configure-tcl \
    maybe-configure-itcl \
    maybe-configure-ld \
    maybe-configure-libcpp \
    maybe-configure-libdecnumber \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-libgui \
    maybe-configure-libiberty \
    maybe-configure-libtool \
    maybe-configure-m4 \
    maybe-configure-make \
    maybe-configure-mmalloc \
    maybe-configure-patch \
    maybe-configure-perl \
    maybe-configure-prms \
    maybe-configure-rcs \
    maybe-configure-readline \
    maybe-configure-release \
    maybe-configure-recode \
    maybe-configure-sed \
    maybe-configure-send-pr \
    maybe-configure-shellutils \
    maybe-configure-sid \
    maybe-configure-sim \
    maybe-configure-tar \
    maybe-configure-texinfo \
    maybe-configure-textutils \
    maybe-configure-time \
    maybe-configure-uudecode \
    maybe-configure-wdiff \
    maybe-configure-zip \
    maybe-configure-zlib \
    maybe-configure-gdb \
    maybe-configure-expect \
    maybe-configure-guile \
    maybe-configure-tk \
    maybe-configure-libtermcap \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-utils \
    maybe-configure-gnattools
Nathanael Nerode's avatar
Nathanael Nerode committed
.PHONY: configure-target
configure-target:  \
    maybe-configure-target-libstdc++-v3 \
    maybe-configure-target-libmudflap \
    maybe-configure-target-libssp \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-target-newlib \
    maybe-configure-target-libgfortran \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-configure-target-libobjc \
    maybe-configure-target-libtermcap \
    maybe-configure-target-winsup \
    maybe-configure-target-libgloss \
    maybe-configure-target-libiberty \
    maybe-configure-target-gperf \
    maybe-configure-target-examples \
    maybe-configure-target-libffi \
    maybe-configure-target-libjava \
    maybe-configure-target-zlib \
    maybe-configure-target-boehm-gc \
    maybe-configure-target-qthreads \
Arnaud Charlet's avatar
Arnaud Charlet committed
    maybe-configure-target-rda \
Diego Novillo's avatar
Diego Novillo committed
    maybe-configure-target-libada \
    maybe-configure-target-libgomp
Jason Merrill's avatar
Jason Merrill committed

# The target built for a native non-bootstrap build.
.PHONY: all
	@r=`${PWD_COMMAND}`; export r; \
	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
	$(MAKE) $(RECURSE_FLAGS_TO_PASS) `cat stage_final`-bubble
	@r=`${PWD_COMMAND}`; export r; \
	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
	if [ -f stage_last ]; then \
	  $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target; \

.PHONY: all-build
all-build:  \
    maybe-all-build-libiberty \
    maybe-all-build-bison \
    maybe-all-build-byacc \
    maybe-all-build-flex \
    maybe-all-build-m4 \
    maybe-all-build-texinfo \
    maybe-all-build-fixincludes
Nathanael Nerode's avatar
Nathanael Nerode committed
.PHONY: all-host
all-host:  \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-ash \
    maybe-all-autoconf \
    maybe-all-automake \
    maybe-all-bash \
    maybe-all-bfd \
    maybe-all-opcodes \
    maybe-all-binutils \
    maybe-all-bison \
    maybe-all-byacc \
    maybe-all-bzip2 \
    maybe-all-dejagnu \
    maybe-all-diff \
    maybe-all-dosutils \
    maybe-all-etc \
    maybe-all-fastjar \
    maybe-all-fileutils \
    maybe-all-findutils \
    maybe-all-find \
Geoffrey Keating's avatar
Geoffrey Keating committed
    maybe-all-fixincludes \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-flex \
    maybe-all-gas \
    maybe-all-gcc \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-gawk \
    maybe-all-gettext \
    maybe-all-gnuserv \
    maybe-all-gprof \
    maybe-all-gzip \
    maybe-all-hello \
    maybe-all-indent \
    maybe-all-intl \
    maybe-all-tcl \
    maybe-all-itcl \
    maybe-all-ld \
    maybe-all-libcpp \
    maybe-all-libdecnumber \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-libgui \
    maybe-all-libiberty \
    maybe-all-libtool \
    maybe-all-m4 \
    maybe-all-make \
    maybe-all-mmalloc \
    maybe-all-patch \
    maybe-all-perl \
    maybe-all-prms \
    maybe-all-rcs \
    maybe-all-readline \
    maybe-all-release \
    maybe-all-recode \
    maybe-all-sed \
    maybe-all-send-pr \
    maybe-all-shellutils \
    maybe-all-sid \
    maybe-all-sim \
    maybe-all-tar \
    maybe-all-texinfo \
    maybe-all-textutils \
    maybe-all-time \
    maybe-all-uudecode \
    maybe-all-wdiff \
    maybe-all-zip \
    maybe-all-zlib \
    maybe-all-gdb \
    maybe-all-expect \
    maybe-all-guile \
    maybe-all-tk \
    maybe-all-libtermcap \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-utils \
    maybe-all-gnattools
Nathanael Nerode's avatar
Nathanael Nerode committed
.PHONY: all-target
all-target:  \
    maybe-all-target-libstdc++-v3 \
    maybe-all-target-libmudflap \
    maybe-all-target-libssp \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-target-newlib \
    maybe-all-target-libgfortran \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-all-target-libobjc \
    maybe-all-target-libtermcap \
    maybe-all-target-winsup \
    maybe-all-target-libgloss \
    maybe-all-target-libiberty \
    maybe-all-target-gperf \
    maybe-all-target-examples \
    maybe-all-target-libffi \
    maybe-all-target-libjava \
    maybe-all-target-zlib \
    maybe-all-target-boehm-gc \
    maybe-all-target-qthreads \
Arnaud Charlet's avatar
Arnaud Charlet committed
    maybe-all-target-rda \
Diego Novillo's avatar
Diego Novillo committed
    maybe-all-target-libada \
    maybe-all-target-libgomp
Jason Merrill's avatar
Jason Merrill committed

# Do a target for all the subdirectories.  A ``make do-X'' will do a
# ``make X'' in all subdirectories (because, in general, there is a
# dependency (below) of X upon do-X, a ``make X'' will also do this,
# but it may do additional work as well).
	@r=`${PWD_COMMAND}`; export r; \
	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
	$(MAKE) $(RECURSE_FLAGS_TO_PASS) info-host \
Jason Merrill's avatar
Jason Merrill committed

info-host:  \
    maybe-info-ash \
    maybe-info-autoconf \
    maybe-info-automake \
    maybe-info-bash \
    maybe-info-bfd \
    maybe-info-opcodes \
    maybe-info-binutils \
    maybe-info-bison \
    maybe-info-byacc \
    maybe-info-bzip2 \
    maybe-info-dejagnu \
    maybe-info-diff \
    maybe-info-dosutils \
    maybe-info-etc \
    maybe-info-fastjar \
    maybe-info-fileutils \
    maybe-info-findutils \
    maybe-info-find \
Geoffrey Keating's avatar
Geoffrey Keating committed
    maybe-info-fixincludes \
    maybe-info-gcc \
    maybe-info-gawk \
    maybe-info-gettext \
    maybe-info-gnuserv \
    maybe-info-gprof \
    maybe-info-gzip \
    maybe-info-hello \
    maybe-info-indent \
    maybe-info-intl \
    maybe-info-tcl \
    maybe-info-itcl \
    maybe-info-ld \
    maybe-info-libcpp \
    maybe-info-libdecnumber \
    maybe-info-libgui \
    maybe-info-libiberty \
    maybe-info-libtool \
    maybe-info-m4 \
    maybe-info-make \
    maybe-info-mmalloc \
    maybe-info-patch \
    maybe-info-perl \
    maybe-info-prms \
    maybe-info-rcs \
    maybe-info-readline \
    maybe-info-release \
    maybe-info-recode \
    maybe-info-sed \
    maybe-info-send-pr \
    maybe-info-shellutils \
    maybe-info-sid \
    maybe-info-sim \
    maybe-info-tar \
    maybe-info-texinfo \
    maybe-info-textutils \
    maybe-info-time \
    maybe-info-uudecode \
    maybe-info-wdiff \
    maybe-info-zip \
    maybe-info-zlib \
    maybe-info-gdb \
    maybe-info-expect \
    maybe-info-guile \
    maybe-info-tk \
    maybe-info-libtermcap \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-info-utils \
    maybe-info-gnattools
Jason Merrill's avatar
Jason Merrill committed

.PHONY: info-target
info-target:  \
    maybe-info-target-libstdc++-v3 \
    maybe-info-target-libmudflap \
    maybe-info-target-libssp \
    maybe-info-target-libgfortran \
    maybe-info-target-libobjc \
    maybe-info-target-libtermcap \
    maybe-info-target-winsup \
    maybe-info-target-libgloss \
    maybe-info-target-libiberty \
    maybe-info-target-gperf \
    maybe-info-target-examples \
    maybe-info-target-libffi \
    maybe-info-target-libjava \
    maybe-info-target-zlib \
    maybe-info-target-boehm-gc \
    maybe-info-target-qthreads \
Arnaud Charlet's avatar
Arnaud Charlet committed
    maybe-info-target-rda \
Diego Novillo's avatar
Diego Novillo committed
    maybe-info-target-libada \
    maybe-info-target-libgomp
Jason Merrill's avatar
Jason Merrill committed

	@r=`${PWD_COMMAND}`; export r; \
	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
	$(MAKE) $(RECURSE_FLAGS_TO_PASS) dvi-host \
dvi-host:  \
    maybe-dvi-ash \
    maybe-dvi-autoconf \
    maybe-dvi-automake \
    maybe-dvi-bash \
    maybe-dvi-bfd \
    maybe-dvi-opcodes \
    maybe-dvi-binutils \
    maybe-dvi-bison \
    maybe-dvi-byacc \
    maybe-dvi-bzip2 \
    maybe-dvi-dejagnu \
    maybe-dvi-diff \
    maybe-dvi-dosutils \
    maybe-dvi-etc \
    maybe-dvi-fastjar \
    maybe-dvi-fileutils \
    maybe-dvi-findutils \
    maybe-dvi-find \
Geoffrey Keating's avatar
Geoffrey Keating committed
    maybe-dvi-fixincludes \
    maybe-dvi-gcc \
    maybe-dvi-gawk \
    maybe-dvi-gettext \
    maybe-dvi-gnuserv \
    maybe-dvi-gprof \
    maybe-dvi-gzip \
    maybe-dvi-hello \
    maybe-dvi-indent \
    maybe-dvi-intl \
    maybe-dvi-tcl \
    maybe-dvi-itcl \
    maybe-dvi-ld \
    maybe-dvi-libcpp \
    maybe-dvi-libdecnumber \
    maybe-dvi-libgui \
    maybe-dvi-libiberty \
    maybe-dvi-libtool \
    maybe-dvi-m4 \
    maybe-dvi-make \
    maybe-dvi-mmalloc \
    maybe-dvi-patch \
    maybe-dvi-perl \
    maybe-dvi-prms \
    maybe-dvi-rcs \
    maybe-dvi-readline \
    maybe-dvi-release \
    maybe-dvi-recode \
    maybe-dvi-sed \
    maybe-dvi-send-pr \
    maybe-dvi-shellutils \
    maybe-dvi-sid \
    maybe-dvi-sim \
    maybe-dvi-tar \
    maybe-dvi-texinfo \
    maybe-dvi-textutils \
    maybe-dvi-time \
    maybe-dvi-uudecode \
    maybe-dvi-wdiff \
    maybe-dvi-zip \
    maybe-dvi-zlib \
    maybe-dvi-gdb \
    maybe-dvi-expect \
    maybe-dvi-guile \
    maybe-dvi-tk \
    maybe-dvi-libtermcap \
Nathanael Nerode's avatar
Nathanael Nerode committed
    maybe-dvi-utils \
    maybe-dvi-gnattools
.PHONY: dvi-target
dvi-target:  \
    maybe-dvi-target-libstdc++-v3 \
    maybe-dvi-target-libmudflap \
    maybe-dvi-target-libssp \
    maybe-dvi-target-libgfortran \
    maybe-dvi-target-libobjc \
    maybe-dvi-target-libtermcap \
    maybe-dvi-target-winsup \
    maybe-dvi-target-libgloss \
    maybe-dvi-target-libiberty \
    maybe-dvi-target-gperf \
    maybe-dvi-target-examples \
    maybe-dvi-target-libffi \
    maybe-dvi-target-libjava \
    maybe-dvi-target-zlib \
    maybe-dvi-target-boehm-gc \
    maybe-dvi-target-qthreads \
    maybe-dvi-target-rda \
Diego Novillo's avatar
Diego Novillo committed
    maybe-dvi-target-libada \
    maybe-dvi-target-libgomp
.PHONY: do-html
	@r=`${PWD_COMMAND}`; export r; \
	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
	$(MAKE) $(RECURSE_FLAGS_TO_PASS) html-host \

.PHONY: html-host
html-host:  \
    maybe-html-ash \
    maybe-html-autoconf \
    maybe-html-automake \
    maybe-html-bash \
    maybe-html-bfd \
    maybe-html-opcodes \
    maybe-html-binutils \
    maybe-html-bison \
    maybe-html-byacc \
    maybe-html-bzip2 \
    maybe-html-dejagnu \
    maybe-html-diff \
    maybe-html-dosutils \
    maybe-html-etc \
    maybe-html-fastjar \
    maybe-html-fileutils \