[Top][All Lists]

[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 21:16:42 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1

I suggest you turn your attention towards him and ask him what he wants.

My example does exactly what I say it does. It's just not your place to tell me I'm wrong when you don't know what he wants his makefile to do and so far haven't responded to him and only to me.

Or am I missing something? We are all adults here, right?

On 02/08/17 20:55, Paul Smith wrote:
On Wed, 2017-08-02 at 20:40 +0100, Sven C. Dack wrote:
It's my understanding that we don't actually know what Benjamin wants to
do, because nobody has asked. So I don't see how this would make me wrong.

  From his mail am I assuming he wants his Makefile to print "BAR" for a
target "test-stem" as well as "subdir/test-stem", which is what he will
get when he uses $(eval ...).
Because he is using a pattern-specific variable assignment instead of
just assigning the variable globally we can infer that he would like to
have the "FOO = BAR" assignment only in the context of targets that
match that pattern but not other targets.

So for this makefile:

   test-%: FOO = BAR
           echo $(FOO)

           echo $(FOO)

He would like to see:

   $ make test-foo
   echo BAR

   $ make other

If we change the pattern-specific variable to use $(eval FOO = BAR) he
would see:

   $ make test-foo
   echo BAR

   $ make other
   echo BAR

reply via email to

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