[Top][All Lists]

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


From: Paul Smith
Subject: Re: VPATH
Date: Wed, 23 Sep 2009 12:59:10 -0400

On Wed, 2009-09-23 at 15:33 +0200, MENETRIER, Jerome wrote:

> I use for this VPATH to precise where file can be find.
> But my problème is to exclude current directory.
> How can I exclude current directory without precise all the possible
> directories in directive ?

Unfortunately, there is no way in GNU make to keep VPATH from searching
the local directory first.  The workaround you suggest is the only
possible one.

I can't remember anyone ever asking for this feature before.  I do
recall someone asking that, if "." appeared in VPATH, the local
directory would be looked for in that order instead of always being
looked at first.

Can you explain at a slightly higher level why you want to ignore local
files?  Is it that there might legitimately be local files which you
don't want to use?  Or, are you worried that someone might drop a local
file accidentally and you don't want to use that file?

If the latter, one option is to check explicitly for local files and, if
any are found, fail; something like this:

        LOCAL_SRCS := $(wildcard $(SRCS))
        ifneq ($(LOCAL_SRCS),)
            $(error Invalid local source files: $(LOCAL_SRCS))

(this assumes that the list of source files to build is in the variable
SRCS; modify to suite your situation of course).

reply via email to

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