automake
[Top][All Lists]
Advanced

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

Re: Portable prefix pattern rules


From: Stepan Kasal
Subject: Re: Portable prefix pattern rules
Date: Tue, 6 Sep 2005 09:53:11 +0200
User-agent: Mutt/1.4.1i

Hello,

On Mon, Sep 05, 2005 at 02:29:26PM -0600, Brian wrote:
> The following doesn't seem to work:
> SUFFIXES = .moc.cpp
> .moc.cpp:.h
>       $(MOC) -o $@ $<

it's an explicit rule, which creates file ".moc.cpp" from file ".h".

You have to use this:

SUFFIXES = .moc.cpp

.h.moc.cpp:
        $(MOC) -o $@ $<

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.

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

On Mon, Sep 05, 2005 at 02:29:26PM -0600, Brian wrote:
> The only other alternative I see is to enumerate a rule containing the 
> actual file names for every single .h to .moc.cpp conversion, of which there 
> are hundreds.

If you decided to go this way, you could autogenerate the list of the
dependencies and include it into Makefile.am.  The include directive is
handled by Automake, so the result is portable.

Have a nice day,
        Stepan Kasal




reply via email to

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