2 # Copyright (C) 2003 Free Software Foundation, Inc.
4 # This file is part of GNU Automake.
6 # GNU Automake is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # GNU Automake is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with Automake; see the file COPYING. If not, write to
18 # the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 # Boston, MA 02111-1307, USA.
21 # Check whether double colon rules work. The Unix V7 make manual
22 # mentions double-colon rules, but POSIX does not. They seem to be
23 # supported by all Make implementation as we can tell. This test case
24 # is a spy: we want to detect if there exist implementations where
25 # these do not work. We might use these rules to simplify the rebuild
26 # rules (instead of the $? hack).
29 # | In the distant past we used :: rules extensively.
30 # | Fran?ois convinced me to get rid of them:
32 # | Thu Nov 23 18:02:38 1995 Tom Tromey <tromey@cambric>
34 # | * subdirs.am: Removed "::" rules
35 # | * header.am, libraries.am, mans.am, texinfos.am, footer.am:
36 # | Removed "::" rules
37 # | * scripts.am, programs.am, libprograms.am: Removed "::" rules
40 # | I no longer remember the rationale for this. It may have only been a
41 # | belief that they were unportable.
43 # On a related topic, the Autoconf manual has the following text:
44 # | `VPATH' and double-colon rules
45 # | Any assignment to `VPATH' causes Sun `make' to only execute
46 # | the first set of double-colon rules. (This comment has been
47 # | here since 1994 and the context has been lost. It's probably
48 # | about SunOS 4. If you can reproduce this, please send us a
49 # | test case for illustration.)
51 # We already know that overlapping ::-rule like
60 # do not work equally on all platforms. It seems that in all cases
61 # Make attempts to run all matching rules. However at least GNU Make,
62 # NetBSD Make, and FreeBSD Make will detect that $@ was updated by the
63 # first matching rule and skip remaining matches (with the above
64 # example that means that unless `a' was declared PHONY, only "rule1"
65 # will be appended to `a' if both b and c have changed). Other
66 # implementations like OSF1 Make and HP-UX Make do not perform such a
67 # check and execute all matching rules whatever they do ("rule1",
68 # "rule2", abd "rule3" will all be appended to `a' if b and c have
71 # So it seems only non-overlapping ::-rule may be portable. This is
93 test "`cat a`" = rule1
98 test "`cat a`" = rule2