Jay Taylor's notes
back to listing indexHow to get exit status of a shell command used in GNU Makefile?
[web search]
Original source (stackoverflow.com)
Clipped on: 2015-10-02
I have a makefile rule in while I am executing a linux tool. I need to check the exit status of the tool command, and if that command fails the make has to be aborted. I tried checking with $?, $$? \$? etc in the makefile. But they gives me syntax error when makefile runs. What is the right way to do this ? Here is the relevant rule in Makefile
|
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
In the makefile-:
Each line in the makefile action invokes a new shell - the error must be checked in the action line where the command failed. If mycommand fails the logic branches to the echo statement then exits. |
|||||||||
|
Your Answer
community wiki
Not the answer you're looking for? Browse other questions tagged linux shell make gnu-make or ask your own question.
asked |
2 years ago |
viewed |
5539 times |
active |
Related
Hot Network Questions
- Structure of Benzyne
- Is requiring a license a violation of the GPL? Can I get around it?
- using a variable with a same name in different spaces
- How many keys will we try before opening the door?
- Why did it take so long for methane to be used as a rocket propellant?
Technology | Life / Arts | Culture / Recreation | Science | Other | ||
---|---|---|---|---|---|---|
site design / logo © 2015 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0
with attribution required
rev 2015.9.30.2859