Re: Conditional recipe execution

2015-01-18 Thread SF Markus Elfring
>> Would use cases around the standard command "split" be concrete enough >> for further clarification? >> https://en.wikipedia.org/wiki/Split_%28Unix%29 > > No. I am bit surprised that you find such a tool as an unclear example at the moment. I am using my Python script which I developed as a c

Re: Conditional recipe execution

2015-01-18 Thread Paul Smith
On Mon, 2015-01-19 at 00:08 +0100, SF Markus Elfring wrote: > >> * I need to split an input file into several smaller files. > > > > I don't see any way that $(eval ...) is needed or helpful for any of > > those things. > > Can a make variable be set by this function within a recipe? Yes, I've a

Re: Conditional recipe execution

2015-01-18 Thread SF Markus Elfring
>> * I need to split an input file into several smaller files. > > I don't see any way that $(eval ...) is needed or helpful for any of > those things. Can a make variable be set by this function within a recipe? >> I imagine that conditional evaluation of recipes will be possible somehow, >> w

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: $< ignores order-only prerequisites

2015-01-18 Thread Paul Smith
On Fri, 2015-01-16 at 12:52 -0800, Parke wrote: > It appears that if there are no normal prerequisites, $< will ignore > any order-only prerequisites. > > This is not the behavior I expected, and I could not find > documentation describing this behavior. I agree it should be documented explicitly

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: Questionable line number in a message "missing separator"?

2015-01-18 Thread Paul Smith
On Sat, 2015-01-17 at 13:41 -0800, Philip Guenther wrote: > Paul, I still think $(eval) should have been named > $(stick-arm-in-woodchipper), to make it less seductive to people > trying to layer imperative programming on the declarative nature of > make. I do agree with you in general. I see alm

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