help-make
[Top][All Lists]
Advanced

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

RE: set a variable with existance of a file?


From: William Deegan
Subject: RE: set a variable with existance of a file?
Date: Mon, 2 Oct 2006 18:18:24 -0700

Philip,


> > 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),)
Thanks. That did the trick.

-Bill


Share your special moments by uploading 500 photos per month to Windows Live Spaces Share it!
reply via email to

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