automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] news: about pattern rules and old-style suffix rules (was: Re: A


From: Stefano Lattarini
Subject: [PATCH] news: about pattern rules and old-style suffix rules (was: Re: Automake vs. Automake-NG)
Date: Wed, 22 Aug 2012 14:36:14 +0200

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: <address@hidden>
From: Stefano Lattarini <address@hidden>
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 <address@hidden>
---
 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]