]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] am: new private make variable $(am__all_progs)
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 21 May 2012 17:16:10 +0000 (19:16 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 22 May 2012 11:42:37 +0000 (13:42 +0200)
This is just a preparatory refactoring for future changes.

* automake.in (generate_makefile): Substitute $(am__all_progs) to the
list of all programs "seen" by automake (by looking at the PROGRAMS
primary).
* t/all-progs.sh: New test.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
automake.in
t/all-progs.sh [new file with mode: 0755]

index 7b0ac7a42203349fdd1fae89cc02b720c8bf56f9..20197348450eea58d219427a109132aeac30eaa0 100644 (file)
@@ -7812,7 +7812,10 @@ sub generate_makefile ($$)
   handle_subdirs;
   handle_tags;
   handle_minor_options;
+
   # Must come after handle_programs so that %known_programs is up-to-date.
+  define_variable ('am__all_progs', join(" ", keys %known_programs),
+                   INTERNAL);
   handle_tests;
 
   # This must come after most other rules.
diff --git a/t/all-progs.sh b/t/all-progs.sh
new file mode 100755 (executable)
index 0000000..3b8050a
--- /dev/null
@@ -0,0 +1,62 @@
+#! /bin/sh
+# Copyright (C) 2007-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 internal automake variable $(am__all_progs).
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_SUBST([CC], ['whocares'])
+AC_SUBST([EXEEXT], [''])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+AUTOMAKE_OPTIONS = no-dependencies
+
+check_PROGRAMS = p1
+check_SCRIPTS = x1
+
+EXTRA_PROGRAMS = p2
+EXTRA_SCRIPTS = x2
+
+bin_PROGRAMS = p3
+bin_SCRIPTS = x3
+
+noinst_PROGRAMS = p4
+noinst_SCRIPTS = x4
+
+mydir = $(prefix)
+my_PROGRAMS = p5
+my_SCRIPTS = x5
+
+.PHONY: debug test
+debug:
+       @echo BEG: $(am__all_progs) :END
+test: debug
+       test '$(sort $(am__all_progs))' = 'p1 p2 p3 p4 p5'
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+$MAKE test
+$MAKE test EXEEXT=.exe
+$MAKE test EXEEXT=.bin
+
+: