automake
[Top][All Lists]
Advanced

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

Re: PATCH: patsubst support


From: Tom Tromey
Subject: Re: PATCH: patsubst support
Date: 23 Feb 2001 11:05:22 -0700

>>>>> "Tom" == Tom Tromey <address@hidden> writes:

Following up my own post...

Tom>     if FOO
Tom>     var = a b c
Tom>     else
Tom>     var = d e f
Tom>     endif
Tom>     derived = $(var:%=%.c)

Tom> Will this work correctly?  In this situation we have to give
Tom> `derived' the same conditions as `var'.

Last night I realized we could solve this by introducing a new
variable in Makefile.in to represent each patsubst expansion.  Such a
variable would be given the same conditions as what it depended on and
would be expanded by automake.  The `derived' variable would be
rewritten to refer to this new variable.  I think that solves all our
problems and is fairly easy to implement.

Well, it is easy if you do patsubst expansion in a separate pass, to
handle cases like this:

    if FOO
    var = a b
    endif
    derived = $(var:%=%.c)
    if BAR
    var = c d
    endif

Tom



reply via email to

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