#
# 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., 675 Mass Ave, Cambridge, MA 02139, USA. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#
srcdir = .
SUBDIRS = "this is set via configure, don't edit this"
OTHERS =
+# This is set by the configure script to the list of directories which
+# should be built using the target tools.
+TARGET_CONFIGDIRS = xiberty libgloss newlib libio librx libstdc++ libg++
+
+# This is set by the configure script to the arguments passed to configure.
+CONFIG_ARGUMENTS =
+
ALL = all.normal
INSTALL_TARGET = install-dirs \
$(INSTALL_MODULES) \
fi; \
fi`
+DLLTOOL_FOR_TARGET = ` \
+ if [ -f $$r/binutils/dlltool ] ; then \
+ echo $$r/binutils/dlltool ; \
+ else \
+ if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
+ echo $(DLLTOOL); \
+ else \
+ t='$(program_transform_name)'; echo dlltool | sed -e 's/x/x/' $$t ; \
+ fi; \
+ fi`
+
AR_FOR_TARGET = ` \
if [ -f $$r/binutils/ar ] ; then \
echo $$r/binutils/ar ; \
"CXXFLAGS=$(CXXFLAGS)" \
"CXXFLAGS_FOR_TARGET=$(CXXFLAGS_FOR_TARGET)" \
"CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \
+ "DLLTOOL_FOR_TARGET=$(DLLTOOL_FOR_TARGET)" \
"GCC_FOR_TARGET=$(CC_FOR_TARGET)" \
"INSTALL=$(INSTALL)" \
"INSTALL_DATA=$(INSTALL_DATA)" \
'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
'CXX=$$(CXX_FOR_TARGET)' \
'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
+ 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
'NM=$$(NM_FOR_TARGET)' \
# This is a list of the targets for all of the modules which are compiled
# using $(TARGET_FLAGS_TO_PASS).
ALL_TARGET_MODULES = \
- $(start-sanitize-chill) \
- all-chillrt \
- $(end-sanitize-chill) \
all-libio \
all-libstdc++ \
all-librx \
all-libgloss \
all-xiberty
+# This is a list of the configure targets for all of the modules which
+# are compiled using the target tools.
+CONFIGURE_TARGET_MODULES = \
+ configure-libio \
+ configure-libstdc++ \
+ configure-librx \
+ configure-libg++ \
+ configure-newlib \
+ configure-libgloss \
+ configure-xiberty
+
# This is a list of the check targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
CHECK_TARGET_MODULES = \
- $(start-sanitize-chill) \
- check-chillrt \
- $(end-sanitize-chill) \
check-libio \
check-libstdc++ \
check-libg++ \
# This is a list of the install targets for all of the modules which are
# compiled using $(TARGET_FLAGS_TO_PASS).
INSTALL_TARGET_MODULES = \
- $(start-sanitize-chill) \
- install-chillrt \
- $(end-sanitize-chill) \
install-libio \
install-libstdc++ \
install-libg++ \
# This is a shell case of all modules which are compiled using
# $(TARGET_FLAGS_TO_PASS), used in the do-X rule.
TARGET_LIBS = libio | libstdc++ | librx | libg++ | newlib | xiberty
-# start-sanitize-chill
-TARGET_LIBS = chillrt | libio | libstdc++ | librx | libg++ | newlib | xiberty
-# end-sanitize-chill
# The first rule in the file had better be this one. Don't put any above it.
all: all.normal
do-install-info \
do-installcheck \
do-mostlyclean \
- do-realclean \
+ do-maintainer-clean \
do-TAGS
.PHONY: $(DO_X)
$(DO_X):
@target=`echo $@ | sed -e 's/^do-//'`; \
r=`pwd`; export r; \
srcroot=`cd $(srcdir); pwd`; export srcroot; \
- for i in $(SUBDIRS); do \
+ for i in $(SUBDIRS) $(TARGET_CONFIGDIRS); do \
if [ -f ./$$i/Makefile ]; then \
case $$i in \
$(TARGET_LIBS) ) \
# Here are the targets which correspond to the do-X targets.
.PHONY: info installcheck dvi install-info
-.PHONY: clean distclean mostlyclean realclean local-clean local-distclean
+.PHONY: clean distclean mostlyclean maintainer-clean realclean
+.PHONY: local-clean local-distclean local-maintainer-clean
info: do-info
installcheck: do-installcheck
dvi: do-dvi
local-distclean:
-rm -f Makefile config.status
+local-maintainer-clean:
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
clean: do-clean local-clean
mostlyclean: do-mostlyclean local-clean
distclean: do-distclean local-clean local-distclean
-realclean: do-realclean local-clean local-distclean
+maintainer-clean: local-maintainer-clean do-maintainer-clean local-clean
+maintainer-clean: local-distclean
+realclean: maintainer-clean
# Check target.
true; \
fi
+# This rule is used to configure the modules which are built with the
+# target tools.
+.PHONY: $(CONFIGURE_TARGET_MODULES)
+$(CONFIGURE_TARGET_MODULES):
+ @dir=`echo $@ | sed -e 's/configure-//'`; \
+ if [ -f ./$${dir}/Makefile ] ; then \
+ true; \
+ elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
+ if [ -d ./$${dir} ]; then true; else mkdir $${dir}; fi; \
+ r=`pwd`; export r; \
+ srcroot=`cd $(srcdir); pwd`; export srcroot; \
+ AR="$(AR_FOR_TARGET)"; export AR; \
+ AS="$(AS_FOR_TARGET)"; export AS; \
+ CC="$(CC_FOR_TARGET)"; export CC; \
+ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CXX="$(CXX_FOR_TARGET)"; export CXX; \
+ CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+ NM="$(NM_FOR_TARGET)"; export NM; \
+ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
+ cd $${dir}; \
+ $${srcroot}/configure $(CONFIG_ARGUMENTS) --srcdir=$${srcroot}/$${dir}; \
+ else \
+ true; \
+ fi
+
# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS.
# To build a target all-X means to cd to X and make all.
.PHONY: $(ALL_TARGET_MODULES)
all-bfd:
all-binutils: all-libiberty all-opcodes all-bfd all-flex all-byacc
all-byacc:
-# start-sanitize-chill
-all-chillrt: all-binutils all-gas all-gcc all-newlib
-# end-sanitize-chill
all-cvs:
all-dejagnu: all-tcl all-expect all-tk
all-diff: all-libiberty
all-indent:
all-ispell: all-emacs19
all-ld: all-libiberty all-bfd all-byacc all-flex
-all-libg++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
-all-libio: all-gas all-ld all-gcc all-xiberty all-newlib
+configure-libg++: all-gcc
+all-libg++: configure-libg++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio all-librx all-libstdc++
+configure-libgloss: all-gcc
+all-libgloss: configure-libgloss
+configure-libio: all-gcc
+all-libio: configure-libio all-gas all-ld all-gcc all-xiberty all-newlib
all-libiberty:
-all-libstdc++: all-gas all-ld all-gcc all-xiberty all-newlib all-libio
+configure-librx: all-gcc all-newlib
+all-librx: configure-librx
+configure-libstdc++: all-gcc
+all-libstdc++: configure-libstdc++ all-gas all-ld all-gcc all-xiberty all-newlib all-libio
all-m4: all-libiberty
all-make: all-libiberty
all-mmalloc:
-all-newlib: all-binutils all-gas all-gcc
+configure-newlib: all-gcc
+all-newlib: configure-newlib all-binutils all-gas all-gcc
all-opcodes: all-bfd
all-patch:
all-prms: all-libiberty
all-time:
all-wdiff:
all-uudecode: all-libiberty
-all-xiberty: all-gcc all-ld all-newlib
+configure-xiberty: all-gcc
+all-xiberty: configure-xiberty all-gcc all-ld all-newlib
### other supporting targets
# distribution (perhaps it would be better to include it anyway).
DEVO_SUPPORT= README Makefile.in configure configure.in \
config.guess config.sub config move-if-change \
+ mpw-README mpw-build.in mpw-config.in mpw-configure \
COPYING COPYING.LIB install.sh
# Files in devo/etc used in any net release.
SUPPORT_FILES="$(GNATS_SUPPORT_DIRS)"
.PHONY: gdb.tar.gz
-GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim
+GDB_SUPPORT_DIRS= bfd include libiberty mmalloc opcodes readline sim utils
+GDBTK_SUPPORT_DIRS= `if [ -d tcl -a -d tk ] ; then echo tcl tk ; fi`
gdb.tar.gz: $(DIST_SUPPORT) $(GDB_SUPPORT_DIRS) gdb
$(MAKE) -f Makefile.in taz TOOL=gdb \
- SUPPORT_FILES="$(GDB_SUPPORT_DIRS)"
+ SUPPORT_FILES="$(GDB_SUPPORT_DIRS) $(GDBTK_SUPPORT_DIRS)"
.PHONY: newlib.tar.gz
-NEWLIB_SUPPORT_DIRS=
+NEWLIB_SUPPORT_DIRS=libgloss
# taz configures for the sun4 target which won't configure newlib.
-# compensate here by configuring newlib for a simple (no multilib support)
-# cross target (sparc64).
+# We need newlib configured so that the .info files are made.
+# Unfortunately, it is not enough to just configure newlib separately:
+# taz will build the .info files but since SUBDIRS won't contain newlib,
+# distclean won't be run (leaving Makefile, config.status, and the tmp files
+# used in building the .info files, eg: *.def, *.ref).
+# Compensate here by configuring newlib for a simple (no multilib support)
+# cross target (sparc64), building the info files, and doing make distclean
+# ourselves.
newlib.tar.gz: $(DIST_SUPPORT) $(NEWLIB_SUPPORT_DIRS) newlib
rootme=`pwd` ; \
cd newlib && ../configure --srcdir $$rootme/newlib \
--host sun4 --target sparc64-elf
+ cd newlib ; make info
+ cd newlib ; make distclean
$(MAKE) -f Makefile.in taz TOOL=newlib \
SUPPORT_FILES="$(NEWLIB_SUPPORT_DIRS)" \
DEVO_SUPPORT="$(DEVO_SUPPORT) COPYING.NEWLIB" \