help-make
[Top][All Lists]
Advanced

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

RE: How to check if a file exists?


From: Hongliang Wang
Subject: RE: How to check if a file exists?
Date: Wed, 21 May 2008 09:53:51 +0000

Hi David

This is what I got by using your your code:

=======================================================
D:\data\dev\jhwcu\src\je\win>gmake
compiling bitrock/hvr_bitrock.xml ...
d:/perl/bin/perl "-I../../../src/jp/perl" ../../../src/jp/perl/rm.pl ../../../..
/distr/win32/*.exe
'd:\program files\BitRock InstallBuilder Enterprise 5.4.7\bin\builder.exe' build
 'bitrock/hvr_bitrock.xml' windows && test -e ../../../../distr/win32/*.exe
d:\program files\BitRock InstallBuilder Enterprise 5.4.7\bin\builder.exe: no suc
h device or address
gmake: *** [kit] Error 127
========================================================

I guess the reason is that gmake on Windows is wrongly invoking the compiling 
process and was asking builder.exe to take parameter && test.


However, my code does not work properly either,
========================================================
compiling bitrock/hvr_bitrock.xml ...
d:/perl/bin/perl "-I../../../src/jp/perl" ../../../src/jp/perl/rm.pl ../../../..
/distr/win32/*.exe
'd:\program files\BitRock InstallBuilder Enterprise 5.4.7\bin\builder.exe' build
 'bitrock/hvr_bitrock.xml' windows
if test -e ../../../../distr/win32/*.exe; \
then echo ' compiling success! ...'; \
else echo ' compiling failes ...'; \
fi
 compiling failes ...
=========================================================

The Makefile produces "compiling fails" error while the compiling procedure 
just succeeds ....

Any help?


> Date: Tue, 20 May 2008 10:18:19 -0400
> From: address@hidden
> To: address@hidden
> Subject: Re: How to check if a file exists?
> CC: address@hidden
>
> On Tue, May 20, 2008 at 8:21 AM, Greg Chicares  wrote:
>> I see nothing wrong with your original code:
>
> Yes, it looks correct except for not affecting the exit status, which
> after all was the original point. But that may have just been for
> demonstration purposes. Personally I would go with something shorter
> and simpler:
>
> '$(BITROCK_SYSTEM)' build '$(XML)' windows && test -e $(OUTPUT)/*.exe
>
> which doesn't require a lot of continuation lines.
>
> Also, of course, you're running a Windows executable but showing Unix
> shell syntax. Again, that may be for demo purposes or due to having
> Cygwin et al but it's worth noting.
>
> Last, I'm not sure if the *.exe wildcard is there for a good reason,
> but if so one nice thing about "test -e" is that it ignores arguments
> after the first so you can safely use it with a wildcard. OTOH if you
> know the name of the output file it's better to write your action in
> terms of address@hidden
>
> -David Boyce

_________________________________________________________________
Connect to the next generation of MSN Messenger 
http://imagine-msn.com/messenger/launch80/default.aspx?locale=en-us&source=wlmailtagline



reply via email to

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