help-make
[Top][All Lists]
Advanced

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

why make not give message about target being up-to-date in this VPATH si


From: Britton Kerin
Subject: why make not give message about target being up-to-date in this VPATH situation?
Date: Mon, 17 May 2021 13:33:22 -0800

Given this Makefile:

VPATH = a_subdir

foo: some_prereq
        touch $@

bar: some_prereq
        touch $(VPATH)/$@

$(VPATH)/baz: some_prereq
        touch $@

Rebuilding an already-up-to-date $(VPATH)/baz using 'make baz' doesn't
give the usual "is up to date" message, even though the recipe is not
executed.  It does give this message for the bar target (and for the
non-VPATH normal case foo).  Why?

Behavior:

$ mkdir a_subdir
$ touch some_prereq
$ make foo
touch foo
$ make bar
touch a_subdir/bar
$ make bar
make: 'a_subdir/bar' is up to date.
$ make baz
touch a_subdir/baz
$ make baz
$ touch some_prereq
$ make baz
touch a_subdir/baz
$ make baz
$ make a_subdir/baz
make: 'a_subdir/baz' is up to date.
$ make --version
GNU Make 4.2
Built for x86_64-pc-linux-gnu
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.



reply via email to

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