[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: set a variable with existance of a file?
From: |
Philip Guenther |
Subject: |
Re: set a variable with existance of a file? |
Date: |
Mon, 2 Oct 2006 18:21:40 -0600 |
On 10/2/06, William Deegan <address@hidden> wrote:
I want to set a make variable with the existance of a file?
(I'm not sure why you have a question mark on that...)
I have a Make variable SRC which points to the base of my source
tree. I want to see if a file $(SRC)/new_gcc exists
If it exists I would like to set a variable with a different value.
The $(wildcard) built-in function will only return the actual
filenames that exist that match the supplied patterns, even if an
argument doesn't have any globbing characters like '*' or '?'. So,
$(wildcard filename)
will expand to nothing if 'filename' doesn't exist.
Ergo, to do this:
if no new_gcc
you write this:
ifeq ($(wildcard ${SRC}/new_gcc),)
Philip Guenther