%% Benjamin Edwards <[EMAIL PROTECTED]> writes:

  be> I'm having trouble getting the exit status of a
  be> command executed from within a GNUmakefile.  I'm
  be> executing the command using backticks, but I'm not
  be> able to get the exit status of that command.  I'm
  be> trying to access the exit status using "$?", but that
  be> doesn't seem to work for me.

  be> example snippet -

  be> target: clean
  be>         for file in $(FILES) ; do \
  be>                 echo "   => Processing $$file" ; \
  be>                 `<command>` ; \

Why are you using backticks?  The only thing this does is collect the
stdout then throw it away (since you're not assigning it to any
variable).

If you want to throw out stdout the traditional way to do it is:

            <command> >/dev/null

  be>                 echo "RETURN CODE == $?" ; \

You have to quote the "$".  This is being expanded to the make automatic
variable $?, which is not what you want.  Use $$? instead.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[EMAIL PROTECTED]>          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


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to