help-make
[Top][All Lists]
Advanced

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

Re: Rule-specific variables


From: Greg Chicares
Subject: Re: Rule-specific variables
Date: Mon, 28 Apr 2008 12:37:53 +0000
User-agent: Thunderbird 2.0.0.12 (Windows/20080213)

On 2008-04-28 08:55Z, Jeffrey Ratcliffe wrote:
> I'm trying to optionally add arguments to a command, depending on the
> target, as shown by my (obviously non-working) example:
> 
> %.xdb : %.bdfi
>       var=1
>       [ $(basename $(@F)) = part_of_filename ] && var=2
>       command --var=$(var) $(basename $(@F)).bdfi
> 
> I could make a rule for each possible target, but it seems it could be
> simpler, as there are several possible combinations.

See "Pattern-specific Variable Values" in the manual, e.g.:

var := 1
part_of_filename.xdb : var := 2

%.xdb : %.bdfi
        command --var=$(var) $(basename $(@F)).bdfi




reply via email to

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