help-make
[Top][All Lists]
Advanced

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

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


From: gnu_make0
Subject: dynamically building (temp) include file - how to delete on exit?
Date: Sat, 16 Jun 2012 09:49:12 -0500

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





reply via email to

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