On Mon, Jun 22, 2009 at 2:50 PM, Fritz Code<[email protected]> wrote:
> ifneq ($(shell ./error_check),0)
> �...@echo "error";
> $(error ...)
> else
> @echo "no error";
> endif
i don't think that will work how you want it to. "echo" can only
appear in target rules, not outside of target rules. $(error) is
(AFAIK) only useful outside of rules. Thus you cannot use $(error) to
report shell-level errors. The correct way to check inside a target is
something like:
target:
@do .something; x=$$?; test x0 != x$$x && {echo "Error! RC=$$x!";
exit $$x; }; \
true
The last "true" bit is so that the rule will exit with 0 if the second
&& part is not triggered.
In summary: you're trying to mix shell and make constructs
interchangeably, and that won't work - they are separate beasts and
have separate rules regarding when they can be used.
--
----- stephan beal
http://wanderinghorse.net/home/stephan/
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make