LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-31-2008, 05:16 AM   #1
Micky_123
LQ Newbie
 
Registered: Dec 2007
Posts: 17

Rep: Reputation: 0
Lightbulb Return value of make utility


Hi,

I am trying to write a shell script which does some x,y things followed by make clean followed by z followed by make. How can I check in the script whether make was successful or not. Basically, I am interested in finding the return value of make. I am trying tp write a shell script for this.

Thanks in advance !

Micky
 
Old 08-01-2008, 12:50 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
man make:

Quote:
Exit Status
GNU make exits with a status of zero if all makefiles were successfully parsed and no targets that were built failed. A status of one will be returned if the -q flag was used and make determines that a target needs to be rebuilt. A status of two will be returned if any errors were encountered.
Your script:

Code:
make clean
make z
if [ $? -eq 0 ] ; then
  do stuff when make succeeds
else
  do stuff when make fails
fi
The test of the exit status must immediately follow the command you wish to test, since it changes with each new command. Capture it in a variable if you want to test later.
 
1 members found this post helpful.
Old 08-04-2008, 12:13 AM   #3
Micky_123
LQ Newbie
 
Registered: Dec 2007
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks a lot ! I will try the same and hope to get it working !!

cheers
Micky
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
eval('2/4'), can i make it 0.5 return somehow? raskol Programming 3 04-06-2008 06:35 PM
how to make a filename make list and feed it to the tar utility nass Slackware 9 09-25-2007 11:51 AM
trouble installing utility make/configure shalombi Linux - Desktop 6 02-06-2007 10:52 AM
Running 'make ' utility on Redhat 6.0 sumit_vij11 Linux - Software 2 10-16-2005 03:37 AM
Make Utility and RT Linux twizzard Linux - Newbie 3 06-28-2002 08:54 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration