make: cleanup on exit/interrupt?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > make: cleanup on exit/interrupt?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    make: cleanup on exit/interrupt?  
Markus Dehmann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-26-07 12:17 PM

For Makefiles, is there a special target that will be executed
whenever make is interrupted, killed or the likes? Or, whenever it
exits?

I often create a temp directory in my Makefile:
TMPDIR := $(shell mktemp -d /tmp.XXXXXXX)
but I don't see a clean and reliable way to *remove* that temp
directory, especially if make fails or is interrupted.

Thanks,
Markus






[ Post a follow-up to this message ]



    Re: make: cleanup on exit/interrupt?  
Maxim Yegorushkin


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-28-07 12:28 PM

On 26 Jun, 11:50, Markus Dehmann <markus.dehm...@gmail.com> wrote:

> For Makefiles, is there a special target that will be executed
> whenever make is interrupted, killed or the likes? Or, whenever it
> exits?

There are. Please see http://www.gnu.org/software/make/ma...br />
-Targets






[ Post a follow-up to this message ]



    Re: make: cleanup on exit/interrupt?  
Markus Dehmann


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
06-29-07 06:22 PM

On Jun 28, 6:34 am, Maxim Yegorushkin <maxim.yegorush...@gmail.com>
wrote:
> On 26 Jun, 11:50, Markus Dehmann <markus.dehm...@gmail.com> wrote:
> 
>
> There are. Please seehttp://www.gnu.org/software/make/manual/make.html.gz#Special-
Targets

I don't find any special target there that would be executed when make
is interrupted.

There is a link "Interrupting or Killing make" (http://www.gnu.org/
software/make/manual/make.html.gz#Interrupts), but there it just
explains that an interrupt (e.g. Ctrl-C) will have the effect that the
target that is currently built will be removed. But what I want is
that my TMPDIR gets removed, so it would need some special INTERRUPT
target. I guess I could work around it by writing a wrapper around
make, but I think such a target should be in make in the first place.

--Markus






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:13 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register