automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, ng/master, updated. v1.12.1-363-g67d6546
Date: Fri, 15 Jun 2012 13:19:28 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=67d6546ecf236c5ec1e20edde3c16c13b1726169

The branch, ng/master has been updated
       via  67d6546ecf236c5ec1e20edde3c16c13b1726169 (commit)
       via  3e567cbffd187ccca1dfa119d269d20872dff68b (commit)
      from  25dbac9492dfd103c8e8c82b452a89ea1e8908eb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 67d6546ecf236c5ec1e20edde3c16c13b1726169
Author: Stefano Lattarini <address@hidden>
Date:   Sun May 6 22:54:45 2012 +0200

    [ng] all, check, install: move more processing at make runtime
    
    A welcome collateral effect of this change is that now the 'check-local',
    'all-local' and 'installdirs-local' targets can also be defined in
    wrapper Makefiles or in Makefile fragments only included at make (not
    automake) runtime, without their definition ever having to be seen by
    Automake.
    
    * lib/am/all-target.am: New file, implementing the 'all' target.
    * lib/am/check-target.am: New file, implementing the 'check' target.
    * automake.in (handle_install): Adjust by processing it simply with
    '&preprocess_file', and placing its content in '$output_verbatim'
    rather than in '$output_rules'.
    (handle_all, )
    * lib/am/install.am: Largely rewritten to rely on GNU make runtime
    capabilities rather than on automake-runtime preprocessing.
    * automake.in (handle_install): Adjust by processing it simply with
    '&preprocess_file', and placing its content in '$output_verbatim'
    rather than in '$output_rules'.
    * automake.in (handle_all, do_check_merge_target): Merged into ...
    (handle_all_and_check): ... this, and largely rewritten to rely
    on the new 'lib/am/{all,check}-target.am' files.
    (generate_makefile): Adjust.
    * Makefile.am (dist_am_DATA): Add the new '.am' files.
    (XFAIL_TESTS): Add test 't/override-suggest-local.sh', that has been
    broken by this change (we consider this an acceptable trade-off).
    * doc/automake-ng.texi: Remove reference to removed test.
    * lib/am/header-vars.am: Sanitize $(SUBDIRS), by setting it to the
    empty value if it is not set, but not from the Makefile not any
    command-line override.
    * t/built-sources-check.sh: Remove obsolete grepping checks.
    * t/remake-all-1.sh: Likewise.
    * t/bsource.sh: Adjust and enhance.
    * t/check.sh: Remove as basically obsolete.
    * t/check2.sh: Relax grepping checks.
    * t/doc-parsing-buglets-tabs.sh: Remove as too brittle.
    * t/local-targets.sh: New test.
    * t/tap-diagnostic.sh: Fix grepping of "make check" stdout to avoid
    spurious errors.
    * t/phony.sh: Tweak, to avoid spurious failure.
    * t/vartar.sh: Likewise.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 3e567cbffd187ccca1dfa119d269d20872dff68b
Author: Stefano Lattarini <address@hidden>
Date:   Sun May 6 20:59:28 2012 +0200

    [ng] built sources: enhance testsuite coverage
    
    This will be useful to better check the correctness of later changes.
    
    * t/built-sources.sh: New test, checks basic functionality for
    BUILT_SOURCES.
    * t/built-sources.sh: New test, checks basic interaction between
    BUILT_SOURCES and Automake conditionals.
    * t/check3.sh: Split this out ...
    * t/built-sources-check.sh, t/built-sources-install.sh: ... into
    these tests, to offer more granularity and make the purpose of the
    tests immediately clear from their names.
    * t/subdirbuiltsources.sh: Rename this ...
    * t/built-sources-subdir.sh: ... to this, for consistency.  Since
    we are at it, fix a couple of typos and remove redundant stuff.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 Makefile.am                                        |    3 +
 automake.in                                        |  115 +++-----------------
 doc/automake-ng.texi                               |    1 -
 lib/am/{lang-compile.am => all-target.am}          |   35 +++----
 lib/am/check-target.am                             |   38 +++++++
 lib/am/header-vars.am                              |   10 ++
 lib/am/install.am                                  |   80 +++++++-------
 t/bsource.sh                                       |   10 ++-
 t/{check3.sh => built-sources-check.sh}            |   16 +---
 t/{alpha2.sh => built-sources-cond.sh}             |   94 +++++++++++------
 t/{check3.sh => built-sources-install.sh}          |   61 +++++------
 ...bdirbuiltsources.sh => built-sources-subdir.sh} |   19 +---
 t/{libobj10.sh => built-sources.sh}                |   48 +++++----
 t/check.sh                                         |   41 -------
 t/check2.sh                                        |    6 +-
 t/doc-parsing-buglets-tabs.sh                      |   59 ----------
 t/{suffix5.sh => local-targets.sh}                 |   59 +++++------
 t/phony.sh                                         |    2 +-
 t/remake-all-1.sh                                  |    4 +-
 t/tap-diagnostic.sh                                |    4 +-
 t/vartar.sh                                        |   14 ++--
 21 files changed, 296 insertions(+), 423 deletions(-)
 copy lib/am/{lang-compile.am => all-target.am} (56%)
 create mode 100644 lib/am/check-target.am
 copy t/{check3.sh => built-sources-check.sh} (77%)
 copy t/{alpha2.sh => built-sources-cond.sh} (50%)
 rename t/{check3.sh => built-sources-install.sh} (52%)
 rename t/{subdirbuiltsources.sh => built-sources-subdir.sh} (76%)
 copy t/{libobj10.sh => built-sources.sh} (53%)
 delete mode 100755 t/check.sh
 delete mode 100755 t/doc-parsing-buglets-tabs.sh
 copy t/{suffix5.sh => local-targets.sh} (50%)

