On 08/21/2012 07:14 PM, Stefano Lattarini wrote: > On 08/21/2012 06:01 PM, Paolo Bonzini wrote: > >> * Alternatively, could Automake-NG suggest converting suffix >> rules to pattern rules >> > Yep, I will amend NG-NEWS to suggest that. > Done with the patch below. I will push shortly.
----8<----8<----8<----8<----8<----8<----8<----8<----8<----8<---- >From 78c11c3d969eb5d809e9245ea1b94efdee9ddaf7 Mon Sep 17 00:00:00 2001 Message-Id: <78c11c3d969eb5d809e9245ea1b94efdee9ddaf7.1345638508.git.stefano.lattar...@gmail.com> From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Tue, 21 Aug 2012 21:25:56 +0200 Subject: [PATCH] news: about pattern rules and old-style suffix rules * NEWS (Suffix rules and pattern rules): New. Suggest the use of pattern rules where possible, and how to declare old-style suffix rules that can work with both mainline Automake and Automake-NG. Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com> --- NG-NEWS | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/NG-NEWS b/NG-NEWS index 129da68..925c072 100644 --- a/NG-NEWS +++ b/NG-NEWS @@ -88,6 +88,32 @@ Warnings and diagnostic AM_VARTYPOS_WHITELIST = copy_LDADD +Suffix rules and pattern rules +============================== + +* Pattern rules in GNU make style ("%.o: %.c") are now accepted, and not + warned against anymore, even when portability warnings are enabled. + +* Pattern rules ("%.o: %.c") should be preferred over old-style suffix rules + (".c.o:") whenever possible. + +* Suffix rules are still supported though, mostly to cater to projects that + need to use automatically generated Makefile.am which contains such rules + (for example, Gnulib can generate such Makefile.am). + However, Automake-NG will not process anymore such suffix rules to update + the $(SUFFIXES) variable (and thus the '.SUFFIXES:' target) automatically; + the user is expected to do so manually. + For example, if your Makefile.am contained a suffix rule like: + + .hin.h: + sed 's/FOO/BAR/' $< >$@ + + to generate '*.h' files from '*.hin' ones, the SUFFIXES variable should + be updated to contain both '.h' and '.hin': + + SUFFIXES = .h .hin + + Compilation and Object Files ============================= -- 1.7.12