help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dynamically building (temp) include file - how to delete on exit?


From: ogronom
Subject: Re: dynamically building (temp) include file - how to delete on exit?
Date: Sat, 16 Jun 2012 14:23:42 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120401 Firefox/11.0 SeaMonkey/2.8

>From info make

The only processing `make' does on the result
is to convert each newline (or carriage-return / newline pair) to a
single space.  If there is a trailing (carriage-return and) newline it
will simply be removed.

So it looks like, that you can not change this behaviour. Workaround
depends on what your script actually does. For example suggested below
you can do something like this

vars_to_define=foo bam
foo_script=echo 123
bam_script=echo hi

$(foreach v,$(vars_to_define),$(eval $(v)=$(shell $($(v)_script))))

.PHONEY: bar
bar:
        @echo foo: $(foo)
        @echo
        @echo bam: $(bam)


address@hidden wrote:
> On Sat 6/16/12 12:39 EDT ogronom wrote:
>> I'm not sure, but maybe you don't need include and temp files. Try
>> something like this.
>>
>> $(eval $(shell build-ddef.sh))
> 
> Nice idea, but I need help to get it to work, take a look:
> 
>   /tmp $ cat makefile
> 
>   $(eval $(shell echo -e 'bam=hi\nfoo=123'))
> 
>   .PHONEY: bar
>   bar:
>           @echo foo: $(foo)
>           @echo 
>           @echo bam: $(bam)
>   /tmp $ make bar
>   foo:
> 
>   bam: hi foo=123
> 
> What should the eval code be changed to so that foo has the proper value
> of '123'?  I need to support shell output defining about 7 macros,
> each of which needs to be parsed by make as a separate line (right?).
> 
> I've looked the texinfo help on 'eval'; my hunch is this is possible,
> with proper metaquoting, and possibly the use of define, call, or another
> approach I'm unaware of.  Any help or examples appreciated.
> 
> --
> thanks
> 
> _______________________________________________
> Help-make mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/help-make



reply via email to

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