diff --git a/Makefile.am b/Makefile.am
index 09ecc3f..c072b3f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -185,6 +185,8 @@ EXTRA_DIST += lib/Automake/Config.in
 ## --------------------- ##
 
 dist_am_DATA = \
+  lib/am/all-target.am \
+  lib/am/check-target.am \
   lib/am/serial-tests.am \
   lib/am/parallel-tests.am \
   lib/am/check-typos.am \
@@ -333,6 +335,7 @@ perl_fake_XFAIL_TESTS = \
 
 XFAIL_TESTS = \
   t/all.sh \
+  t/override-suggest-local.sh \
   t/yacc-bison-skeleton-cxx.sh \
   t/yacc-bison-skeleton.sh \
   t/comments-in-var-def.sh \
diff --git a/automake.in b/automake.in
index 7080132..c5912aa 100644
--- a/automake.in
+++ b/automake.in
@@ -4139,110 +4139,27 @@ sub handle_footer
 # Generate 'make install' rules.
 sub handle_install ()
 {
-  $output_rules .= &file_contents
-    ('install',
-     new Automake::Location,
-     maybe_BUILT_SOURCES => (set_seen ('BUILT_SOURCES')
-                            ? (" \$(BUILT_SOURCES)\n"
-                               . "\t\$(MAKE)")
-                            : ''),
-     'installdirs-local' => (user_phony_rule 'installdirs-local'
-                            ? ' installdirs-local' : ''),
-     am__installdirs => variable_value ('am__installdirs') || '');
+  $output_verbatim .= preprocess_file ("$libdir/am/install.am");
 }
 
-
-# Deal with all and all-am.
-sub handle_all ($)
+# Generate "make all" and "make check" rules.
+sub handle_all_and_check ()
 {
-    my ($makefile) = @_;
-
-    # Output 'all-am'.
-
-    # Put this at the beginning for the sake of non-GNU makes.  This
-    # is still wrong if these makes can run parallel jobs.  But it is
-    # right enough.
-    unshift (@all, basename ($makefile));
-
-    foreach my $spec (@config_headers)
-      {
-       my ($out, @ins) = split_config_file_spec ($spec);
-       push (@all, basename ($out))
-         if dirname ($out) eq $relative_dir;
-      }
-
-    # Install 'all' hooks.
-    push (@all, "all-local")
-      if user_phony_rule "all-local";
-
-    &pretty_print_rule ("all-am:", "\t\t", @all);
-    &depend ('.PHONY', 'all-am', 'all');
-
-
-    # Output 'all'.
-
-    my @local_headers = ();
-    push @local_headers, '$(BUILT_SOURCES)'
-      if var ('BUILT_SOURCES');
-    foreach my $spec (@config_headers)
-      {
-       my ($out, @ins) = split_config_file_spec ($spec);
-       push @local_headers, basename ($out)
-         if dirname ($out) eq $relative_dir;
-      }
-
-    if (@local_headers)
-      {
-       # We need to make sure config.h is built before we recurse.
-       # We also want to make sure that built sources are built
-       # before any ordinary 'all' targets are run.  We can't do this
-       # by changing the order of dependencies to the "all" because
-       # that breaks when using parallel makes.  Instead we handle
-       # things explicitly.
-        $output_rules .= ("all: @local_headers"
-                          . "\n\t\$(MAKE) "
-                          . (var ('SUBDIRS') ? 'all-recursive' : 'all-am')
-                          . "\n\n");
-      }
-    else
-      {
-        $output_rules .= "all: " . (var ('SUBDIRS')
-                                    ? 'all-recursive' : 'all-am') . "\n\n";
-      }
-}
-
-
-# &do_check_merge_target ()
-# -------------------------
-# Handle check merge target specially.
-sub do_check_merge_target ()
-{
-  # Include user-defined local form of target.
-  push @check_tests, 'check-local'
-    if user_phony_rule 'check-local';
-
-  # The check target must depend on the local equivalent of
-  # 'all', to ensure all the primary targets are built.  Then it
-  # must build the local check rules.
-  $output_rules .= "check-am: all-am\n";
-  if (@check)
+  my @local_headers = ();
+  foreach my $spec (@config_headers)
     {
-      pretty_print_rule ("\t\$(MAKE)", "\t  ", @check);
+      my ($out, @ins) = split_config_file_spec ($spec);
+      push (@local_headers, basename ($out))
+        if dirname ($out) eq $relative_dir;
     }
 
-  if (@check_tests)
-    {
-      pretty_print_rule ("\t\$(MAKE)", "\t  ", @check_tests);
-    }
+  $output_verbatim .= preprocess_file ("$libdir/am/all-target.am",
+                                       'ALL-DEPS' => "@all",
+                                       'LOCAL-HEADERS' => "@local_headers");
 
-  depend '.PHONY', 'check', 'check-am';
-  # Handle recursion.  We have to honor BUILT_SOURCES like for 'all:'.
-  $output_rules .= ("check: "
-                   . (var ('BUILT_SOURCES')
-                      ? "\$(BUILT_SOURCES)\n\t\$(MAKE) "
-                      : '')
-                   . (var ('SUBDIRS') ? 'check-recursive' : 'check-am')
-                   . "\n");
+  $output_verbatim .= preprocess_file ("$libdir/am/check-target.am",
+                                       'CHECK-DEPS' => "@check",
+                                       'CHECK-TESTS' => "@check_tests");
 }
 
 # handle_clean ($MAKEFILE)
