Recommend *-local hooks without commands, for extensibility.
authorBruno Haible <bruno@clisp.org>
Sat, 2 May 2009 07:26:58 +0000 (09:26 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 2 May 2009 07:26:58 +0000 (09:26 +0200)
* doc/automake.texi (Clean): Show how to write the clean-local
extension with separate phony target.
* tests/Makefile.am (clean-local-check): Practice what we preach
by marking this phony.  For consistency, rename from ...
(check-clean-local): ... this.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
doc/automake.texi
tests/Makefile.am
tests/Makefile.in

index 65271fd..2560eeb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2009-05-02  Bruno Haible  <bruno@clisp.org>
+           Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Recommend *-local hooks without commands, for extensibility.
+       * doc/automake.texi (Clean): Show how to write the clean-local
+       extension with separate phony target.
+       * tests/Makefile.am (clean-local-check): Practice what we preach
+       by marking this phony.  For consistency, rename from ...
+       (check-clean-local): ... this.
+
 2009-04-28  Eric Blake  <ebb9@byu.net>
 
        scripts: normalize all timestamps to UTC
index 324649d..09a5dd2 100644 (file)
@@ -8123,6 +8123,17 @@ clean-local:
         -rm -rf testSubDir
 @end example
 
+Since @command{make} allows only one set of rules for a given target,
+a more extensible way of writing this is to use a separate target
+listed as a dependency:
+
+@example
+clean-local: clean-local-check
+.PHONY: clean-local-check
+clean-local-check:
+        -rm -rf testSubDir
+@end example
+
 As the GNU Standards aren't always explicit as to which files should
 be removed by which rule, we've adopted a heuristic that we believe
 was first formulated by Fran@,{c}ois Pinard:
index 093dde5..09b979c 100644 (file)
@@ -737,8 +737,8 @@ EXTRA_DIST = ChangeLog-old gen-parallel-tests $(TESTS)
 # Each test case depends on defs, aclocal, and automake.
 check_SCRIPTS = defs defs-p aclocal-$(APIVERSION) automake-$(APIVERSION)
 
-clean-local: check-clean-local
-
-check-clean-local:
+clean-local: clean-local-check
+.PHONY: clean-local-check
+clean-local-check:
        -chmod -R u+rwx *.dir
        -rm -rf defs-p *.dir
index 03d3874..3125d04 100644 (file)
@@ -1327,9 +1327,9 @@ $(parallel_tests): $(parallel_tests:-p.test=.test) Makefile.am
 defs-p: defs Makefile.am
        sed 's,^AM_INIT_AUTOMAKE$$,&([parallel-tests]),' < defs >$@
 
-clean-local: check-clean-local
-
-check-clean-local:
+clean-local: clean-local-check
+.PHONY: clean-local-check
+clean-local-check:
        -chmod -R u+rwx *.dir
        -rm -rf defs-p *.dir