1 # $NetBSD: varname-dot-path.mk,v 1.3 2020/10/02 18:46:54 rillig Exp $
3 # Tests for the special .PATH variable, which TODO: describe the purpose.
5 _!= mkdir -p varname-dot-path.d
7 # By default, .PATH consists of "." and .CURDIR.
8 # XXX: Why both? Shouldn't they have the same effect?
9 .if ${.PATH} != ". ${.CURDIR}"
13 # The special target .PATH adds a directory to the path.
15 .if ${.PATH} != ". ${.CURDIR} /"
19 # Only existing directories are added to the path, the others are ignored.
21 .if ${.PATH} != ". ${.CURDIR} /"
25 # Only directories are added to the path, not regular files.
26 .PATH: ${.PARSEDIR}/${.PARSEFILE}
27 .if ${.PATH} != ". ${.CURDIR} /"
31 # Relative directories can be added as well.
32 # Each directory is only added once to the path.
33 .PATH: varname-dot-path.d /
34 .if ${.PATH} != ". ${.CURDIR} / varname-dot-path.d"
38 # The pathnames are not normalized before being added to the path.
40 .if ${.PATH} != ". ${.CURDIR} / varname-dot-path.d ./."
44 # The two default entries can be placed at the back of the path,
45 # by adding the special entry ".DOTLAST" somewhere in the path.
46 # The entry .DOTLAST, if any, is listed in the path, always at the
47 # very beginning, to make this magic less surprising.
49 .if ${.PATH} != ".DOTLAST / varname-dot-path.d ./. . ${.CURDIR}"
53 _!= rmdir varname-dot-path.d