[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Shell script return in a makefile
From: |
German Escallon |
Subject: |
Shell script return in a makefile |
Date: |
Mon, 14 Jun 2010 10:18:08 -0400 |
User-agent: |
Thunderbird 2.0.0.24 (X11/20100411) |
Hello all,
How can I stop a build process based on the outcome of a shell script?
What I want to do is to run a script that verifies some of my code. If
the script succeeds, then I would continue to the next step, but if it
fails, I want to stop the make process.
First things first. How can I know if my script succeeded or not??
I've tried reading and printing the $? environment variable. Here's
what I've tried with a script that should always fail.
e.g:
@$(shell /path/to/my/script.sh)
@echo "result: $$?"
The line always prints "result: 0", regardless of the result. When I run
this same script on the console, and then echo the $? variable, I always
get the error code I'm hoping for.
If you have any suggestions on how to know the outcome of a script w/out
using the $? environment variable, please let me know. Thank you in
advance.
German
- Shell script return in a makefile,
German Escallon <=