I don't know exactly why the $(shell ) isn't causing an error exactly - I
suspect its something to do with the point at which $(shell) is run.
HOWEVER
Depending on what you are testing, you could use the following technique:
BLAH=$(shell <something that outputs an error string>)
foox:
$(if $(BLAH), $(error $(BLAH)))
That <something that outputs an error string> could be a shell script that
wraps and detects a non-zero return status from whatever program you want to
run.
This only works with gmake 3.79 and greater, as $(if ) and $(error ) were
introduced in that release.
B.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: 24 July 2002 01:02
To: [EMAIL PROTECTED]
Subject: Catching errors during $(shell ...) function
I'd like make to terminate with an error if
the program run by $(shell ) exits with a nonzero status,
but make seems to blindly run on. Example:
BLAH=$(shell /bin/false)
foox:
echo $(BLAH)
Running this should abort, but it doesn't. Help!
- Dan
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make
_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make