@@ -7254,8 +7171,8 @@ sub generate_makefile ($$)
   handle_dist;
 
   handle_footer;
-  do_check_merge_target;
-  handle_all ($makefile);
+  # Special targets "all" and "check".
+  handle_all_and_check;
 
   # FIXME: Gross!
   if (var ('lib_LTLIBRARIES') && var ('bin_PROGRAMS'))
diff --git a/doc/automake-ng.texi b/doc/automake-ng.texi
index b446fee..558ad0a 100644
--- a/doc/automake-ng.texi
+++ b/doc/automake-ng.texi
@@ -1836,7 +1836,6 @@ variable definitions.
 Generally, Automake is not particularly smart in the parsing of unusual
 Makefile constructs, so you're advised to avoid fancy constructs or
 ``creative'' use of whitespaces.
address@hidden Keep this in sync with doc-parsing-buglets-tabs.sh
 For example, @key{TAB} characters cannot be used between a target name
 and the following address@hidden:}'' character, and variable assignments
 shouldn't be indented with @key{TAB} characters.
diff --git a/lib/am/lang-compile.am b/lib/am/all-target.am
similarity index 56%
copy from lib/am/lang-compile.am
copy to lib/am/all-target.am
index b974197..25b075a 100644
--- a/lib/am/lang-compile.am
+++ b/lib/am/all-target.am
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001-2012 Free Software Foundation, Inc.
+## Copyright (C) 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
@@ -14,24 +14,21 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-## This file is read once per *language*, not per extension.
+## The 'all' target.
 
-## ------------------------- ##
-## Preprocessed Fortran 77.  ##
-## ------------------------- ##
+.PHONY: all all-am all-local
+ifdef SUBDIRS
+.PHONY: all-recursive
+endif
 
-## We also handle the case of preprocessing '.F' files into '.f' files.
-if %?PPF77%
-%.f: %.F
-       $(F77COMPILE) -F $<
-endif %?PPF77%
+all-am: all-local %ALL-DEPS%
 
-## -------- ##
-## Ratfor.  ##
-## -------- ##
-
-## We also handle the case of preprocessing '.r' files into '.f' files.
-if %?RATFOR%
-%.f: %.r
-       $(RCOMPILE) -F $<
-endif %?RATFOR%
+# We need to make sure config.h is built before we recurse.
+# We also want to make sure that built sources are built
+# before any ordinary 'all' targets are run.
+ifeq ($(strip %LOCAL-HEADERS% $(BUILT_SOURCES)),)
+all: $(if $(SUBDIRS),all-recursive,all-am)
+else
+all: %LOCAL-HEADERS% $(BUILT_SOURCES)
+       $(MAKE) $(if $(SUBDIRS),all-recursive,all-am)
+endif
diff --git a/lib/am/check-target.am b/lib/am/check-target.am
new file mode 100644
index 0000000..cc3d25d
--- /dev/null
+++ b/lib/am/check-target.am
@@ -0,0 +1,38 @@
+## automake - create Makefile.in from Makefile.am
+## Copyright (C) 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 <http://www.gnu.org/licenses/>.
+
+## The 'check' target.
+
+.PHONY: check check-am check-local
+ifdef SUBDIRS
+.PHONY: check-recursive
+endif
+
+# The check target must depend on the local equivalent of 'all', to
+# ensure all the primary targets are built; then it must build the
+# local check dependencies, and finally run the actual tests (as given
+# by $(TESTS), by DejaGNU, and by the 'check-local' target).
+check-am: all-am
+       $(if %CHECK-DEPS%,$(MAKE) %CHECK-DEPS%,@:)
+       $(MAKE) %CHECK-TESTS% check-local
+
+# Handle recursion.  We have to honor BUILT_SOURCES like for 'all:'.
+ifdef BUILT_SOURCES
+check: $(BUILT_SOURCES)
+       $(MAKE) $(if $(SUBDIRS),check-recursive,check-am)
+else
+check: $(if $(SUBDIRS),check-recursive,check-am)
+endif
diff --git a/lib/am/header-vars.am b/lib/am/header-vars.am
index 74870c6..c4f14d0 100644
--- a/lib/am/header-vars.am
+++ b/lib/am/header-vars.am
@@ -50,6 +50,16 @@ ifndef .FEATURES
   $(error Automake-NG based builds require GNU make 3.81 or later)
 endif
 
