Now that, after today's commit '
v1.12-331-g645bb21', Automake-NG does
not follow the chain of user-defined pattern rules anymore, there's no
need to treat such rules preferentially, nor to reject old-fashioned
suffix rules. This will help interoperability with tools like Gnulib,
which generated Makefile.am fragments that still uses old-fashioned
suffix rules (since they are targeted to mainline Automake).
* automake.in (handle_footer): Do not reject the '.SUFFIXES:' rule
nor the 'SUFFIXES' variable. Add a "FIXME" comment about why we
still support the 'SUFFIXES' variable.
* lib/Automake/Rule.pm: Do not error out if an old-fashioned suffix
rule is seen.
* lib/am/footer.am (.SUFFIXES): Depend on '$(SUFFIXES)', if that's
non-empty.
* t/suffix-rules-reject.sh: Remove.
* t/suffix-rules-old-fashioned.sh: New.
* NG-NEWS: Adjust.
* doc/automake-ng.texi (Suffixes): Do not state that Automake-NG
rejects attempts to define old-fashioned suffix rules.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
for suffix-less tests).
-Pattern rules and suffix rules
-==============================
-
-* Old-fashioned suffix rules are not supported anymore; Automake-NG will
- error out if you try to use them. Use pattern rules instead, as
- advised in the GNU make manual itself.
-
-* The .SUFFIXES: special target and the SUFFIXES special variable are
- not supported anymore either; Automake-NG will error out if you try
- to define them.
-
-
Distribution
============
# Handle footer elements.
sub handle_footer
{
- # Automake used to have special support for old-fashioned suffix
- # rules, but Automake-NG favors the use of GNU make pattern rules.
- reject_rule '.SUFFIXES',
- "use pattern rules, not old-fashioned suffix rules";
- reject_var 'SUFFIXES',
- "use pattern rules, not old-fashioned suffix rules";
+ # FIXME: maybe display a warning if the obsolescent $(SUFFIXES)
+ # FIXME: variable is used? Currently, we don't do that, to preserve
+ # FIXME: better compatibility with mainline Automake.
$output_trailer .= file_contents ('footer', new Automake::Location);
}
Note that the above only works with suffixes that start with a dot.
-Also note that Automake-NG does not support old-fashioned suffix rules
-(@pxref{Suffix Rules, ,Old-fashioned Suffix Rules, make, The GNU make
-Manual}), since they are obsoleted by the GNU make pattern rules. In
-fact, Automake-NG will error out an any attempt to use old-fashioned
-suffix rules.
-
@node Include
@chapter Include
$rule->set ($c, $def);
}
- my $chars_rx = '[a-zA-Z0-9_(){}$+@\-]+';
- my $suffix_rule_rx = "^(\\.$chars_rx+)(\\.$chars_rx+)(?:\\s|\$)";
-
- # We don't support old-fashioned suffix rules anymore, but want to
- # report them as errors.
- if ($target =~ /$suffix_rule_rx/o)
- {
- error $where, "use pattern rules, not old-fashioned suffix rules";
- }
-
return @conds;
}
## You should have received a copy of the GNU General Public License
## along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Neutralize the default suffix rules.
-.SUFFIXES:
+# For better compatibility with mainline Automake.
+$(if $(SUFFIXES),$(eval .SUFFIXES: $$(SUFFIXES)))
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
--- /dev/null
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Automake-NG still accepts old-fashioned suffix rules.
+
+. ./defs || Exit 1
+
+cat >> configure.ac << 'END'
+AC_CONFIG_FILES([sub/Makefile])
+AC_OUTPUT
+END
+
+cat > Makefile.am << 'END'
+SUBDIRS = sub
+foobar: ; cp $< $@
+.mu.um:
+ cp $< $@
+.SUFFIXES: foo bar .mu .um
+data_DATA = xbar question.um
+END
+
+mkdir sub
+cat > sub/Makefile.am << 'END'
+SUFFIXES = .1 2 .3 4
+.1.3 24:
+ sed 's/@/O/' $< >$@
+all-local: bar.3 bar4
+END
+
+$ACLOCAL
+$AUTOMAKE
+
+grep SUFFIXES Makefile.in sub/Makefile.in # For debugging.
+
+$AUTOCONF
+echo foofoofoo > xfoo
+echo 'What is the sound of one hand?' > question.mu
+echo '@NE' > sub/bar.1
+echo 'TW@' > sub/bar2
+
+mkdir build
+cd build
+../configure
+$MAKE
+diff ../xfoo xbar
+diff ../question.mu question.um
+test "$(cat sub/bar.3)" = ONE
+test "$(cat sub/bar4)" = TWO
+
+cd ..
+./configure
+$MAKE
+
+diff xfoo xbar
+diff question.mu question.um
+test "$(cat sub/bar.3)" = ONE
+test "$(cat sub/bar4)" = TWO
+
+:
+++ /dev/null
-#! /bin/sh
-# Copyright (C) 1999-2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-# Automake-NG should reject suffix rules in favor of pattern rules.
-
-. ./defs || Exit 1
-
-$ACLOCAL
-
-cat > Makefile.am << 'END'
-.SUFFIXES: .w
-END
-
-cat > Makefile2.am <<'END'
-## Dummy comments ...
-## ... whose only purpose is ...
-## ... to alter ...
-## ... the line count.
-SUFFIXES = .w
-END
-
-cat > Makefile3.am << 'END'
-.foo.bar: ; cp $< $@
-.mu.um:
- cp $< $@
-.1.2 .3.4:
- who cares
-END
-
-msg='use pattern rules, not old-fashioned suffix rules'
-
-AUTOMAKE_fails -Wno-error -Wnone Makefile
-grep "^Makefile\\.am:1:.*$msg" stderr
-AUTOMAKE_fails -Wno-error -Wnone Makefile2
-grep "^Makefile2\\.am:5:.*$msg" stderr
-AUTOMAKE_fails -Wno-error -Wnone Makefile3
-grep "^Makefile3\\.am:1:.*$msg" stderr
-grep "^Makefile3\\.am:2:.*$msg" stderr
-grep "^Makefile3\\.am:4:.*$msg" stderr
-test `grep -c "$msg" stderr` -eq 3
-
-: