help-make
[Top][All Lists]
Advanced

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

Re: Catching errors during $(shell ...) function


From: Paul Smith
Subject: Re: Catching errors during $(shell ...) function
Date: Sat, 27 Jul 2002 01:30:09 -0400

%% address@hidden writes:

  d> I'd like make to terminate with an error if the program run by
  d> $(shell ) exits with a nonzero status, but make seems to blindly
  d> run on.

$(shell ...) is a builtin function.  It is not a command script.  Make
does not check the result code of the shell bultin function and does not
exit with an error if the script fails.

  d> Example:

  d> BLAH=$(shell /bin/false)
  d> foox:
  d>         echo $(BLAH)

  d> Running this should abort,

No it shouldn't.


If you want to check the result code of a command invoked in a shell
builtin function script you'll have to do it yourself.  Or, not use
$(shell ...) at all and instead invoke the actual command within a
rule's command script, where make _does_ pay attention to the exit
code.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden> HASMAT: HA Software Mthds & Tools
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.



reply via email to

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