+## Neutralize unwarranted environment settings that might interfere with
+## our Makefiles.
+ifdef SUBDIRS
+  ifneq "$(origin SUBDIRS)" "file"
+    ifneq "$(origin SUBDIRS)" "command line"
+      SUBDIRS :=
+    endif
+  endif
+endif
+
 am__mkdir = test -d $1 || $(MKDIR_P) $1
 
 # In a recipe, ensure the given directory exists, creating it if
diff --git a/lib/am/install.am b/lib/am/install.am
index ec7aa52..80af8a1 100644
--- a/lib/am/install.am
+++ b/lib/am/install.am
@@ -18,28 +18,24 @@
 ## installdirs -- Creating the installdirs.  ##
 ## ----------------------------------------- ##
 
-## The reason we loop over %am__installdirs% (instead of simply running
-## $(MKDIR_P) %am__installdirs%) is that directories variable such as
-## "$(DESTDIR)$(mydir)" can potentially expand to "" if $(mydir) is
-## conditionally defined.  BTW, those directories are quoted in order
-## to support installation paths with spaces.
-
-if %?SUBDIRS%
-.PHONY: installdirs installdirs-am
+.PHONY: installdirs installdirs-local
+ifdef SUBDIRS
+.PHONY: installdirs-am
 RECURSIVE_TARGETS += installdirs-recursive
 installdirs: installdirs-recursive
-installdirs-am:%installdirs-local%
-?am__installdirs?      for dir in %am__installdirs%; do \
-?am__installdirs?        test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-?am__installdirs?      done
-else !%?SUBDIRS%
-.PHONY: installdirs
-installdirs:%installdirs-local%
-?am__installdirs?      for dir in %am__installdirs%; do \
-?am__installdirs?        test -z "$$dir" || $(MKDIR_P) "$$dir"; \
-?am__installdirs?      done
-endif !%?SUBDIRS%
+endif
 
+$(if $(SUBDIRS),installdirs-am,installdirs): installdirs-local
+ifdef am__installdirs
+## The reason we loop over $(am__installdirs), instead of simply running
+## "$(MKDIR_P) $(am__installdirs), is that directories variable such as
+## "$(DESTDIR)$(mydir)" can potentially expand to "" if $(mydir) is
+## conditionally defined.  BTW, those directories are quoted in order
+## to support installation paths with spaces.
+       for dir in $(am__installdirs); do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+endif
 
 ## ----------------- ##
 ## Install targets.  ##
@@ -48,19 +44,24 @@ endif !%?SUBDIRS%
 .PHONY: install install-exec install-data uninstall
 .PHONY: install-exec-am install-data-am uninstall-am
 
-if %?SUBDIRS%
-RECURSIVE_TARGETS += install-data-recursive install-exec-recursive \
-                    install-recursive uninstall-recursive
-install:%maybe_BUILT_SOURCES% install-recursive
+ifdef SUBDIRS
+RECURSIVE_TARGETS += install-data-recursive install-exec-recursive
+RECURSIVE_TARGETS += install-recursive uninstall-recursive
 install-exec: install-exec-recursive
 install-data: install-data-recursive
 uninstall: uninstall-recursive
-else !%?SUBDIRS%
-install:%maybe_BUILT_SOURCES% install-am
+else
 install-exec: install-exec-am
 install-data: install-data-am
 uninstall: uninstall-am
-endif !%?SUBDIRS%
+endif
+
+ifdef BUILT_SOURCES
+install: $(BUILT_SOURCES)
+       $(MAKE) $(if $(SUBDIRS),install-recursive,install-am)
+else
+install: $(if $(SUBDIRS),install-recursive,install-am)
+endif
 
 .PHONY: install-am
 install-am: all-am
@@ -68,16 +69,18 @@ install-am: all-am
 
 
 .PHONY: installcheck
-?SUBDIRS?installcheck: installcheck-recursive
-?!SUBDIRS?installcheck: installcheck-am
-?!SUBDIRS?.PHONY: installcheck-am
-?!SUBDIRS?installcheck-am:
+ifdef SUBDIRS
+installcheck: installcheck-recursive
+else
+installcheck: installcheck-am
+.PHONY: installcheck-am
+installcheck-am:
+endif
 
 ## If you ever modify this, keep in mind that INSTALL_PROGRAM is used
 ## in subdirectories, so never set it to a value relative to the top
 ## directory.
 .PHONY: install-strip
-install-strip:
 ## Beware that there are two variables used to install programs:
 ##   INSTALL_PROGRAM is used for ordinary *_PROGRAMS
 ##   install_sh_PROGRAM is used for nobase_*_PROGRAMS (because install-sh
@@ -90,12 +93,9 @@ install-strip:
 ##
 ## The case for empty $(STRIP) is separate so that it is quoted correctly for
 ## multiple words, but does not expand to an empty words if STRIP is empty.
-       if test -z '$(STRIP)'; then \
-         $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s 
\
-             install; \
-       else \
-         $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
-           install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s 
\
-           "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
-       fi
+install-strip:
+       $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+               install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+               INSTALL_STRIP_FLAG=-s \
+               $(if $(STRIP),"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'") \
+               install
diff --git a/t/bsource.sh b/t/bsource.sh
index 482015f..0ab31f7 100755
--- a/t/bsource.sh
+++ b/t/bsource.sh
@@ -27,6 +27,14 @@ END
 
 $ACLOCAL
 $AUTOMAKE
