automake-ng
[Top][All Lists]
Advanced

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

[Automake-NG] [PATCH 01/17] [ng] am: new private make variable $(am__all


From: Stefano Lattarini
Subject: [Automake-NG] [PATCH 01/17] [ng] am: new private make variable $(am__all_progs)
Date: Tue, 22 May 2012 22:48:39 +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 <address@hidden>
---
 automake.in    |    3 +++
 t/all-progs.sh |   62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 65 insertions(+)
 create mode 100755 t/all-progs.sh

diff --git a/automake.in b/automake.in
index 7b0ac7a..2019734 100644
--- a/automake.in
+++ b/automake.in
@@ -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
index 0000000..3b8050a
--- /dev/null
+++ b/t/all-progs.sh
@@ -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
+
+:
-- 
1.7.9.5




reply via email to

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