From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14457 invoked by alias); 13 Nov 2002 20:20:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 14053 invoked from network); 13 Nov 2002 20:20:51 -0000 Received: from unknown (HELO mailout6-0.nyroc.rr.com) (24.92.226.125) by sources.redhat.com with SMTP; 13 Nov 2002 20:20:51 -0000 Received: from doctormoo (syr-24-24-16-193.twcny.rr.com [24.24.16.193]) by mailout6-0.nyroc.rr.com (8.11.6/RoadRunner 1.20) with ESMTP id gADKKnk23291; Wed, 13 Nov 2002 15:20:49 -0500 (EST) Received: from neroden by doctormoo with local (Exim 3.36 #1 (Debian)) id 18C407-0005hP-00; Wed, 13 Nov 2002 15:20:39 -0500 Date: Wed, 13 Nov 2002 12:20:00 -0000 To: gcc-patches@gcc.gnu.org Cc: gdb-patches@sources.redhat.com, binutils@sources.redhat.com, dj@redhat.com Subject: Toplevel patch: Autogenerate Makefile targets 3 (*-build-*) Message-ID: <20021113202039.GA21907@doctormoo> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i From: Nathanael Nerode X-SW-Source: 2002-11/txt/msg00393.txt.bz2 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)