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 12:39:34 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120401 Firefox/11.0 SeaMonkey/2.8

I'm not sure, but maybe you don't need include and temp files. Try
something like this.

$(eval $(shell build-ddef.sh))

address@hidden wrote:
> Pls consider:
> 
>   TMPF=$(shell tmpf=$$(mktemp /tmp/ddefs.XXXXXXXXX);build-ddefs.sh > 
> $$tmpf;echo $$tmpf)
>   include $(TMPF)
>     # defines several make macros
> 
> Above works so that make includes a freshly built include file, with up to
> date macros.
> 
> How do I ensure that that $(TMPF) is deleted after make exits, or after
> the include line runs?  
> 
> I seem to recall that putting the "rm $(TMPF)"
> in every recipe does work, but I would prefer to do the delete as soon after
> the include runs as possible, or when make exits.  I'm aware of
> an approach that involves a while loop in a shell that polls for the make
> process, sleeping, then looping until make dies, then deleting $(TMPF), but 
> I'm hoping
> for a nicer solution.
> 
> --
> thanks/regards,
> Tom
> 
> 
> 
> _______________________________________________
> 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]