[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-ng] [FYI] [ng] general: GNU make doesn't support the '.MAKE' s
From: |
Stefano Lattarini |
Subject: |
[Automake-ng] [FYI] [ng] general: GNU make doesn't support the '.MAKE' special target |
Date: |
Tue, 31 Jan 2012 11:26:47 +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 | 12 +-----------
contrib/check-html.am | 1 -
contrib/multilib/multilib.am | 9 ++++-----
lib/am/install.am | 8 ++------
lib/am/subdirs.am | 1 -
syntax-checks.mk | 16 ++++++++++++++++
6 files changed, 23 insertions(+), 24 deletions(-)
diff --git a/automake.in b/automake.in
index caa7332..0f7dadf 100644
--- a/automake.in
+++ b/automake.in
@@ -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",
("address@hidden(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',
diff --git a/contrib/check-html.am b/contrib/check-html.am
index 7ddd948..9bba391 100644
--- a/contrib/check-html.am
+++ b/contrib/check-html.am
@@ -56,4 +56,3 @@ check-html recheck-html:
exit $$rv
.PHONY: check-html recheck-html
-.MAKE: check-html recheck-html
diff --git a/contrib/multilib/multilib.am b/contrib/multilib/multilib.am
index d829d73..5549d44 100644
--- a/contrib/multilib/multilib.am
+++ b/contrib/multilib/multilib.am
@@ -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
diff --git a/lib/am/install.am b/lib/am/install.am
index d556b87..68ce600 100644
--- a/lib/am/install.am
+++ b/lib/am/install.am
@@ -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
diff --git a/lib/am/subdirs.am b/lib/am/subdirs.am
index 26d176b..5e6d578 100644
--- a/lib/am/subdirs.am
+++ b/lib/am/subdirs.am
@@ -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.
diff --git a/syntax-checks.mk b/syntax-checks.mk
index 46c7e09..1b5e08c 100644
--- a/syntax-checks.mk
+++ b/syntax-checks.mk
@@ -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.
--
1.7.7.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-ng] [FYI] [ng] general: GNU make doesn't support the '.MAKE' special target,
Stefano Lattarini <=