2002-12-01 Nathanael Nerode <neroden@gcc.gnu.org>

(Continuing slow-motion replay)
	* Makefile.def: Add list of recursive targets to autogenerate.
	Add build_modules.
	* Makefile.tpl: Autogenerate do-* targets.  Autogenerate *-target-*
	targets.  Autogenerate *-build-* targets.
	* Makefile.in: Regenerate.
This commit is contained in:
Nathanael Nerode 2002-12-01 11:32:58 +00:00
parent 4f96ae699c
commit d6ebd41978
4 changed files with 2642 additions and 176 deletions

View File

@ -1,3 +1,12 @@
2002-12-01 Nathanael Nerode <neroden@gcc.gnu.org>
(Continuing slow-motion replay)
* Makefile.def: Add list of recursive targets to autogenerate.
Add build_modules.
* Makefile.tpl: Autogenerate do-* targets. Autogenerate *-target-*
targets. Autogenerate *-build-* targets.
* Makefile.in: Regenerate.
2002-11-30 Nathanael Nerode <neroden@gcc.gnu.org> 2002-11-30 Nathanael Nerode <neroden@gcc.gnu.org>
(Continuing slow-motion replay) (Continuing slow-motion replay)

View File

@ -1,6 +1,8 @@
#! /usr/bin/autogen #! /usr/bin/autogen
AutoGen definitions Makefile.tpl; AutoGen definitions Makefile.tpl;
build_modules= { module= libiberty; };
host_modules= { module= ash; }; host_modules= { module= ash; };
host_modules= { module= autoconf; }; host_modules= { module= autoconf; };
host_modules= { module= automake; }; host_modules= { module= automake; };
@ -85,3 +87,15 @@ target_modules = { module= zlib; };
target_modules = { module= boehm-gc; }; target_modules = { module= boehm-gc; };
target_modules = { module= qthreads; }; target_modules = { module= qthreads; };
target_modules = { module= rda; }; target_modules = { module= rda; };
// These are (some of) the targets to be done in each subdirectory.
// Not all; these are the ones which don't have special options.
recursive_targets = { target= clean; };
recursive_targets = { target= distclean; };
recursive_targets = { target= dvi; };
recursive_targets = { target= info; };
recursive_targets = { target= install-info; };
recursive_targets = { target= installcheck; };
recursive_targets = { target= mostlyclean; };
recursive_targets = { target= maintainer-clean; };
recursive_targets = { target= TAGS; };

File diff suppressed because it is too large Load Diff

View File

