help-make
[Top][All Lists]
Advanced

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

Re: Unconditional clean


From: Paul Smith
Subject: Re: Unconditional clean
Date: Thu, 07 Apr 2011 08:42:32 -0400

On Thu, 2011-04-07 at 12:07 +0100, Paulo J. Matos wrote:
> Hi all,
> 
> I have a target like:
> foo: dep1 dep2
>      $(MAKE) -c tests
>      rm -Rf $(tests_tmp)
> 
> However, this fails to work as intended since the clean (rm -Rf...) is 
> not executed is $(MAKE) -c tests fail.
> 
> I want to always execute the clean unconditionall but the exit code 
> generated by foo should be the one of $(MAKE) -c tests.
> 
> Any tips on how to achieve this?

This is really more of a shell scripting question than a make question,
but something like:

        foo: dep1 dep2
                $(MAKE) -c tests; r=$$?; rm -Rf $(tests_tmp); exit $$r

will do the trick.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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