Hello,
try it with the following rules:
test-%: $(eval FOO = BAR)
test-%:
echo $(FOO)
$ make test-stem
echo BAR
BAR
$ make subdir/test-stem
echo BAR
BAR
I cannot tell you why it fails in your example. My guess is that it's
just not good practise to use a plain assignment for a prerequisite and
that it's only working for backwards compatibility and not meant to be a
full feature. I'm not the authority on make and your guess will be as
good as mine.
Cheers,
Sven
On 02/08/17 11:19, Benjamin Cama wrote:
Hi,
I may be doing something wrong, but the following Makefile gives me
strange results: the target-specific variable does not apply when used
for a target in a subdirectory.
test-%: FOO = BAR
test-%:
echo $(FOO)
E.g.:
$ make test-stem
echo BAR
BAR
$ make subdir/test-stem
echo
What am I doing wrong?
PS: please Cc me, I'm not subscribed. Thanks.
_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make