help-make
[Top][All Lists]
Advanced

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

vpath directive with './'


From: Max Gautier
Subject: vpath directive with './'
Date: Mon, 6 Nov 2017 10:21:27 +0100

Hi,

I'm encountering a problem with the use of the vpath directive, and I find
the behavior of make in this regard quite odd, but I may have misunderstood
something.

My Makefile is as follow (GNU make 3.81):


all: foo

./test/foo: bar
   touch $@

bar:
   touch $@

vpath foo ./test/


The problem is that, if i touch bar, foo does not get remade. Exploring on
that, i found out that in that situation, there is two rules for foo (from
the ouput of --print-date-base)

$ make --print-data-base | grep foo
all: ./test/foo
test/foo: bar
./test/foo:
vpath foo ./test

So it seems for the rule I specified, make discards './', but not for the
vpath directive.
When I change the vpath line to 'vpath foo test/', make do what I expect,
which seems to support that hypothesis.
Not sure if that should be a bug or not.

The trouble is that in my actual makefile, I use a combination of $(call)
and $(eval) to generate the rules, and begin at the root of my source tree
with './' (the default, unless I specify something else on the command line
when invoking make) avoids to do some checks to avoid ending with
'/some/path', which is not what I expect.

Is there something I can do to solve this, other than directly using an
absolute path ?

Thanks in advance

Max.


reply via email to

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