[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Deferred expansion and computed rules and rant about make bug
From: |
Mike Shal |
Subject: |
Re: Deferred expansion and computed rules and rant about make bug |
Date: |
Thu, 4 Aug 2005 11:31:46 -0400 |
On 8/4/05, Dale King <address@hidden> wrote:
> So I am looking for another workaround to the issue. I thought perhaps
> target-specific variables might do it, but haven't gotten it to work.
First: is the second "standard include file" supposed to be the same
as the first? It looks to me like the output you want is:
123
789
Second, when you tried target-specific variables, did you use the :=
instead of = ? This seems to work fine for me:
# The main make file
targets :=
all: do-targets
# This comes from an included file for a
foo := a
target := abc
flags := 123
# This comes from a standard include file
$(target): flags:=$(flags)
$(target):
@echo "$@ has flags: $(flags)"
targets += $(target)
# This comes from an included file for b
foo := b
target := xyz
flags := 789
# This comes from a standard include file
$(target): flags:=$(flags)
targets += $(target)
$(target):
@echo "$@ has flags: $(flags)"
# this is back to the main include file
do-targets: $(targets)
### EOF ###
The only changes are to your standard include file. I get the output
of '123' and '789' using make 3.79.1 and make 3.80. Note that if you
want to use more variables than just $(flags) in your command script,
you need a line to set each one.
Hope this helps,
-Mike