Unix questions - getting exit status in makefile

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > August 2006 > getting exit status in makefile





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author getting exit status in makefile
nahum_barnea@yahoo.com

2006-08-21, 1:34 pm



Hi.

In bash I use the variable $? to get the previous command exit status.

Now I am writing a makefile and the $? has a different meaning
(the names of all the prerequisites that are newer than the target).

How can I post-process the exit status of a command in my makefile?

ThankX,
NAHUM

Pascal Bourguignon

2006-08-21, 1:34 pm

nahum_barnea@yahoo.com writes:
> In bash I use the variable $? to get the previous command exit status.
>
> Now I am writing a makefile and the $? has a different meaning
> (the names of all the prerequisites that are newer than the target).
>
> How can I post-process the exit status of a command in my makefile?


Reading:
man make
info make

Notice how $ can be escaped with $:

all:
false ; echo $$?

--
__Pascal Bourguignon__ http://www.informatimago.com/

PUBLIC NOTICE AS REQUIRED BY LAW: Any use of this product, in any
manner whatsoever, will increase the amount of disorder in the
universe. Although no liability is implied herein, the consumer is
warned that this process will ultimately lead to the heat death of
the universe.
nahum_barnea@yahoo.com

2006-08-21, 7:26 pm


Pascal Bourguignon wrote:
> nahum_barnea@yahoo.com writes:
>
> Reading:
> man make
> info make
>
> Notice how $ can be escaped with $:
>
> all:
> false ; echo $$?
>
> --
> __Pascal Bourguignon__ http://www.informatimago.com/
>
> PUBLIC NOTICE AS REQUIRED BY LAW: Any use of this product, in any
> manner whatsoever, will increase the amount of disorder in the
> universe. Although no liability is implied herein, the consumer is
> warned that this process will ultimately lead to the heat death of
> the universe.



I have a problem with $$? since I use GNU make.

look at:
http://www.gnu.org/software/make/manual/make.pdf
page 21:
"The variables $$? and $$* are not available and expand to the empty
string."

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com