-grep 'install-recursive' Makefile.in && Exit 1
+$AUTOCONF
+
+./configure
+
+for t in all check install; do
+  $MAKE -n $t-recursive 2>stderr && { cat stderr >&2; Exit 1; }
+  cat stderr >&2
+  grep " [Nn]o rule to make target.*[\`\"']$t-recursive" stderr
+done
 
 :
diff --git a/t/check3.sh b/t/built-sources-check.sh
similarity index 77%
copy from t/check3.sh
copy to t/built-sources-check.sh
index 69b6a67..37a5da3 100755
--- a/t/check3.sh
+++ b/t/built-sources-check.sh
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure 'check:' and 'install:' honor $(BUILT_SOURCES).
+# Make sure 'check:' honors $(BUILT_SOURCES).
 # PR/359.
 
 # For gen-testsuite-part: ==> try-with-serial-tests <==
@@ -63,18 +63,6 @@ cat stdout
 grep '^PASS: subrun\.sh *$' stdout
 grep 'PASS.*echo\.sh' stdout && Exit 1
 
-# check should depend directly on $(BUILT_SOURCES) (similar tests
-# are in check.test and check2.test).
-$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in
-$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in
-
-$MAKE clean
-# Sanity checks
-test ! -f command1.inc
-test ! -f dir/command2.inc
-# Now make sure these two files are rebuilt during make install.
-$MAKE install
-test -f command1.inc
-test -f dir/command2.inc
+$MAKE distcheck
 
 :
diff --git a/t/alpha2.sh b/t/built-sources-cond.sh
similarity index 50%
copy from t/alpha2.sh
copy to t/built-sources-cond.sh
index 6d5207f..d74abab 100755
--- a/t/alpha2.sh
+++ b/t/built-sources-cond.sh
@@ -14,46 +14,78 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Another check for README-alpha support.  This time it is requested
-# from configure.ac.  Report from Akim Demaille.
+# Interaction of BUILT_SOURCES with conditionals.
 
 . ./defs || Exit 1
 
-cat > configure.ac << 'END'
-AC_INIT([alpha], [1.0b])
-AM_INIT_AUTOMAKE([readme-alpha])
-AC_CONFIG_FILES([Makefile sub/Makefile])
+cat >> configure.ac <<'END'
+AM_CONDITIONAL([COND1], [test $cond1 = yes])
+AM_CONDITIONAL([COND2], [test $cond2 = yes])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-SUBDIRS = sub
-check-local: distdir
-       test -f $(distdir)/README-alpha
-       test -f $(distdir)/sub/README
-       test ! -f $(distdir)/sub/README-alpha
-       : > works
+if COND1
+BUILT_SOURCES = a
+else
+BUILT_SOURCES = b
+endif
+if COND2
+BUILT_SOURCES += c
+endif
+
+a b c:
+       echo who cares > $@
 END
 
-mkdir sub
-: > sub/Makefile.am
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
 
-: > README-alpha
-: > sub/README-alpha
-: > sub/README
+cleanup ()
+{
+  # Files in $(BUILT_SOURCES) should be automatically removed
+  # upon maintainer-clean.
+  $MAKE maintainer-clean
+  test ! -f a
+  test ! -f b
+  test ! -f c
+}
 
-# Gnits stuff.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-: > THANKS
+./configure cond1=yes cond2=yes
 
-$ACLOCAL
-$AUTOCONF
-$AUTOMAKE
-./configure
-$MAKE check
-test -f works
+$MAKE
+test -f a
+test ! -f b
+test -f c
+
+cleanup
+
+./configure cond1=no cond2=yes
+
+$MAKE
+test ! -f a
+test -f b
+test -f c
+
+cleanup
+
+./configure cond1=yes cond2=no
+
+$MAKE
+test -f a
+test ! -f b
+test ! -f c
+
+cleanup
+
+./configure cond1=no cond2=no
+
+$MAKE
+test ! -f a
+test -f b
+test ! -f c
+
+cleanup
+
+:
diff --git a/t/check3.sh b/t/built-sources-install.sh
similarity index 52%
rename from t/check3.sh
rename to t/built-sources-install.sh
index 69b6a67..307864c 100755
--- a/t/check3.sh
+++ b/t/built-sources-install.sh
@@ -14,10 +14,9 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure 'check:' and 'install:' honor $(BUILT_SOURCES).
+# Make sure 'install:' honors $(BUILT_SOURCES).
 # PR/359.
 
-# For gen-testsuite-part: ==> try-with-serial-tests <==
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
@@ -28,53 +27,43 @@ END
 mkdir dir
 
 cat > Makefile.am << 'END'
-BUILT_SOURCES = command1.inc
+BUILT_SOURCES = built1
 SUBDIRS = dir
