[Top][All Lists]

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

Re: Portable prefix pattern rules

From: Alexandre Duret-Lutz
Subject: Re: Portable prefix pattern rules
Date: Wed, 14 Sep 2005 00:02:50 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/22.0.50 (gnu/linux)

>>> "SK" == Stepan Kasal <address@hidden> writes:

 SK> SUFFIXES = .moc.cpp
 SK> .h.moc.cpp:
 SK>         $(MOC) -o $@ $<

 SK> On Mon, Sep 05, 2005 at 03:02:28PM -0600, Tom Tromey wrote:
 >> I have never tried it but it is somewhat hard to imagine some versions
 >> of make accepting a suffix with two '.'s in it.

 SK> It's not hard to imagine.  The .SUFFIXES special target, which Automake
 SK> generates, is standardized by POSIX.  I can imagine a sane implmentation
 SK> of .SUFFIXES counts with this possibility.

I've even used rules such as 

.SUFFIXES: .tex -etu.tex

        sed ... < $< > $@

where the suffix does not start with `.' like in POSIX.  
It works fine with GNU make and BSD make.  (Haven't tried more.)
I guess implementations don't consider `.' to have any special meaning,
they just take whatever is listed in .SUFFIXES to match suffixes.

Automake rules are a bit different.  If you write


and no pair of suffixes can match this target, automake will
automatically register .idlC and .cpp as ".SUFFIXES", assuming
this is a inference rule for *.idlC -> *.cpp

However if you say 

  SUFFIXES = .idl C.cpp

then this will be correctly understood as a rule for *.idl -> *C.cpp

So we could say that `.' is not magic as long as there are some
SUFFIXES matches.
Alexandre Duret-Lutz

reply via email to

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