This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Toplevel patch: Autogenerate Makefile targets 3 (*-build-*)
- From: Nathanael Nerode <neroden at twcny dot rr dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: gdb-patches at sources dot redhat dot com, binutils at sources dot redhat dot com, dj at redhat dot com
- Date: Wed, 13 Nov 2002 15:20:39 -0500
- Subject: Toplevel patch: Autogenerate Makefile targets 3 (*-build-*)
More of the same. Tested with a Canadian cross configuration, built
build-side libiberty OK. Again, this will sit on 3.4bib until 3.3
branches.
* Makefile.tpl: Autogenerate (*-build-*).
* Makefile.def: Add build_modules.
* Makefile.in: Regenerate.
--- Makefile.tpl.2 2002-11-13 14:19:32.000000000 -0500
+++ Makefile.tpl 2002-11-13 15:12:01.000000000 -0500
@@ -877,31 +877,28 @@
mv gcc/tmp-include gcc/include 2>/dev/null; \
else true; fi
-# This rule is used to build the modules which are built with the
+# These rules are used to build the modules which are built with the
# build machine's native compiler.
-.PHONY: $(ALL_BUILD_MODULES)
-$(ALL_BUILD_MODULES):
- dir=`echo $@ | sed -e 's/all-build-//'`; \
- if [ -f ./$${dir}/Makefile ] ; then \
+[+ FOR build_modules +]
+.PHONY: all-build-[+module+]
+all-build-[+module+]:
+ if [ -f ./[+module+]/Makefile ] ; then \
r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
- (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
+ (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all); \
else \
true; \
fi
-# This rule is used to configure the modules which are built with the
-# native tools.
-.PHONY: $(CONFIGURE_BUILD_MODULES)
-$(CONFIGURE_BUILD_MODULES):
- @dir=`echo $@ | sed -e 's/configure-build-//'`; \
+.PHONY: configure-build-[+module+]
+configure-build-[+module+]:
if [ ! -d $(BUILD_SUBDIR) ]; then \
true; \
- elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
+ elif [ -f $(BUILD_SUBDIR)/[+module+]/Makefile ] ; then \
true; \
- elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
- if [ -d $(srcdir)/$${dir} ]; then \
- [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
+ elif echo " $(BUILD_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
+ if [ -d $(srcdir)/[+module+] ]; then \
+ [ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\
r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
AR="$(AR_FOR_BUILD)"; export AR; \
@@ -917,8 +914,8 @@
NM="$(NM_FOR_BUILD)"; export NM; \
RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
- echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
- cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
+ echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
+ cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) \
topdir=$(srcdir) ;; \
@@ -930,7 +927,7 @@
esac; \
if [ "$(srcdir)" = "." ] ; then \
if [ "$(BUILD_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/[+module+] "no-such-file" ; then \
if [ -f Makefile ]; then \
if $(MAKE) distclean; then \
true; \
@@ -949,8 +946,8 @@
srcdiroption="--srcdir=."; \
libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/$${dir}"; \
- libsrcdir="$$s/$${dir}"; \
+ srcdiroption="--srcdir=$${topdir}/[+module+]"; \
+ libsrcdir="$$s/[+module+]"; \
fi; \
if [ -f $${libsrcdir}/configure ] ; then \
rm -f no-such-file skip-this-dir; \
@@ -966,7 +963,7 @@
if [ -f skip-this-dir ] ; then \
sh skip-this-dir; \
rm -f skip-this-dir; \
- cd ..; rmdir $${dir} || true; \
+ cd ..; rmdir [+module+] || true; \
else \
true; \
fi; \
@@ -976,6 +973,7 @@
else \
true; \
fi
+[+ ENDFOR build_modules +]
# This rule is used to build the modules which use FLAGS_TO_PASS. To
# build a target all-X means to cd to X and make all.
--- Makefile.def.2 2002-11-13 14:19:36.000000000 -0500
+++ Makefile.def 2002-11-13 15:09:10.000000000 -0500
@@ -1,6 +1,8 @@
#! /usr/bin/autogen
AutoGen definitions Makefile.tpl;
+build_modules= { module= libiberty; };
+
host_modules= { module= ash; };
host_modules= { module= autoconf; };
host_modules= { module= automake; };
--- Makefile.in.2 2002-11-13 14:19:41.000000000 -0500
+++ Makefile.in 2002-11-13 15:12:07.000000000 -0500
@@ -1563,31 +1563,28 @@
mv gcc/tmp-include gcc/include 2>/dev/null; \
else true; fi
-# This rule is used to build the modules which are built with the
+# These rules are used to build the modules which are built with the
# build machine's native compiler.
-.PHONY: $(ALL_BUILD_MODULES)
-$(ALL_BUILD_MODULES):
- dir=`echo $@ | sed -e 's/all-build-//'`; \
- if [ -f ./$${dir}/Makefile ] ; then \
+
+.PHONY: all-build-libiberty
+all-build-libiberty:
+ if [ -f ./libiberty/Makefile ] ; then \
r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
- (cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \
+ (cd $(BUILD_SUBDIR)/libiberty && $(MAKE) all); \
else \
true; \
fi
-# This rule is used to configure the modules which are built with the
-# native tools.
-.PHONY: $(CONFIGURE_BUILD_MODULES)
-$(CONFIGURE_BUILD_MODULES):
- @dir=`echo $@ | sed -e 's/configure-build-//'`; \
+.PHONY: configure-build-libiberty
+configure-build-libiberty:
if [ ! -d $(BUILD_SUBDIR) ]; then \
true; \
- elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \
+ elif [ -f $(BUILD_SUBDIR)/libiberty/Makefile ] ; then \
true; \
- elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \
- if [ -d $(srcdir)/$${dir} ]; then \
- [ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\
+ elif echo " $(BUILD_CONFIGDIRS) " | grep " libiberty " >/dev/null 2>&1; then \
+ if [ -d $(srcdir)/libiberty ]; then \
+ [ -d $(BUILD_SUBDIR)/libiberty ] || mkdir $(BUILD_SUBDIR)/libiberty;\
r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \
AR="$(AR_FOR_BUILD)"; export AR; \
@@ -1603,8 +1600,8 @@
NM="$(NM_FOR_BUILD)"; export NM; \
RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
- echo Configuring in $(BUILD_SUBDIR)/$${dir}; \
- cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \
+ echo Configuring in $(BUILD_SUBDIR)/libiberty; \
+ cd "$(BUILD_SUBDIR)/libiberty" || exit 1; \
case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) \
topdir=$(srcdir) ;; \
@@ -1616,7 +1613,7 @@
esac; \
if [ "$(srcdir)" = "." ] ; then \
if [ "$(BUILD_SUBDIR)" != "." ] ; then \
- if $(SHELL) $$s/symlink-tree $${topdir}/$${dir} "no-such-file" ; then \
+ if $(SHELL) $$s/symlink-tree $${topdir}/libiberty "no-such-file" ; then \
if [ -f Makefile ]; then \
if $(MAKE) distclean; then \
true; \
@@ -1635,8 +1632,8 @@
srcdiroption="--srcdir=."; \
libsrcdir="."; \
else \
- srcdiroption="--srcdir=$${topdir}/$${dir}"; \
- libsrcdir="$$s/$${dir}"; \
+ srcdiroption="--srcdir=$${topdir}/libiberty"; \
+ libsrcdir="$$s/libiberty"; \
fi; \
if [ -f $${libsrcdir}/configure ] ; then \
rm -f no-such-file skip-this-dir; \
@@ -1652,7 +1649,7 @@
if [ -f skip-this-dir ] ; then \
sh skip-this-dir; \
rm -f skip-this-dir; \
- cd ..; rmdir $${dir} || true; \
+ cd ..; rmdir libiberty || true; \
else \
true; \
fi; \
@@ -1663,6 +1660,7 @@
true; \
fi
+
# This rule is used to build the modules which use FLAGS_TO_PASS. To
# build a target all-X means to cd to X and make all.
.PHONY: $(ALL_MODULES)