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