2009-03-07 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ Improve NetBSD 'make -n' output for many standard targets.
+ * automake.in (handle_tags): Let .MAKE depend on
+ `tags-recursive' and `ctags-recursive' if appropriate.
+ (handle_all): Likewise for `all'.
+ (do_check_merge_target): Likewise for `check-am' and `check'.
+ * lib/am/ansi2knr.am (.MAKE): Depend on %ANSI2KNR-DIR%/ansi2knr.
+ * lib/am/install.am [%?maybe_BUILT_SOURCES%] (.MAKE): Depend on
+ `install'.
+ * tests/maken3.test, tests/maken4.test: New tests.
+ * tests/Makefile.am: Update.
+
Improve `make -n dist' and `make -n distcheck' for GNU make.
Ensure that `make -n dist' and `make -n distcheck' do not change
files, due to GNU make executing rules containing `$(MAKE)'.
uninstall-am: uninstall-binSCRIPTS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-exec-am install-strip uninstall-am
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-exec-am install-strip tags-recursive \
+ uninstall-am
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am am--refresh check check-am clean clean-generic \
. "\tdone\n");
push (@tag_deps, 'tags-recursive');
&depend ('.PHONY', 'tags-recursive');
+ &depend ('.MAKE', 'tags-recursive');
$output_rules .= ("ctags-recursive:\n"
. "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
. "\tdone\n");
push (@ctag_deps, 'ctags-recursive');
&depend ('.PHONY', 'ctags-recursive');
+ &depend ('.MAKE', 'ctags-recursive');
}
if (&saw_sources_p (1)
. '$(MAKE) $(AM_MAKEFLAGS) '
. (var ('SUBDIRS') ? 'all-recursive' : 'all-am')
. "\n\n");
+ depend ('.MAKE', 'all');
}
else
{
# `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)
+ {
+ pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ",
+ @check);
+ depend ('.MAKE', 'check-am');
+ }
+ }
+ if (@check_tests)
+ {
pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ",
- @check)
- if @check;
+ @check_tests);
+ depend ('.MAKE', 'check-am');
}
- pretty_print_rule ("\t\$(MAKE) \$(AM_MAKEFLAGS)", "\t ",
- @check_tests)
- if @check_tests;
depend '.PHONY', 'check', 'check-am';
# Handle recursion. We have to honor BUILT_SOURCES like for `all:'.
: '')
. (var ('SUBDIRS') ? 'check-recursive' : 'check-am')
. "\n");
+ depend ('.MAKE', 'check')
+ if var ('BUILT_SOURCES');
}
# handle_clean ($MAKEFILE)
uninstall-am: uninstall-dist_perllibDATA uninstall-nodist_perllibDATA
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic ctags \
uninstall-am:
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-TESTS check-am clean clean-generic \
distclean distclean-generic distdir dvi dvi-am html html-am \
uninstall-am: uninstall-dist_pkgvdataDATA uninstall-dist_scriptDATA
-.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
- install-data-am install-strip
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+ install-am install-data-am install-strip tags-recursive
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
all all-am check check-am clean clean-generic ctags \
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2008
+## Copyright (C) 1994, 1995, 1996, 1997, 2001, 2003, 2008, 2009
## Free Software Foundation, Inc.
## This program is free software; you can redistribute it and/or modify
ANSI2KNR = %ANSI2KNR-DIR%/ansi2knr
%ANSI2KNR-DIR%/ansi2knr:
$(am__cd) %ANSI2KNR-DIR% && $(MAKE) $(AM_MAKEFLAGS) ./ansi2knr
+.MAKE: %ANSI2KNR-DIR%/ansi2knr
else !%?ANSI2KNR-DIR%
## automake - create Makefile.in from Makefile.am
-## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc.
+## Copyright (C) 2001, 2002, 2003, 2004, 2006, 2008, 2009 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
uninstall: uninstall-am
endif !%?SUBDIRS%
+if %?maybe_BUILT_SOURCES%
+.MAKE: install
+endif %?maybe_BUILT_SOURCES%
+
.MAKE .PHONY: install-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
makej.test \
maken.test \
maken2.test \
+maken3.test \
+maken4.test \
makevars.test \
man.test \
man2.test \
makej.test \
maken.test \
maken2.test \
+maken3.test \
+maken4.test \
makevars.test \
man.test \
man2.test \
uninstall-am:
-.MAKE: install-am install-strip
+.MAKE: check-am install-am install-strip
.PHONY: all all-am check check-TESTS check-am clean clean-generic \
distclean distclean-generic distclean-local distdir dvi dvi-am \
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2009 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 3, 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 `make -n' for various targets, to ensure that no files or
+# directories are created.
+#
+# This test exercises the GCS-mandated targets (except for dist)
+# as well as tags, TAGS.
+
+# Please keep this test in sync with sister test maken4.test.
+
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub sub2
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile sub2/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+TESTS = foo.test
+SUBDIRS = sub sub2
+##BUILT_SOURCES = foo
+foo:
+foo.test:
+all-local:
+ @: > stamp-all
+install-data-local:
+ @: > stamp-install
+uninstall-local:
+ @: > stamp-uninstall
+clean-local:
+ @: > stamp-clean
+distclean-local:
+ @: > stamp-distclean
+info-local:
+ @: > stamp-info
+html-local:
+ @: > stamp-html
+dvi-local:
+ @: > stamp-dvi
+ps-local:
+ @: > stamp-ps
+pdf-local:
+ @: > stamp-pdf
+check-local:
+ @: > stamp-check
+installcheck-local:
+ @: > stamp-installcheck
+mostlyclean-local:
+ @: > stamp-mostlyclean
+maintainer-clean-local:
+ @: > stamp-maintainer-clean
+END
+cat >sub/Makefile.am <<'END'
+all-local:
+ @: > stamp-all-sub
+install-data-local:
+ @: > stamp-install-sub
+uninstall-local:
+ @: > stamp-uninstall-sub
+clean-local:
+ @: > stamp-clean-sub
+distclean-local:
+ @: > stamp-distclean-sub
+info-local:
+ @: > stamp-info-sub
+html-local:
+ @: > stamp-html-sub
+dvi-local:
+ @: > stamp-dvi-sub
+ps-local:
+ @: > stamp-ps-sub
+pdf-local:
+ @: > stamp-pdf-sub
+check-local:
+ @: > stamp-check-sub
+installcheck-local:
+ @: > stamp-installcheck-sub
+tags:
+ @: > stamp-tags-sub
+TAGS:
+ @: > stamp-TAGS-sub
+mostlyclean-local:
+ @: > stamp-mostlyclean-sub
+maintainer-clean-local:
+ @: > stamp-maintainer-clean-sub
+END
+cat >sub2/Makefile.am <<'END'
+all install uninstall clean check:
+ @: > sub2-$@-should-not-be-executed
+info dvi pdf ps:
+ @: > sub2-$@-should-not-be-executed
+html:
+ @: > sub2-$@-should-not-be-executed
+install-info install-html install-dvi install-pdf install-ps:
+ @: > sub2-$@-should-not-be-executed
+installcheck installdirs tags TAGS mostlyclean:
+ @: > sub2-$@-should-not-be-executed
+## These targets cannot be overridden like this:
+## install-strip distclean maintainer-clean
+END
+
+$ACLOCAL
+$AUTOCONF
+
+check_targets ()
+{
+ set -e
+ for target in \
+ all install install-strip uninstall clean distclean check \
+ info html dvi pdf ps \
+ install-info install-html install-dvi install-pdf install-ps \
+ installcheck installdirs tags TAGS mostlyclean maintainer-clean
+ do
+ $MAKE -n $target >stdout || { cat stdout; Exit 1; }
+ cat stdout
+ case $target in
+ install-* | installdirs | tags | TAGS ) ;;
+ *)
+ test ! -f "stamp-$target$" || Exit 1
+ ;;
+ esac
+ case $target in
+ install-* | installdirs ) ;;
+ *)
+ test ! -f "sub/stamp-$target-sub" || Exit 1
+ ;;
+ esac
+ case $target in
+ distclean | maintainer-clean ) ;;
+ *)
+ test ! -f "sub2/sub2-$target-should-not-be-executed" || Exit 1
+ ;;
+ esac
+ done
+}
+
+$AUTOMAKE -Wno-override
+./configure
+check_targets || Exit 1
+
+# Now, introduce BUILT_SOURCES into the toplevel Makefile
+# TODO: add BUILT_SOURCES to sub2, fix fallout.
+sed 's/##//' < Makefile.am > t
+mv -f t Makefile.am
+$AUTOMAKE -Wno-override --force Makefile
+./configure
+check_targets || Exit 1
+
+Exit 0
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2009 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 3, 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 `make -n' for various targets, to ensure that stdout output is
+# sufficiently complete. This currently only works for GNU make and
+# BSD make implementations that support the `.MAKE' special target.
+#
+# This test exercises the GCS-mandated targets (except for dist)
+# as well as tags, TAGS.
+
+# Please keep this test in sync with sister test maken3.test.
+
+required=GNUmake
+. ./defs || Exit 1
+
+set -e
+
+mkdir sub sub2
+
+cat >> configure.in << 'END'
+AC_CONFIG_FILES([sub/Makefile sub2/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am <<'END'
+TESTS = foo.test
+SUBDIRS = sub sub2
+##BUILT_SOURCES = foo
+foo:
+foo.test:
+all-local:
+ @: > stamp-all
+install-data-local:
+ @: > stamp-install
+uninstall-local:
+ @: > stamp-uninstall
+clean-local:
+ @: > stamp-clean
+distclean-local:
+ @: > stamp-distclean
+info-local:
+ @: > stamp-info
+html-local:
+ @: > stamp-html
+dvi-local:
+ @: > stamp-dvi
+ps-local:
+ @: > stamp-ps
+pdf-local:
+ @: > stamp-pdf
+check-local:
+ @: > stamp-check
+installcheck-local:
+ @: > stamp-installcheck
+mostlyclean-local:
+ @: > stamp-mostlyclean
+maintainer-clean-local:
+ @: > stamp-maintainer-clean
+END
+cat >sub/Makefile.am <<'END'
+all-local:
+ @: > stamp-all-sub
+install-data-local:
+ @: > stamp-install-sub
+uninstall-local:
+ @: > stamp-uninstall-sub
+clean-local:
+ @: > stamp-clean-sub
+distclean-local:
+ @: > stamp-distclean-sub
+info-local:
+ @: > stamp-info-sub
+html-local:
+ @: > stamp-html-sub
+dvi-local:
+ @: > stamp-dvi-sub
+ps-local:
+ @: > stamp-ps-sub
+pdf-local:
+ @: > stamp-pdf-sub
+check-local:
+ @: > stamp-check-sub
+installcheck-local:
+ @: > stamp-installcheck-sub
+tags:
+ @: > stamp-tags-sub
+TAGS:
+ @: > stamp-TAGS-sub
+mostlyclean-local:
+ @: > stamp-mostlyclean-sub
+maintainer-clean-local:
+ @: > stamp-maintainer-clean-sub
+END
+cat >sub2/Makefile.am <<'END'
+all install uninstall clean check:
+ @: > sub2-$@-should-not-be-executed
+info dvi pdf ps:
+ @: > sub2-$@-should-not-be-executed
+html:
+ @: > sub2-$@-should-not-be-executed
+install-info install-html install-dvi install-pdf install-ps:
+ @: > sub2-$@-should-not-be-executed
+installcheck installdirs tags TAGS mostlyclean:
+ @: > sub2-$@-should-not-be-executed
+## These targets cannot be overridden like this:
+## install-strip distclean maintainer-clean
+END
+
+$ACLOCAL
+$AUTOCONF
+
+check_targets ()
+{
+ set -e
+ for target in \
+ all install install-strip uninstall clean distclean check \
+ info html dvi pdf ps \
+ install-info install-html install-dvi install-pdf install-ps \
+ installcheck installdirs tags TAGS mostlyclean maintainer-clean
+ do
+ $MAKE -n $target >stdout || { cat stdout; Exit 1; }
+ cat stdout
+ case $target in
+ install-* | installdirs | tags | TAGS ) ;;
+ *)
+ grep "stamp-$target$" stdout || Exit 1
+ test ! -f "stamp-$target$" || Exit 1
+ ;;
+ esac
+ case $target in
+ install-* | installdirs ) ;;
+ *)
+ grep "stamp-$target-sub" stdout || Exit 1
+ test ! -f "sub/stamp-$target-sub" || Exit 1
+ ;;
+ esac
+ case $target in
+ distclean | maintainer-clean ) ;;
+ *)
+ grep "should-not-be-executed" stdout || Exit 1
+ test ! -f "sub2/sub2-$target-should-not-be-executed" || Exit 1
+ ;;
+ esac
+ done
+}
+
+$AUTOMAKE -Wno-override
+./configure
+check_targets || Exit 1
+
+# Now, introduce BUILT_SOURCES into the toplevel Makefile
+# TODO: add BUILT_SOURCES to sub2, fix fallout.
+sed 's/##//' < Makefile.am > t
+mv -f t Makefile.am
+$AUTOMAKE -Wno-override --force Makefile
+./configure
+check_targets || Exit 1
+
+Exit 0