automake
[Top][All Lists]
Advanced

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

Re: Makefile to Makefile.am


From: Thien-Thi Nguyen
Subject: Re: Makefile to Makefile.am
Date: Mon, 16 Aug 2010 02:22:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

() Ralf Wildenhues <address@hidden>
() Sun, 15 Aug 2010 23:32:44 +0200

   Yes, with a general example, please.

I am unsure what "general example" means, precisely, so
the patch below simply uses the one in The GNU Make Manual.
Is that ok?

_____________________________________________________
>From 7b70f8b27057c5b9a0f621dcfd5064c5d90947dd Mon Sep 17 00:00:00 2001
From: Thien-Thi Nguyen <address@hidden>
Date: Mon, 16 Aug 2010 02:14:56 +0200
Subject: [PATCH] Document a common conversion for GNU make pattern rules.

* doc/automake.texi (Multiple Outputs): Expand on GNU make
pattern rules; explain how to convert a common case to use
old-fashioned suffix rules; add simple example, xref.
---
 ChangeLog         |    7 +++++++
 doc/automake.texi |   30 +++++++++++++++++++++++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9ba4851..ca59933 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-08-16  Thien-Thi Nguyen  <address@hidden>  (tiny change)
+
+       Document a common conversion for GNU make pattern rules.
+       * doc/automake.texi (Multiple Outputs): Expand on GNU make
+       pattern rules; explain how to convert a common case to use
+       old-fashioned suffix rules; add simple example, xref.
+
 2010-08-12  Peter Rosin  <address@hidden>
 
        Enable the use of "link -lib" as the wrapped archiver.
diff --git a/doc/automake.texi b/doc/automake.texi
index bbb74d3..f95f5cd 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -11525,11 +11525,31 @@ @node Multiple Outputs
 @c $$
 
 For completeness it should be noted that GNU @command{make} is able to
-express rules with multiple output files using pattern rules
-(@pxref{Pattern Examples, , Pattern Rule Examples, make, The GNU Make
-Manual}).  We do not discuss pattern rules here because they are not
-portable, but they can be convenient in packages that assume GNU
address@hidden
+express rules with multiple output files using pattern rules.
+Although pattern rules are not portable, they can be
+convenient in packages that assume GNU @command{make}.
address@hidden Examples, , Pattern Rule Examples, make, The GNU Make
+Manual}.
+
+In the common case where the @samp{%} in the pattern rule is used to
+match the stem of a filename, and the prerequisite and target differ
+only in the filename extension, you can use the old fashioned suffix
+rule instead.  For example:
+
address@hidden
+# pattern rule, not portable
+%.o : %.c
+        $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@@ $<
+
+# old fashioned suffix rule, portable
+.c.o:
+        $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@@ $<
address@hidden example
+
+Take care, when converting from pattern rule syntax to suffix rule
+syntax, to place the prerequisite extension @file{.c} before that
+of the target extension @file{.o}.
address@hidden Rules, , Old-Fashioned Suffix Rule, make, The GNU Make Manual}.
 
 
 @node Hard-Coded Install Paths
-- 
1.6.3.2


reply via email to

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