Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Henrik Carlqvist
> The example in his question makes very clear what he wants: he wants a > pattern-specific variable assignment. Most likely yes. If you look at the subject of this thread it says "Target-specific variable in subdirectory problem" so he probably only wants the variable to be set when the target ma

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Sven C. Dack
No. You're mistake is to assume to know what he wants from looking at his Makefile when you also know it's not working for him. You cannot know what it is he wants when he apparently fails to express it in a Makefile. So you're still only assuming. You base your assumption on the fact that he p

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Paul Smith
On Wed, 2017-08-02 at 21:16 +0100, Sven C. Dack wrote: > I suggest you turn your attention towards him and ask him what he > wants. The example in his question makes very clear what he wants: he wants a pattern-specific variable assignment. The solution you provided was not a pattern-specific var

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Kyle Rose
Paul's interpretation appears to be the same as mine, and seems like the only straightforward interpretation of the OP's message. If that's the case (and Benjamin can tell us if it is not), I believe his message from 3:16 ET entirely explains the difference in behavior between test-% used in patter

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Sven C. Dack
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

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Paul Smith
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 "tes

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Sven C. Dack
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

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Paul Smith
On Wed, 2017-08-02 at 20:03 +0100, Sven C. Dack wrote: > Hello, > > try it with the following rules: > > test-%: $(eval FOO = BAR) > test-%: > echo $(FOO) No, this doesn't do what the OP wants. The eval in the prerequisites of the pattern is expanded immediately so this is identical to wri

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Kyle Rose
On Wed, Aug 2, 2017 at 3:03 PM, Sven C. Dack wrote: > Hello, > > try it with the following rules: > > test-%: $(eval FOO = BAR) > test-%: > echo $(FOO) FOO is a global variable in this case. Not sure what you're trying to demonstrate here. Kyle __

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Sven C. Dack
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 prerequisit

Re: Target-specific variable in subdirectory problem

2017-08-02 Thread Edward Welbourne
Benjamin Cama (2 August 2017 12:19) > 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.: >

Target-specific variable in subdirectory problem

2017-08-02 Thread Benjamin Cama
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 ech