summaryrefslogtreecommitdiff
path: root/t/local-targets.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/local-targets.sh')
-rw-r--r--t/local-targets.sh64
1 files changed, 64 insertions, 0 deletions
diff --git a/t/local-targets.sh b/t/local-targets.sh
new file mode 100644
index 000000000..aa35fd98e
--- /dev/null
+++ b/t/local-targets.sh
@@ -0,0 +1,64 @@
+#! /bin/sh
+# Copyright (C) 2001-2015 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 '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.
+
+. test-init.sh
+
+cat >> configure.ac << 'END'
+AC_SUBST([SafeInclude], [include])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+@SafeInclude@ ./inc.mk
+$(foreach x,all check installdirs,$(eval $(x)-local: ; : > main-$(x)))
+END
+
+cat > inc.mk << 'END'
+all-local check-local installdirs-local: %-local: %-incl
+all-incl check-incl installdirs-incl: %-incl:
+ : > incl-$*
+END
+
+cat > GNUmakefile << 'END'
+include ./Makefile
+all-local check-local installdirs-local: %-local: %-wrap
+all-wrap check-wrap installdirs-wrap: %-wrap:
+ : > wrap-$*
+END
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE
+
+./configure
+
+$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
+
+: