The following makefile.1 produces correct results:
---
target1 : var := one
target2 : var := two
targets := target1 target2
all : $(targets)
.SECONDEXPANSION:
$(targets) : foo/$$(var)/bar
foo/%/bar :
mkdir -p $(dir $@)
touch $@
.PHONY : target1 target2
Using the attached Makefile, I get the following result:
% rm -f foo; make -j
foo1
bar1
qux
start foo
bar
foo
So the qux recipe is run before foo is finished (or even started),
although qux depends on foo. The $(shell) calls as well as
.SECONDARY and the seemingly unrelated bar rules all seem to
> Date: Sun, 30 Dec 2012 23:38:44 +0100
> From: Frank Heckenbach
>
> BTW, I wanted to check against the current repository version, but
> when I tried to fetch it as described on
> https://savannah.gnu.org/git/?group=make, I got:
>
> % git clone git://git.savannah.gnu.org/make.git
> Cloning into