Paul,

Thanks very much for your detailed explanation!

At least we now know that "ccppc" behavior is different when it is executed within 
make (z.x is not generated) and when it is executed outside (z.x is successfully 
generated). 

Firstly, I tried and looks like "$?" is the exit status of my shell:
%echo $?
0
%echo $status
0
%make x
make: *** No rule to make target `x'.  Stop.
%echo $?
2
%echo $status
0

Also looks like executing the ccppc line directly in cygwin doesn't generate any error:

%echo $?
0
%d:/Tornado2.2/host/x86-win32/bin/ccppc -M z.c > z.x
%echo $?
0

I still can't tell if it is a problem with cygwin version of GNU make, or a problem 
with Tornado2.2 ccppc...As you suggested, maybe I should consult some Cygwin mailing 
list. 

Best Regards,
Yu

-----Original Message-----
From: Paul Smith [mailto:[EMAIL PROTECTED] Behalf Of Paul D.
Smith
Sent: 2004年7月20日 23:36
To: Zhang Yu
Cc: [EMAIL PROTECTED]
Subject: Re: cygwin make (GNU make v3.79.1) incompatibility with
Tornado2.2 ccppc


%% "Zhang Yu" <[EMAIL PROTECTED]> writes:

  zy> I hit a weird error when cygwin make (GNU make v3.79.1 built for
  zy> i686-pc-cygwin)

Please be aware that the Cygwin version of GNU make is not identical to
the version provided by the FSF; this list only supports versions
provided by the FSF.  You may have to contact a Cygwin mailing list for
support for your version of GNU make.

  zy> is used together with Tornado2.2 ccppc. "ccppc -M" to build the
  zy> dependencies for a source file will cause make to return Error 1
  zy> without error message.

This error code is simply the exit code of the program that make runs.
Make doesn't know what it means: it figures out whether the command it
invoked passes or fails through the exit code.  In standard UNIX fashion
an exit code of 0 means success, any other code means failure.

  zy> d:/Tornado2.2/host/x86-win32/bin/ccppc -M z.c > z.x 
  zy> make: *** [all] Error 1 

This merely means that the ccppc program exited with an error code of 1
instead of 0.  That's nothing to do with make, and everything to do with
ccppc.

  zy> Now execute the ccppc line directly in cygwin, succeed with z.x
  zy> correctly generated: 

  zy> %d:/Tornado2.2/host/x86-win32/bin/ccppc -M z.c > z.x 

If you were to look at the exit code here I'm sure it would be 1, and
not 0.  I don't know how to see the exit code of the last command in
Windows though.  In a UNIX Bourne shell you would use "echo $?".  I
think in a UNIX C shell it's "echo $status".


Anyway, this isn't an issue with make.  Good luck!

-- 
-------------------------------------------------------------------------------
 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


_______________________________________________
Bug-make mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to