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 <[email protected]>          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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to