Follow-up Comment #7, bug #62595 (project make):

Thanks for the pointer to the spec, that's very helpful.  I agree that this
would be possible to implement.

I'm not interested in a flag like --envfile, that doesn't sound very useful. 
I would anticipate that most build systems would want to always include the
content of the file, and not require the user to add an option to the command

I'm also not sure I agree that the right behavior is to always export every
variable in the file.  But these are details: the first thing is to decide
whether this needs to be added at all.

I was thinking about alternatives to adding new syntax, and the problem is
that there's not a very straightforward way in GNU make today to evaluate the
output of a program as a makefile.

We can run a program using $(shell ...), but the results are modified by
removing newlines and so this is not useful.

The only way to do it is to run $(shell ...) and have it write to a temporary
file, then include the temporary file.  Of course you can also use the re-exec
feature of make to write a rule to generate the include file then you have the
full power of a recipe.

Is that sufficient?  It would be something like:

include env.env
        env2make < $< > $@

for some putative *env2make* conversion tool.

An alternative would be to invent some new type of function which would either
preserve newlines in the result, which could then be passed to the *eval*
function, or create an alternative to include which would run a program and
"include" the output, or something like that.


Reply to this item at:


Message sent via Savannah

Reply via email to