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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to