]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] general: GNU make doesn't support the '.MAKE' special target
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 28 Jan 2012 08:05:19 +0000 (09:05 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Tue, 31 Jan 2012 10:26:04 +0000 (11:26 +0100)
The '.MAKE' special target can be used on NetBSD make to ensure
that the recipes for the targets declared as its dependencies are
executed also with "make -n".  This special target does not work
with GNU make though, so it's pointless to use it.  To obtain a
similar effect on GNU make, one can either prepend a recipe with
the '+' modifier, or use the string '$(MAKE)' somewhere in the
recipe text).

* syntax-checks.mk (sc_no_dotmake_target): New syntax check,
ensuring we don't use the '.MAKE' special target.
(syntax_check_rules): Add it.
* lib/am/install.am: Don't use the '.MAKE' target.
* lib/am/subdirs.am: Likewise.
* contrib/multilib/multilib.am: Likewise.
* contrib/check-html.am: Likewise.
* automake.in: Likewise.

automake.in
contrib/check-html.am
contrib/multilib/multilib.am
lib/am/install.am
lib/am/subdirs.am
syntax-checks.mk

index caa7332b161e4896be743c6b6a83cbe1bef8f6dd..0f7dadfa9192c68980101ca252e5e13a1d73f562 100644 (file)
@@ -3574,7 +3574,6 @@ sub handle_tags
                          . "\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"
@@ -3585,7 +3584,6 @@ sub handle_tags
                          . "\tdone\n");
        push (@ctag_deps, 'ctags-recursive');
        &depend ('.PHONY', 'ctags-recursive');
-       &depend ('.MAKE', 'ctags-recursive');
 
        $output_rules .= ("cscopelist-recursive:\n"
                          . "\tlist=\'\$(SUBDIRS)\'; for subdir in \$\$list; do \\\n"
@@ -3596,7 +3594,6 @@ sub handle_tags
                          . "\tdone\n");
        push (@cscope_deps, 'cscopelist-recursive');
        &depend ('.PHONY', 'cscopelist-recursive');
-       &depend ('.MAKE', 'cscopelist-recursive');
     }
 
     if (&saw_sources_p (1)
@@ -4500,7 +4497,6 @@ sub handle_all ($)
                        . "\n\t\$(MAKE) "
                        . (var ('SUBDIRS') ? 'all-recursive' : 'all-am')
                        . "\n\n");
-        depend ('.MAKE', 'all');
       }
     else
       {
@@ -4535,14 +4531,12 @@ sub do_check_merge_target ()
         {
          pretty_print_rule ("\t\$(MAKE)", "\t  ",
                             @check);
-         depend ('.MAKE', 'check-am');
        }
     }
   if (@check_tests)
     {
       pretty_print_rule ("\t\$(MAKE)", "\t  ",
                         @check_tests);
-      depend ('.MAKE', 'check-am');
     }
 
   depend '.PHONY', 'check', 'check-am';
@@ -4553,8 +4547,6 @@ sub do_check_merge_target ()
                       : '')
                    . (var ('SUBDIRS') ? 'check-recursive' : 'check-am')
                    . "\n");
-  depend ('.MAKE', 'check')
-    if var ('BUILT_SOURCES');
 }
 
 # handle_clean ($MAKEFILE)
