bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Target-specific variable in subdirectory problem


From: Sven C. Dack
Subject: Re: Target-specific variable in subdirectory problem
Date: Wed, 2 Aug 2017 20:03:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]