Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Paul Smith
On Sun, 2015-01-18 at 22:28 +0100, SF Markus Elfring wrote: > > Without knowing exactly what you mean by "handling of rules with > > multiple output files" I can't say for sure, but I think it's unlikely > > that $(eval ...) can help with this. > > A lot of rules can come into the situation to fid

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread SF Markus Elfring
> Without knowing exactly what you mean by "handling of rules with > multiple output files" I can't say for sure, but I think it's unlikely > that $(eval ...) can help with this. A lot of rules can come into the situation to fiddle with multiple output files easily. Examples: * Specification of s

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Philip Guenther
To home in on one key point here... On Sun, Jan 18, 2015 at 4:31 AM, SF Markus Elfring wrote: ... >>> Lines 183 - 203: >>> define RESULT_CHECK >>> for part in $(1); do \ >>> if test "x$$(< $$part)" != "x0"; then \ >>> $(PRINTF) "$$(TEXT3)" '$$part'; \ >>> exit 12; \ >>> fi; \ >>> done \

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Paul Smith
On Sun, 2015-01-18 at 20:50 +0100, SF Markus Elfring wrote: > > The rule of thumb is, if you're using $(eval ...) inside a recipe, > > you're doing something wrong. > > Which make function should be used for recipe generation instead then? If you just want to expand inside a recipe, you can use $

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread SF Markus Elfring
>> The result should become components for recipes in my use case. > > As described before, this is not right. $(eval ...) is used to > internalize make syntax. The result of expanding $(eval ...) is the > _empty string_, so putting it in a recipe results in NOTHING being added > to the recipe.

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Paul Smith
On Sun, 2015-01-18 at 20:38 +0100, SF Markus Elfring wrote: > > Try changing eval to info > > This introspection approach will not work in the moment > when I stumble on the mentioned error messages. Why will it not work? $(info ...) is a no-op statement. It can appear anywhere and has zero eff

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread SF Markus Elfring
> The rule of thumb is, if you're using $(eval ...) inside a recipe, > you're doing something wrong. Which make function should be used for recipe generation instead then? > $(eval ...) is for parsing MAKEFILE content. Do recipes belong also to each make script? > There is only one situation

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread SF Markus Elfring
> Try changing eval to info This introspection approach will not work in the moment when I stumble on the mentioned error messages. > and then inspect the output to see if it makes sense as a makefile. The result should become components for recipes in my use case. > Write small test makefile

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Paul Smith
On Sun, 2015-01-18 at 13:07 -0600, Norbert Thiebaud wrote: > >> Then $(eval) is the Wrong Thing. > > > > I hope not … > > hope is not relevant... $(eval) _is_ the Wrong Thing(tm) for what you > seems to want to do The rule of thumb is, if you're using $(eval ...) inside a recipe, you're doing som

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Tim Murphy
With eval and call one can get confused quite easily. Try changing eval to info and then inspect the output to see if it makes sense as a makefile. Write small test makefiles that do small aspects of what you want and build them up step by step until you get the result you want when you introduce a

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Norbert Thiebaud
On Sun, Jan 18, 2015 at 6:31 AM, SF Markus Elfring wrote: > > Yes. - The evaluated variable should produce shell commands for recipes. > I try to reuse it as a subfunction. then use $(call -- or possibly $$(call, if you want to defer the call to when the recipe get invoked) not $(eval >> It's j

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread SF Markus Elfring
>> I have added another tab character to a multi-line variable definition >> which should be called for a specific evaluation. >> Now I get a bit of more "progress indication" from a different error message. > > You're just trying random stuff and not paying attention! I hope that I am becoming b

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-18 Thread Philip Guenther
On Sat, Jan 17, 2015 at 11:11 PM, SF Markus Elfring wrote: >> So that $(eval $(call GIBBERISH)) is wrong. Exactly *how* it's wrong >> depends on what the $(call) is supposed to return. Currently you're >> evaling something that doesn't look like a *STANDALONE* chunk of >> Makefile, which results

Re: Difficulties from the combination of functions "call" and "eval"

2015-01-17 Thread SF Markus Elfring
> So that $(eval $(call GIBBERISH)) is wrong. Exactly *how* it's wrong > depends on what the $(call) is supposed to return. Currently you're > evaling something that doesn't look like a *STANDALONE* chunk of > Makefile, which results in the error *in the eval*. I have added another tab character