-TESTS = subrun.sh
-subrun.sh:
-       (echo '#! /bin/sh'; cat command1.inc) > $@
-       chmod +x $@
-command1.inc:
-       echo 'dir/echo.sh' > $@
-CLEANFILES = subrun.sh command1.inc
+built1:
+       echo ok > $@
+CLEANFILES = built1
+install-data-hook:
+       $(MKDIR_P) $(DESTDIR)$(prefix)/dir2
+       cp built1 $(DESTDIR)$(prefix)/built1
+       cp dir/built2 $(DESTDIR)$(prefix)/dir2/built3
+uninstall-hook:
+       rm -f $(DESTDIR)$(prefix)/built1
+       rm -f $(DESTDIR)$(prefix)/dir2/built3
+       rmdir $(DESTDIR)$(prefix)/dir2
+installcheck-local:
+       test -f $(prefix)/built1
+       test -f $(prefix)/dir2/built3
 END
 
 cat > dir/Makefile.am << 'END'
-BUILT_SOURCES = command2.inc
-check_SCRIPTS = echo.sh
-echo.sh:
+BUILT_SOURCES = built2
+built2:
 ## The next line ensures that command1.inc has been built before
 ## recurring into the subdir.
-       test -f ../command1.inc
-       (echo '#! /bin/sh'; cat command2.inc) > $@
-       chmod +x $@
-command2.inc:
-       echo 'echo Hello' > $@
-CLEANFILES = echo.sh command2.inc
+       cp ../built1 $@
+CLEANFILES = built2
 END
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE -a
+$AUTOMAKE
 ./configure --prefix "`pwd`/inst"
 
-$MAKE check >stdout || { cat stdout; Exit 1; }
-cat stdout
-grep '^PASS: subrun\.sh *$' stdout
-grep 'PASS.*echo\.sh' stdout && Exit 1
-
-# check should depend directly on $(BUILT_SOURCES) (similar tests
-# are in check.test and check2.test).
-$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' Makefile.in
-$EGREP '^check:.* \$\(BUILT_SOURCES\)( |$)' dir/Makefile.in
-
-$MAKE clean
-# Sanity checks
-test ! -f command1.inc
-test ! -f dir/command2.inc
 # Now make sure these two files are rebuilt during make install.
 $MAKE install
-test -f command1.inc
-test -f dir/command2.inc
+test -f built1
+test -f dir/built2
+$MAKE installcheck
+$MAKE distcheck
 
 :
diff --git a/t/subdirbuiltsources.sh b/t/built-sources-subdir.sh
similarity index 76%
rename from t/subdirbuiltsources.sh
rename to t/built-sources-subdir.sh
index 2f50708..976b794 100755
--- a/t/subdirbuiltsources.sh
+++ b/t/built-sources-subdir.sh
@@ -14,7 +14,7 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Make sure when using SUBDIR that all BUILT_SOURCES are built.
+# Make sure when using SUBDIRS that all BUILT_SOURCES are built.
 # A bug occurred where subdirs do not have all-recursive or
 # all-recursive-am which depended on BUILT_SOURCES.
 
@@ -31,14 +31,6 @@ AM_PROG_AR
 AC_OUTPUT
 END
 
-# Files required because we are using '--gnu'.
-: > INSTALL
-: > NEWS
-: > README
-: > COPYING
-: > AUTHORS
-: > ChangeLog
-
 cat > Makefile.am << 'END'
 SUBDIRS = lib
 END
@@ -47,25 +39,22 @@ cat > lib/Makefile.am << 'END'
 pkgdata_DATA =
 noinst_LIBRARIES = libfoo.a
 libfoo_a_SOURCES = foo.c
-BUILT_SOURCES=foo.h
+BUILT_SOURCES = foo.h
 foo.h:
        echo \#define FOO_DEFINE 1 >$@
 END
 
 cat > lib/foo.c << 'END'
 #include <foo.h>
-int foo () { return !FOO_DEFINE;}
+int foo () { return !FOO_DEFINE; }
 END
 
 
 $ACLOCAL
 $AUTOCONF
-$AUTOMAKE --include-deps --copy --force-missing --add-missing --gnu
+$AUTOMAKE --copy --add-missing
 
 ./configure
-
-# Remove the comment to get a successful test.
-# $MAKE -C lib foo.h
 $MAKE
 
 :
diff --git a/t/libobj10.sh b/t/built-sources.sh
similarity index 53%
copy from t/libobj10.sh
copy to t/built-sources.sh
index f19de74..b60a637 100755
--- a/t/libobj10.sh
+++ b/t/built-sources.sh
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-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
@@ -14,43 +14,53 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Do not complain about the nonexistence of a source for LIBOBJS if
-# it's in BUILT_SOURCES.  Reported by Erez Zadok.
+# Basic test on BUILT_SOURCES.
 
 required=cc
 . ./defs || Exit 1
 
-cat >> configure.ac << 'END'
+cat >> configure.ac <<'END'
 AC_PROG_CC
-AM_PROG_AR
-AC_PROG_RANLIB
-AC_LIBOBJ([foo])
 AC_OUTPUT
 END
 
 cat > Makefile.am << 'END'
-noinst_LIBRARIES = libfoo.a
-libfoo_a_SOURCES =
-libfoo_a_LIBADD = $(LIBOBJS)
 BUILT_SOURCES = foo.c
-CLEANFILES = foo.c
+noinst_PROGRAMS = bar baz
 foo.c:
