[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to check if a file exists?
From: |
Greg Chicares |
Subject: |
Re: How to check if a file exists? |
Date: |
Tue, 20 May 2008 12:21:50 +0000 |
User-agent: |
Thunderbird 2.0.0.14 (Windows/20080421) |
On 2008-05-20 11:55Z, Hongliang Wang wrote:
[Paul Smith wrote:]
>>
>> On Tue, 2008-05-20 at 01:29 -0700, Garrett Cooper wrote:
>>> Why not use wildcard instead?
>>
>> You can't use make functions here, because they are all evaluated by
>> make BEFORE the command is invoked. Hongliang wants to see whether the
>> file exists AFTER the command has run.
>
> Yes, Do you have any suggestions?
I see nothing wrong with your original code:
if test -e $(OUTPUT)/*.exe; \
then @echo ' compiling success! ...'; \
else @echo ' compiling failes ...'; \
fi
except that '@' is 'make' syntax, not shell syntax, so
just write 'echo' instead of '@echo'.