@ -652,20 +652,10 @@ all.normal: \
# This target ensures that $(BASE_FLAGS_TO_PASS) appears only once, # This target ensures that $(BASE_FLAGS_TO_PASS) appears only once,
# because it is so large that it can easily overflow the command line # because it is so large that it can easily overflow the command line
# length limit on some systems. # length limit on some systems.
DO_X = \ [+ FOR recursive_targets +]
do-clean \ .PHONY: do-[+target+]
do-distclean \ do-[+target+]:
do-dvi \ @r=`${PWD}`; export r; \
do-info \
do-install-info \
do-installcheck \
do-mostlyclean \
do-maintainer-clean \
do-TAGS
.PHONY: $(DO_X)
$(DO_X):
@target=`echo $@ | sed -e 's/^do-//'`; \
r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
for i in $(SUBDIRS) -dummy-; do \ for i in $(SUBDIRS) -dummy-; do \
@ -687,11 +677,11 @@ $(DO_X):
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
$${target}); \ [+target+]); \
then true; else exit 1; fi; \ then true; else exit 1; fi; \
else true; fi; \ else true; fi; \
done done
@target=`echo $@ | sed -e 's/^do-//'`; \ # Break into two pieces
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
@ -705,10 +695,12 @@ $(DO_X):
"CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \ "CC=$${CC}" "CXX=$${CXX}" "LD=$${LD}" "NM=$${NM}" \
"`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \ "`echo \"RANLIB=$${RANLIB}\" | sed -e 's/.*=$$/XFOO=/'`" \
"DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \ "DLLTOOL=$${DLLTOOL}" "WINDRES=$${WINDRES}" \
$${target}); \ [+target+]); \
then true; else exit 1; fi; \ then true; else exit 1; fi; \
else true; fi; \ else true; fi; \
done done
[+ ENDFOR recursive_targets +]
# Here are the targets which correspond to the do-X targets. # Here are the targets which correspond to the do-X targets.
@ -884,31 +876,28 @@ gcc-no-fixedincludes:
mv gcc/tmp-include gcc/include 2>/dev/null; \ mv gcc/tmp-include gcc/include 2>/dev/null; \
else true; fi 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. # build machine's native compiler.
.PHONY: $(ALL_BUILD_MODULES) [+ FOR build_modules +]
$(ALL_BUILD_MODULES): .PHONY: all-build-[+module+]
dir=`echo $@ | sed -e 's/all-build-//'`; \ all-build-[+module+]:
if [ -f ./$${dir}/Makefile ] ; then \ @if [ -f ./[+module+]/Makefile ] ; then \
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
(cd $(BUILD_SUBDIR)/$${dir} && $(MAKE) all); \ (cd $(BUILD_SUBDIR)/[+module+] && $(MAKE) all); \
else \ else \
true; \ true; \
fi fi
# This rule is used to configure the modules which are built with the .PHONY: configure-build-[+module+]
# native tools. configure-build-[+module+]:
.PHONY: $(CONFIGURE_BUILD_MODULES) @if [ ! -d $(BUILD_SUBDIR) ]; then \
$(CONFIGURE_BUILD_MODULES):
@dir=`echo $@ | sed -e 's/configure-build-//'`; \
if [ ! -d $(BUILD_SUBDIR) ]; then \
true; \ true; \
elif [ -f $(BUILD_SUBDIR)/$${dir}/Makefile ] ; then \ elif [ -f $(BUILD_SUBDIR)/[+module+]/Makefile ] ; then \
true; \ true; \
elif echo " $(BUILD_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ elif echo " $(BUILD_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
if [ -d $(srcdir)/$${dir} ]; then \ if [ -d $(srcdir)/[+module+] ]; then \
[ -d $(BUILD_SUBDIR)/$${dir} ] || mkdir $(BUILD_SUBDIR)/$${dir};\ [ -d $(BUILD_SUBDIR)/[+module+] ] || mkdir $(BUILD_SUBDIR)/[+module+];\
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
AR="$(AR_FOR_BUILD)"; export AR; \ AR="$(AR_FOR_BUILD)"; export AR; \
@ -924,8 +913,8 @@ $(CONFIGURE_BUILD_MODULES):
NM="$(NM_FOR_BUILD)"; export NM; \ NM="$(NM_FOR_BUILD)"; export NM; \
RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \ RANLIB="$(RANLIB_FOR_BUILD)"; export RANLIB; \
WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \ WINDRES="$(WINDRES_FOR_BUILD)"; export WINDRES; \
echo Configuring in $(BUILD_SUBDIR)/$${dir}; \ echo Configuring in $(BUILD_SUBDIR)/[+module+]; \
cd "$(BUILD_SUBDIR)/$${dir}" || exit 1; \ cd "$(BUILD_SUBDIR)/[+module+]" || exit 1; \
case $(srcdir) in \ case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) \ /* | [A-Za-z]:[\\/]*) \
topdir=$(srcdir) ;; \ topdir=$(srcdir) ;; \
@ -937,7 +926,7 @@ $(CONFIGURE_BUILD_MODULES):
esac; \ esac; \
if [ "$(srcdir)" = "." ] ; then \ if [ "$(srcdir)" = "." ] ; then \
if [ "$(BUILD_SUBDIR)" != "." ] ; 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 [ -f Makefile ]; then \
if $(MAKE) distclean; then \ if $(MAKE) distclean; then \
true; \ true; \
@ -956,8 +945,8 @@ $(CONFIGURE_BUILD_MODULES):
srcdiroption="--srcdir=."; \ srcdiroption="--srcdir=."; \
libsrcdir="."; \ libsrcdir="."; \
else \ else \
srcdiroption="--srcdir=$${topdir}/$${dir}"; \ srcdiroption="--srcdir=$${topdir}/[+module+]"; \
libsrcdir="$$s/$${dir}"; \ libsrcdir="$$s/[+module+]"; \
fi; \ fi; \
if [ -f $${libsrcdir}/configure ] ; then \ if [ -f $${libsrcdir}/configure ] ; then \
rm -f no-such-file skip-this-dir; \ rm -f no-such-file skip-this-dir; \
@ -973,7 +962,7 @@ $(CONFIGURE_BUILD_MODULES):
if [ -f skip-this-dir ] ; then \ if [ -f skip-this-dir ] ; then \
sh skip-this-dir; \ sh skip-this-dir; \
rm -f skip-this-dir; \ rm -f skip-this-dir; \
cd ..; rmdir $${dir} || true; \ cd ..; rmdir [+module+] || true; \
else \ else \
true; \ true; \
fi; \ fi; \
@ -983,6 +972,7 @@ $(CONFIGURE_BUILD_MODULES):
else \ else \
true; \ true; \
fi fi
[+ ENDFOR build_modules +]
# This rule is used to build the modules which use FLAGS_TO_PASS. To # 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. # build a target all-X means to cd to X and make all.
@ -1041,36 +1031,36 @@ $(INSTALL_MODULES): installdirs
true; \ true; \
fi fi
# This rule is used to configure the modules which are built with the # These rules are used to build the modules which are built with the target
# target tools. # tools. To make foo-X means to cd to X and make foo.
.PHONY: $(CONFIGURE_TARGET_MODULES) [+ FOR target_modules +]
$(CONFIGURE_TARGET_MODULES): .PHONY: configure-target-[+module+]
@dir=`echo $@ | sed -e 's/configure-target-//'`; \ configure-target-[+module+]:
if [ -d $(TARGET_SUBDIR)/$${dir} ]; then \ @if [ -d $(TARGET_SUBDIR)/[+module+] ]; then \
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/$${dir}/tmpmulti.out 2> /dev/null; \ $(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/[+module+]/tmpmulti.out 2> /dev/null; \
if [ -s $(TARGET_SUBDIR)/$${dir}/tmpmulti.out ]; then \ if [ -s $(TARGET_SUBDIR)/[+module+]/tmpmulti.out ]; then \
if [ -f $(TARGET_SUBDIR)/$${dir}/multilib.out ]; then \ if [ -f $(TARGET_SUBDIR)/[+module+]/multilib.out ]; then \
if cmp $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/tmpmulti.out > /dev/null; then \ if cmp $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/tmpmulti.out > /dev/null; then \
rm -f $(TARGET_SUBDIR)/$${dir}/tmpmulti.out; \ rm -f $(TARGET_SUBDIR)/[+module+]/tmpmulti.out; \
else \ else \
echo "Multilibs changed for $${dir}, reconfiguring"; \ echo "Multilibs changed for [+module+], reconfiguring"; \
rm -f $(TARGET_SUBDIR)/$${dir}/multilib.out $(TARGET_SUBDIR)/$${dir}/Makefile; \ rm -f $(TARGET_SUBDIR)/[+module+]/multilib.out $(TARGET_SUBDIR)/[+module+]/Makefile; \
mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \ mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
fi; \ fi; \
else \ else \
mv $(TARGET_SUBDIR)/$${dir}/tmpmulti.out $(TARGET_SUBDIR)/$${dir}/multilib.out; \ mv $(TARGET_SUBDIR)/[+module+]/tmpmulti.out $(TARGET_SUBDIR)/[+module+]/multilib.out; \
fi; \ fi; \
fi; \ fi; \
fi; exit 0 # break command into two pieces fi; exit 0 # break command into two pieces
@dir=`echo $@ | sed -e 's/configure-target-//'`; \ @dir=[+module+] ; \
if [ ! -d $(TARGET_SUBDIR) ]; then \ if [ ! -d $(TARGET_SUBDIR) ]; then \
true; \ true; \
elif [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \ elif [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
true; \ true; \
elif echo " $(TARGET_CONFIGDIRS) " | grep " $${dir} " >/dev/null 2>&1; then \ elif echo " $(TARGET_CONFIGDIRS) " | grep " [+module+] " >/dev/null 2>&1; then \
if [ -d $(srcdir)/$${dir} ]; then \ if [ -d $(srcdir)/[+module+] ]; then \
[ -d $(TARGET_SUBDIR)/$${dir} ] || mkdir $(TARGET_SUBDIR)/$${dir};\ [ -d $(TARGET_SUBDIR)/[+module+] ] || mkdir $(TARGET_SUBDIR)/[+module+];\
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
@ -1087,8 +1077,8 @@ $(CONFIGURE_TARGET_MODULES):
NM="$(NM_FOR_TARGET)"; export NM; \ NM="$(NM_FOR_TARGET)"; export NM; \
RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \ RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \ WINDRES="$(WINDRES_FOR_TARGET)"; export WINDRES; \
echo Configuring in $(TARGET_SUBDIR)/$${dir}; \ echo Configuring in $(TARGET_SUBDIR)/[+module+]; \
cd "$(TARGET_SUBDIR)/$${dir}" || exit 1; \ cd "$(TARGET_SUBDIR)/[+module+]" || exit 1; \
case $(srcdir) in \ case $(srcdir) in \
/* | [A-Za-z]:[\\/]*) \ /* | [A-Za-z]:[\\/]*) \
topdir=$(srcdir) ;; \ topdir=$(srcdir) ;; \
@ -1100,7 +1090,7 @@ $(CONFIGURE_TARGET_MODULES):
esac; \ esac; \
if [ "$(srcdir)" = "." ] ; then \ if [ "$(srcdir)" = "." ] ; then \
if [ "$(TARGET_SUBDIR)" != "." ] ; then \ if [ "$(TARGET_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 [ -f Makefile ]; then \
if $(MAKE) distclean; then \ if $(MAKE) distclean; then \
true; \ true; \
@ -1119,8 +1109,8 @@ $(CONFIGURE_TARGET_MODULES):
srcdiroption="--srcdir=."; \ srcdiroption="--srcdir=."; \
libsrcdir="."; \ libsrcdir="."; \
else \ else \
srcdiroption="--srcdir=$${topdir}/$${dir}"; \ srcdiroption="--srcdir=$${topdir}/[+module+]"; \
libsrcdir="$$s/$${dir}"; \ libsrcdir="$$s/[+module+]"; \
fi; \ fi; \
if [ -f $${libsrcdir}/configure ] ; then \ if [ -f $${libsrcdir}/configure ] ; then \
rm -f no-such-file skip-this-dir; \ rm -f no-such-file skip-this-dir; \
@ -1136,7 +1126,7 @@ $(CONFIGURE_TARGET_MODULES):
if [ -f skip-this-dir ] ; then \ if [ -f skip-this-dir ] ; then \
sh skip-this-dir; \ sh skip-this-dir; \
rm -f skip-this-dir; \ rm -f skip-this-dir; \
cd ..; rmdir $${dir} || true; \ cd ..; rmdir [+module+] || true; \
else \ else \
true; \ true; \
fi; \ fi; \
@ -1147,51 +1137,47 @@ $(CONFIGURE_TARGET_MODULES):
true; \ true; \
fi fi
# This rule is used to build the modules which use TARGET_FLAGS_TO_PASS. .PHONY: all-target-[+module+]
# To build a target all-X means to cd to X and make all. all-target-[+module+]:
.PHONY: $(ALL_TARGET_MODULES) @dir=[+module+] ; \
$(ALL_TARGET_MODULES): if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
@dir=`echo $@ | sed -e 's/all-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir}; \ (cd $(TARGET_SUBDIR)/[+module+]; \
$(MAKE) $(TARGET_FLAGS_TO_PASS) all); \ $(MAKE) $(TARGET_FLAGS_TO_PASS) all); \
else \ else \
true; \ true; \
fi fi
[+ IF no_check +][+ ELSE check +]
# This rule is used to check the modules which use TARGET_FLAGS_TO_PASS. .PHONY: check-target-[+module+]
# To build a target install-X means to cd to X and make install. check-target-[+module+]:
.PHONY: $(CHECK_TARGET_MODULES) @dir=[+module+] ; \
$(CHECK_TARGET_MODULES): if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
@dir=`echo $@ | sed -e 's/check-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir}; \ (cd $(TARGET_SUBDIR)/[+module+]; \
$(MAKE) $(TARGET_FLAGS_TO_PASS) check);\ $(MAKE) $(TARGET_FLAGS_TO_PASS) check);\
else \ else \
true; \ true; \
fi fi
[+ ENDIF no_check +]
# This rule is used to install the modules which use [+ IF no_install +][+ ELSE install +]\
# TARGET_FLAGS_TO_PASS. To build a target install-X means to cd to X .PHONY: install-target-[+module+]
# and make install. install-target-[+module+]: installdirs
.PHONY: $(INSTALL_TARGET_MODULES) @dir=[+module+] ; \
$(INSTALL_TARGET_MODULES): installdirs if [ -f $(TARGET_SUBDIR)/[+module+]/Makefile ] ; then \
@dir=`echo $@ | sed -e 's/install-target-//'`; \
if [ -f $(TARGET_SUBDIR)/$${dir}/Makefile ] ; then \
r=`${PWD}`; export r; \ r=`${PWD}`; export r; \
s=`cd $(srcdir); ${PWD}`; export s; \ s=`cd $(srcdir); ${PWD}`; export s; \
$(SET_LIB_PATH) \ $(SET_LIB_PATH) \
(cd $(TARGET_SUBDIR)/$${dir}; \ (cd $(TARGET_SUBDIR)/[+module+]; \
$(MAKE) $(TARGET_FLAGS_TO_PASS) install); \ $(MAKE) $(TARGET_FLAGS_TO_PASS) install); \
else \ else \
true; \ true; \
fi fi
[+ ENDIF no_install +]
[+ ENDFOR target_modules +]
# This rule is used to build the modules which use X11_FLAGS_TO_PASS. # This rule is used to build the modules which use X11_FLAGS_TO_PASS.
# To build a target all-X means to cd to X and make all. # To build a target all-X means to cd to X and make all.