-       echo 'extern int dummy;' > $@
-.PHONY: debugging
-debugging:
-       $(AR) t libfoo.a
+       rm -f $@ address@hidden
+       echo '#include <stdio.h>'               >  address@hidden
+       echo 'int main (void)'                  >> address@hidden
+       echo '{               '                 >> address@hidden
+       echo '  printf ("%s\n", FOOMSG);'       >> address@hidden
+       echo '  return 0;'                      >> address@hidden
+       echo '}'                                >> address@hidden
+       mv -f address@hidden $@
+CLEANFILES = foo.c
+END
+
+cat > bar.c <<'END'
+#define FOOMSG "Howdy, World"
+#include "foo.c"
 END
 
-cp "$am_scriptdir/ar-lib" . || fatal_ "fetching auxiliary script 'ar-lib'"
+cat > baz.c <<'END'
+#define FOOMSG "Hello, Earth"
+#include "foo.c"
+END
 
 $ACLOCAL
-$AUTOCONF
 $AUTOMAKE
+$AUTOCONF
 
 ./configure
-
 $MAKE
-$MAKE debugging
+if cross_compiling; then :; else
+  ./bar
+  ./bar | grep 'Howdy, World'
+  ./baz
+  ./baz | grep 'Hello, Earth'
+fi
 $MAKE distcheck
 
 :
diff --git a/t/check.sh b/t/check.sh
deleted file mode 100755
index 1edd60f..0000000
--- a/t/check.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#! /bin/sh
-# 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
-# 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 <http://www.gnu.org/licenses/>.
-
-# Test Automake style tests.
-
-# For gen-testsuite-part: ==> try-with-serial-tests <==
-. ./defs || Exit 1
-
-cat > Makefile.am << 'END'
-TESTS = frob.test
-END
-
-test x"$am_serial_tests" = x"yes" || : > test-driver
-
-$ACLOCAL
-$AUTOMAKE
-
-grep 'check-TESTS.*:' Makefile.in
-grep 'check-DEJAGNU' Makefile.in && Exit 1
-
-# 'check-TESTS' is phony.
-sed -n '/^\.PHONY:/,/^$/p' Makefile.in | $EGREP '(^| )check-TESTS($| )'
-
-# 'check' should depend directly on 'check-am' (similar tests are
-# in check2.test and check3.test).
-$EGREP '^check:.* check-am( |$)' Makefile.in
-
-:
diff --git a/t/check2.sh b/t/check2.sh
index 66ea973..439f04b 100755
--- a/t/check2.sh
+++ b/t/check2.sh
@@ -56,10 +56,8 @@ cat stdout
 grep '^PASS: subrun\.sh *$' stdout
 grep 'PASS.*echo\.sh' stdout && Exit 1
 
-# 'check' should depend directly on 'check-am' (similar tests are
-# in check.test and check3.test).
-$EGREP '^check:.* check-recursive( |$)' Makefile.in
-$EGREP '^check:.* check-am( |$)' dir/Makefile.in
+$EGREP '^check:.*check-recursive' Makefile.in
+$EGREP '^check:.*check-am' dir/Makefile.in
 
 # Make sure subrun.sh is still on its line as above.  This means Automake
 # hasn't rewritten the TESTS line unnecessarily.
diff --git a/t/doc-parsing-buglets-tabs.sh b/t/doc-parsing-buglets-tabs.sh
deleted file mode 100755
index 22c981c..0000000
--- a/t/doc-parsing-buglets-tabs.sh
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2011-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 <http://www.gnu.org/licenses/>.
-
-# Check the documented limitation of the Automake's Makefile parser w.r.t.
-# use of TAB characters; see Section "General Operation" in the Automake
-# manual, and automake bug#8360.
-# If you cause some parts of this test to fail, chances are that you've
-# improved the Automake parser ;-)
-
-. ./defs || Exit 1
-
-cat > Makefile.am <<END
-.PHONY: test
-test: all check
-
-fail:
address@hidden "'\$@ recipe executed'"; exit 1
-
-## This won't be recognized as a target+recipe by Automake.
-all-local${tab}:
address@hidden 1
-
-## This won't be recognized as a target+rdependency by Automake.
-all-local${tab}: fail
-
-just_to_separate: dummy deps
-
-## This won't be recognized as a variable assignment by Automake.
-${tab}bin_PROGRAMS = foo
-END
-
-echo AC_OUTPUT >> configure.ac
-
-$ACLOCAL
-$AUTOMAKE
-
-$FGREP '$(EXEEEXT)' Makefile.in && Exit 1
-grep 'all:.*all-local' Makefile.in && Exit 1
-grep "^${tab}bin_PROGRAMS = foo" Makefile.in
-
-$AUTOCONF
-./configure
-
-$MAKE test
-
-:
diff --git a/t/suffix5.sh b/t/local-targets.sh
similarity index 50%
copy from t/suffix5.sh
copy to t/local-targets.sh
index fb32ae1..003a7e3 100755
--- a/t/suffix5.sh
+++ b/t/local-targets.sh
@@ -14,52 +14,49 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# Test to make sure Automake include libtool objects resulting
-# from user-defined implicit rules.
-# Based on a report from Arkadiusz Miskiewicz <address@hidden>.
+# The 'all-local', 'check-local' and 'installdirs-local' targets can
+# also be defined by included or wrapper Makefiles that Automake never
+# sees, as well as through GNU make constructs that Automake does not
+# parse.
 