@@ -4671,7 +4663,6 @@ sub handle_factored_dependencies
     {
       if (user_phony_rule "$_-hook")
        {
-         depend ('.MAKE', "$_-am");
          register_action("$_-am",
                          ("\t\@\$(NORMAL_INSTALL)\n"
                           . "\t\$(MAKE) $_-hook"));
@@ -4697,9 +4688,8 @@ sub handle_factored_dependencies
       # to append dependencies.  This would not work if Automake
       # refrained from defining its own .PHONY target as it does
       # with other overridden targets.
-      # Likewise for `.MAKE'.
       my @undefined_conds = (TRUE,);
-      if ($_ ne '.PHONY' && $_ ne '.MAKE')
+      if ($_ ne '.PHONY')
        {
          @undefined_conds =
            Automake::Rule::define ($_, 'internal',
index 7ddd948d4d4daaaf961611d85e6f48227f38053c..9bba3910b978c93aa308064d05716f3c34d01253 100644 (file)
@@ -56,4 +56,3 @@ check-html recheck-html:
        exit $$rv
 
 .PHONY: check-html recheck-html
-.MAKE: check-html recheck-html
index d829d73c3f7ac2108d075a166bca7758be7b7e70..5549d44e0dd156c8df4100c4bb0df03566ef753e 100644 (file)
@@ -1,8 +1,7 @@
 ## automake - create Makefile.in from Makefile.am
 
-## Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-## 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-## Foundation, Inc.
+## Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
 ## This Makefile.in is free software; the Free Software Foundation
 ## gives unlimited permission to copy and/or distribute it,
 ## with or without modifications, as long as this notice is preserved.
@@ -35,8 +34,8 @@ distclean-multi:
 maintainer-clean-multi:
        $(MULTICLEAN) DO=maintainer-clean multi-clean # $(MAKE)
 
-.MAKE .PHONY: all-multi clean-multi distclean-multi install-am \
-             install-multi maintainer-clean-multi mostlyclean-multi
+.PHONY: all-multi clean-multi distclean-multi install-am \
+        install-multi maintainer-clean-multi mostlyclean-multi
 
 install-exec-local: install-multi
 
index d556b871f80de978e42005cfa040a3afd5f59c4a..68ce6002d6e7fcd2ae0116bf0ee0adeddc61d406 100644 (file)
@@ -63,11 +63,7 @@ install-data: install-data-am
 uninstall: uninstall-am
 endif !%?SUBDIRS%
 
-if %?maybe_BUILT_SOURCES%
-.MAKE: install
-endif %?maybe_BUILT_SOURCES%
-
-.MAKE .PHONY: install-am
+.PHONY: install-am
 install-am: all-am
        @$(MAKE) install-exec-am install-data-am
 
@@ -81,7 +77,7 @@ install-am: all-am
 ## If you ever modify this, keep in mind that INSTALL_PROGRAM is used
 ## in subdirectories, so never set it to a value relative to the top
 ## directory.
-.MAKE .PHONY: install-strip
+.PHONY: install-strip
 install-strip:
 ## Beware that there are two variables used to install programs:
 ##   INSTALL_PROGRAM is used for ordinary *_PROGRAMS
index 26d176b538e176859ba2691e51e49947021c9794..5e6d578d309f7b8575e844664ba851dd3a44c5ca 100644 (file)
@@ -24,7 +24,6 @@ AM_RECURSIVE_TARGETS += $(RECURSIVE_TARGETS:-recursive=) \
   $(RECURSIVE_CLEAN_TARGETS:-recursive=)
 
 .PHONY: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
-.MAKE: $(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS)
 
 # This directory's subdirectories are mostly independent; you can cd
 # into them and run `make' without going through this Makefile.
index 46c7e09be5300dc5efc6f43adabfaaf34b826587..1b5e08cc69ebdcafc73065a351c554e9a94f94cc 100644 (file)
@@ -56,6 +56,7 @@ sc_AMDEP_TRUE_in_automake_in \
 sc_tests_no_gmake_requirement \
 sc_tests_no_gmake_checking \
 sc_tests_make_can_chain_suffix_rules \
+sc_no_dotmake_target \
 sc_no_am_makeflags \
 sc_tests_no_make_e \
 sc_docs_no_make_e \
@@ -346,6 +347,21 @@ sc_make_simple_include:
         "; \
         $(sc_grep_for_bad_make_include)
 
+## The '.MAKE' special target is NetBSD-make specific, and not supported
+## by GNU make.  No point in using it.
+sc_no_dotmake_target:
+       @files="\
+         `find $(srcdir) -name '*.am'` \
+         $(srcdir)/automake.in \
+         $(srcdir)/doc/*.texi \
+        "; \
+       if grep '\.MAKE' $$files; then \
+         echo "Special target '.MAKE' not supported by GNU make." 1>&2; \
+         echo "Use the '+' recipe modifier instead, or put the" \
+              "'\$$(MAKE)' string somewhere in the recipe text." 1>&2; \
+         exit 1; \
+       fi
+
 ## $(AM_MAKEFLAGS) is obsolete now that we assume GNU make, since it
 ## is smart enough to correctly pass the values of macros redefined on
 ## the command line to sub-make invocations.