make-w32
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem


From: Paul D. Smith
Subject: Re: problem
Date: Thu, 19 Dec 2002 07:48:19 -0500

%% "Ashish Bajpai (DS/ESQ2)" <address@hidden> writes:

  ab> Can someone tell me the meaning of automatic variable $$? which is
  ab> used sometimes in makefile ?

This is not actually a question specific to the Windows port of GNU make
so might be better asked on address@hidden or similar.

  ab>   elif [ $$? -eq 2 ] ; then \

The construct "$$" escapes the dollar sign so that make won't think that
it introduces a make variable.  So really this isn't a make question at
all, it's a shell question: when you see "$$?" in the command script it
gets passed to the shell as "$?".

The shell variable $? is always set to the exit code of the
just-completed command, so the above test is checking whether the
previous command exited with an error code of 2.  In UNIX, all commands
that succeed exit with a result value of 0, and any non-0 value is
considered an error.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist



reply via email to

[Prev in Thread] Current Thread [Next in Thread]