-required='cc libtool'
 . ./defs || Exit 1
 
 cat >> configure.ac << 'END'
-AC_SUBST([LINK], [:])
-AM_PROG_AR
-AC_PROG_LIBTOOL
+AC_SUBST([SafeInclude], [include])
 AC_OUTPUT
 END
 
-cat > Makefile.am << 'END'
-%.lo: %.k
-       (echo $< && cat $<) > $@
-
-noinst_LTLIBRARIES = libfoo.la
-libfoo_la_SOURCES = foo.k
-
-.PHONY: test
-test: all
-       grep '^=GREP=ME=$$' foo.lo
-## Weaker regex to account for VPATH issues.
-       grep 'foo\.k$$' foo.lo
-check-local: test
+cat > Makefile.am <<'END'
address@hidden@ ./inc.mk
+$(foreach x,all check installdirs,$(eval $(x)-local:: ; : > main-$(x)))
 END
 
-: > ltmain.sh
+cat > inc.mk << 'END'
+all-local check-local installdirs-local:: %-local:
+       : > incl-$*
+END
 
-for auxscript in ar-lib config.guess config.sub; do
-  cp "$am_scriptdir/$auxscript" . \
-    || fatal_ "fetching auxiliary script '$auxscript'"
-done
+cat > GNUmakefile << 'END'
+include ./Makefile
+all-local check-local installdirs-local:: %-local:
+       : > wrap-$*
+END
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
-#grep '_OBJECTS.*foo\.lo' Makefile.in
 
-$AUTOCONF
 ./configure
 
-echo '=GREP=ME=' > foo.k
-
-$MAKE test
-$MAKE distcheck
+$MAKE check installdirs
+test -f wrap-all
+test -f wrap-check
+test -f wrap-installdirs
+test -f incl-all
+test -f incl-check
+test -f incl-installdirs
+test -f main-all
+test -f main-check
+test -f main-installdirs
 
 :
diff --git a/t/phony.sh b/t/phony.sh
index a818cfb..5382470 100755
--- a/t/phony.sh
+++ b/t/phony.sh
@@ -26,4 +26,4 @@ EOF
 
 $ACLOCAL
 $AUTOMAKE
-test `$FGREP .PHONY: Makefile.in | wc -l` = 3
+test `$FGREP .PHONY: Makefile.in | wc -l` -gt 3
diff --git a/t/remake-all-1.sh b/t/remake-all-1.sh
index 066d6e2..92beb09 100755
--- a/t/remake-all-1.sh
+++ b/t/remake-all-1.sh
@@ -37,11 +37,9 @@ echo SUBDIRS = sub > $mkfile.am
 : > sub/$mkfile.am
 
 $ACLOCAL
+$AUTOCONF
 $AUTOMAKE
 
-$EGREP "^all-am:.* $mkfile( |$)" $mkfile.in sub/$mkfile.in
-
-$AUTOCONF
 ./configure
 
 $FGREP "$magic1" mkfile.in && Exit 1 # Sanity check.
diff --git a/t/tap-diagnostic.sh b/t/tap-diagnostic.sh
index e7aaff5..29b8628 100755
--- a/t/tap-diagnostic.sh
+++ b/t/tap-diagnostic.sh
@@ -54,7 +54,7 @@ END
 
 $MAKE check >stdout || { cat stdout; Exit 1; }
 cat stdout
-$EGREP -i "#.*all\\.test|a comment|(Tests|Shell) " stdout && Exit 1
+$EGREP "#.*all\\.test|a comment|(Tests|Shell) " stdout && Exit 1
 count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 skip=1 error=0
 
 echo 'AM_TEST_LOG_DRIVER_FLAGS = --comments' >> Makefile
@@ -69,7 +69,7 @@ count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 
skip=1 error=0
 $MAKE check TEST_LOG_DRIVER_FLAGS="--no-comments" >stdout \
   || { cat stdout; Exit 1; }
 cat stdout
-$EGREP -i "#.*all\\.test|a comment|(Tests|Shell) " stdout && Exit 1
+$EGREP "#.*all\\.test|a comment|(Tests|Shell) " stdout && Exit 1
 count_test_results total=4 pass=2 fail=0 xpass=0 xfail=1 skip=1 error=0
 
 # The "#"-prepended lines here shouldn't be parsed as test results.
diff --git a/t/vartar.sh b/t/vartar.sh
index ebac14b..d5ddf65 100755
--- a/t/vartar.sh
+++ b/t/vartar.sh
@@ -19,21 +19,21 @@
 . ./defs || Exit 1
 
 cat > Makefile.am << 'END'
-install = install
-install:
-       $(install) install
+xinstall = xinstall
+xinstall:
+       $(xinstall) xinstall
 END
 
 $ACLOCAL
 $AUTOMAKE -Wno-override
 
-grep '^install = install$' Makefile.in
+grep '^xinstall = xinstall$' Makefile.in
 
 cat > target.expected <<'EOF'
-install:
-       $(install) install
+xinstall:
+       $(xinstall) xinstall
 EOF
-sed -n '/^install:/,/^ /p' Makefile.in > target.value
+sed -n '/^xinstall:/,/^        /p' Makefile.in > target.value
 diff target.expected target.value
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]