1 # $NetBSD: varmod-path.mk,v 1.3 2020/08/23 08:10:49 rillig Exp $
3 # Tests for the :P variable modifier, which looks up the path for a given
6 # The phony target does not have a corresponding path, therefore ... oops,
7 # as of 2020-08-23 it is nevertheless resolved to a path. This is probably
10 # The real target is located in a subdirectory, and its full path is returned.
11 # If it had been in the current directory, the difference between its path and
12 # its name would not be visible.
14 # The enoent target does not exist, therefore the target name is returned.
18 _!= rm -rf varmod-path.subdir
19 _!= mkdir varmod-path.subdir
20 _!= > varmod-path.subdir/varmod-path.phony
21 _!= > varmod-path.subdir/varmod-path.real
23 # To have an effect, this .PATH declaration must be after the directory is created.
24 .PATH: varmod-path.subdir
26 varmod-path.phony: .PHONY
29 all: varmod-path.phony varmod-path.real
30 @echo ${varmod-path.phony:P}
31 @echo ${varmod-path.real:P}
32 @echo ${varmod-path.enoent:P}
35 @rm -rf varmod-path.subdir