[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computed variable names in prerequisite "$$*"
From: |
Boris Kolpackov |
Subject: |
Re: computed variable names in prerequisite "$$*" |
Date: |
Fri, 13 Jan 2006 08:01:02 +0000 (UTC) |
User-agent: |
nn/6.6.5+RFC1522 |
Martin d'Anjou <address@hidden> writes:
> Hi,
>
> I do not understand why make says "No rule to make target" with this
> makefile when the target is t_two:
>
> $(shell mkdir -p src)
> $(shell touch src/file1.c)
> $(shell touch src/file2.c)
> var_one=file1
> var_two=file1 file2
>
> t_%: $(patsubst %,src/%.o,$$(var_$$*))
This should be
t_%: $$(patsubst %,src/%.o,$$(var_$$*))
because otherwise patsubst is executed when the rule is read instead
of when it is matched.
> This is with 3.81beta3.
>
> With 3.81beta4, in both cases make does not build the targets. Should make
> be able to build these targets?
Note that with 3.81beta4 (and, eventually, with 3.81) you will need to say
.SECONDEXPANSION:
in order to enable the second expansion.
hth,
-boris