automake
[Top][All Lists]
Advanced

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

Re: %-style pattern rules


From: Benoit SIGOURE
Subject: Re: %-style pattern rules
Date: Thu, 26 Jul 2007 22:27:31 +0200

On Jul 26, 2007, at 2:42 PM, BeN [F1233 121D312] wrote:
Lorenzo Bettini wrote:

about rules of the shape, e.g.,

%.txt: %.tt

how else could I implement those make rules?


I guess so called old-fashioned style of implicit rules would do:

e.g:

.SUFFIXES: .txt .tt

all: t.txt

.tt.txt:
    cp -v $< $@

The .SUFFIXES part is not necessary, first off because you should use SUFFIXES = .txt .tt (actually automake will throw a warning or an error if you do this, can't remember) automake will recognize it and do what-needs-to-be-done so that the generated Makefile is portable. There are some issues with .SUFFIXES but can't remember what though.

http://www.gnu.org/software/automake/manual/html_node/Suffixes.html
"As you may have noted, the SUFFIXES variable behaves like the .SUFFIXES special target of make. You should not touch .SUFFIXES yourself, but use SUFFIXES instead and let Automake generate the suffix list for .SUFFIXES. Any given SUFFIXES go at the start of the generated suffixes list, followed by Automake generated suffixes not already in the list."

But in the end, you don't even need to do any of this because automake is clever enough to figure out that .txt and .tt must be added in .SUFFIXES when it encounters the `.tt.txt:' rule.

Cheers,

[2nd attempt to send this message, the 1st failed with:]
  address@hidden
    SMTP error from remote mailer after end of data:
host mx10.gnu.org [199.232.76.166]: 550 Invalid address in message header
[trying without a GPG sig... that's weird]

--
Benoit Sigoure aka Tsuna
EPITA Research and Development Laboratory






reply via email to

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