From: Stefano Lattarini Date: Wed, 28 Mar 2012 15:03:25 +0000 (+0200) Subject: maint: reduce use of recursion in automake build system X-Git-Tag: v1.11.4~2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=feeb7f6a910bdf9ede9d0cc6a69040a3eb6d30d8;p=thirdparty%2Fautomake.git maint: reduce use of recursion in automake build system Recursive make-based build systems tend to be slower, more fragile and less faithful than "flat" ones. See Peter Miller's article "Recursive Make Considered Harmful" for more a more in-depth discussion: While in the case of automake this isn't a big problem (given the small size of its build systems), it still creates occasional glitches and annoyances. So, with this change, we start making less use of make recursion in the Automake's own build system (future changes will reduce it even more). * lib/am/Makefile.am, lib/Automake/Makefile.am: Removed, their content merged ... * lib/Makefile.am: ... here, with required adjustments. * configure.ac (AC_CONFIG_FILES): Update. Signed-off-by: Stefano Lattarini --- diff --git a/configure.ac b/configure.ac index 18dbd8aa2..4b0be1b2e 100644 --- a/configure.ac +++ b/configure.ac @@ -208,9 +208,7 @@ AC_CONFIG_FILES([ Makefile contrib/Makefile doc/Makefile - lib/Automake/Makefile lib/Makefile - lib/am/Makefile m4/Makefile tests/Makefile tests/defs diff --git a/lib/Automake/Makefile.am b/lib/Automake/Makefile.am deleted file mode 100644 index ac9356a49..000000000 --- a/lib/Automake/Makefile.am +++ /dev/null @@ -1,69 +0,0 @@ -## Process this file with automake to create Makefile.in - -# Copyright (C) 2001, 2002, 2003, 2004, 2008, 2009, 2010, 2012 Free -# Software Foundation, Inc. - -# This program 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, or (at your option) -# any later version. - -# 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. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -perllibdir = $(pkgvdatadir)/Automake -dist_perllib_DATA = \ - ChannelDefs.pm \ - Channels.pm \ - Condition.pm \ - Configure_ac.pm \ - DisjConditions.pm \ - FileUtils.pm \ - General.pm \ - Getopt.pm \ - Item.pm \ - ItemDef.pm \ - Location.pm \ - Options.pm \ - Rule.pm \ - RuleDef.pm \ - Struct.pm \ - Variable.pm \ - VarDef.pm \ - Version.pm \ - XFile.pm \ - Wrap.pm - -nodist_perllib_DATA = \ - Config.pm - -CLEANFILES = $(nodist_perllib_DATA) - -## We can't use configure to do the substitution here; we must do it -## by hand. We use a funny notation here to avoid configure -## substitutions in our text. -do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \ - -e 's,[@]APIVERSION[@],$(APIVERSION),g' \ - -e 's,[@]PACKAGE[@],$(PACKAGE),g' \ - -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ - -e 's,[@]PERL[@],$(PERL),g' \ - -e 's,[@]PERL_THREADS[@],$(PERL_THREADS),g' \ - -e 's,[@]SHELL[@],$(SHELL),g' \ - -e 's,[@]VERSION[@],$(VERSION),g' \ - -e "s,[@]configure_input[@],Generated from $$in.in; do not edit by hand.,g" \ - -e 's,[@]datadir[@],$(datadir),g' - -## This file depends on Makefile so it is rebuilt if $(VERSION), -## $(datadir) or other do_subst'ituted variables change. -## Use chmod a-w to prevent people from editing the wrong file by accident. -Config.pm: Config.in Makefile - $(AM_V_at)rm -f $@ $@-t - $(AM_V_GEN)$(do_subst) $(srcdir)/Config.in >$@-t - $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@ - -EXTRA_DIST = Config.in diff --git a/lib/Makefile.am b/lib/Makefile.am index d9dabb6c5..d1800acdb 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -2,8 +2,7 @@ ## Makefile for Automake lib. -# Copyright (C) 2001, 2003, 2004, 2009, 2010 Free Software Foundation, -# Inc. +# Copyright (C) 2001-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,7 +17,11 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -SUBDIRS = Automake am +EXTRA_DIST = gnupload gitlog-to-changelog update-copyright + +## -------------------------------------------------------------------- ## +## Auxiliary scripts and files for use with "automake --add-missing". ## +## -------------------------------------------------------------------- ## dist_pkgvdata_DATA = COPYING INSTALL texinfo.tex ansi2knr.c ansi2knr.1 \ config-ml.in @@ -31,8 +34,6 @@ dist_script_DATA = config.guess config.sub install-sh mdate-sh missing \ mkinstalldirs elisp-comp ylwrap acinstall depcomp compile py-compile \ symlink-tree ar-lib -EXTRA_DIST = gnupload gitlog-to-changelog update-copyright - install-data-hook: @$(POST_INSTALL) @for prog in $(dist_script_DATA); do \ @@ -46,3 +47,107 @@ installcheck-local: for file in $(dist_script_DATA); do \ $(PERL) -e "exit ! -x '$(pkgvdatadir)/$$file';" || exit 1; \ done + +## ---------------------------------------------------- ## +## Private perl modules used by automake and aclocal. ## +## ---------------------------------------------------- ## + +perllibdir = $(pkgvdatadir)/Automake +dist_perllib_DATA = \ + Automake/ChannelDefs.pm \ + Automake/Channels.pm \ + Automake/Condition.pm \ + Automake/Configure_ac.pm \ + Automake/DisjConditions.pm \ + Automake/FileUtils.pm \ + Automake/General.pm \ + Automake/Getopt.pm \ + Automake/Item.pm \ + Automake/ItemDef.pm \ + Automake/Location.pm \ + Automake/Options.pm \ + Automake/Rule.pm \ + Automake/RuleDef.pm \ + Automake/Struct.pm \ + Automake/Variable.pm \ + Automake/VarDef.pm \ + Automake/Version.pm \ + Automake/XFile.pm \ + Automake/Wrap.pm + +nodist_perllib_DATA = Automake/Config.pm +CLEANFILES = $(nodist_perllib_DATA) + +## We can't use configure to do the substitution here; we must do it +## by hand. We use a funny notation here to avoid configure +## substitutions in our text. +do_subst = in=`echo $@ | sed 's/\.[^.]*$$//'`; sed \ + -e 's,[@]APIVERSION[@],$(APIVERSION),g' \ + -e 's,[@]PACKAGE[@],$(PACKAGE),g' \ + -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \ + -e 's,[@]PERL[@],$(PERL),g' \ + -e 's,[@]PERL_THREADS[@],$(PERL_THREADS),g' \ + -e 's,[@]SHELL[@],$(SHELL),g' \ + -e 's,[@]VERSION[@],$(VERSION),g' \ + -e "s,[@]configure_input[@],Generated from $$in.in; do not edit by hand.,g" \ + -e 's,[@]datadir[@],$(datadir),g' + +## This file depends on Makefile so it is rebuilt if $(VERSION), +## $(datadir) or other do_subst'ituted variables change. +## Use chmod a-w to prevent people from editing the wrong file by accident. +Automake/Config.pm: Automake/Config.in Makefile + $(AM_V_at)rm -f $@ $@-t + $(AM_V_at)test -d Automake || mkdir Automake + $(AM_V_GEN)$(do_subst) $(srcdir)/Automake/Config.in >$@-t + $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@ +EXTRA_DIST += Automake/Config.in + +## --------------------- ## +## Makefile fragments. ## +## --------------------- ## + +amdir = $(pkgvdatadir)/am + +dist_am_DATA = \ + am/ansi2knr.am \ + am/check.am \ + am/check-html.am \ + am/check2.am \ + am/clean-hdr.am \ + am/clean.am \ + am/compile.am \ + am/configure.am \ + am/data.am \ + am/dejagnu.am \ + am/depend.am \ + am/depend2.am \ + am/distdir.am \ + am/footer.am \ + am/header-vars.am \ + am/header.am \ + am/install.am \ + am/inst-vars.am \ + am/java.am \ + am/lang-compile.am \ + am/lex.am \ + am/library.am \ + am/libs.am \ + am/libtool.am \ + am/lisp.am \ + am/ltlib.am \ + am/ltlibrary.am \ + am/mans-vars.am \ + am/mans.am \ + am/multilib.am \ + am/program.am \ + am/progs.am \ + am/python.am \ + am/remake-hdr.am \ + am/scripts.am \ + am/subdirs.am \ + am/tags.am \ + am/texi-vers.am \ + am/texibuild.am \ + am/texinfos.am \ + am/vala.am \ + am/yacc.am diff --git a/lib/am/Makefile.am b/lib/am/Makefile.am deleted file mode 100644 index 7b37989db..000000000 --- a/lib/am/Makefile.am +++ /dev/null @@ -1,65 +0,0 @@ -## Process this file with automake to create Makefile.in - -## Makefile for Automake lib/am. - -# Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2003, 2004, 2008, -# 2009, 2012 Free Software Foundation, Inc. - -# This program 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, or (at your option) -# any later version. - -# 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. - -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -amdir = $(pkgvdatadir)/am - -dist_am_DATA = \ -ansi2knr.am \ -check.am \ -check-html.am \ -check2.am \ -clean-hdr.am \ -clean.am \ -compile.am \ -configure.am \ -data.am \ -dejagnu.am \ -depend.am \ -depend2.am \ -distdir.am \ -footer.am \ -header-vars.am \ -header.am \ -install.am \ -inst-vars.am \ -java.am \ -lang-compile.am \ -lex.am \ -library.am \ -libs.am \ -libtool.am \ -lisp.am \ -ltlib.am \ -ltlibrary.am \ -mans-vars.am \ -mans.am \ -multilib.am \ -program.am \ -progs.am \ -python.am \ -remake-hdr.am \ -scripts.am \ -subdirs.am \ -tags.am \ -texi-vers.am \ -texibuild.am \ -texinfos.am \ -vala.am \ -yacc.am