From 4faacc9ba39b9d5e27eb598653d4089055af0c2c Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Mon, 21 May 2012 19:16:10 +0200 Subject: [PATCH] [ng] am: new private make variable $(am__all_progs) 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 --- 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 7b0ac7a42..201973484 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 000000000..3b8050a01 --- /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 . + +# 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 + +: -- 2.47.2