1 # $NetBSD: varname-dot-curdir.mk,v 1.7 2020/10/08 19:09:08 rillig Exp $
3 # Tests for the special .CURDIR variable, which is initially set to the
4 # canonical path of the current working directory, when make started.
6 # In all normal situations, the current directory exists, and its name can
7 # be resolved. If not, make fails at startup.
9 # It would be possible on some systems to remove the current directory, even
10 # while a process runs in it, but this is so unrealistic that it's no worth
12 .if !exists(${.CURDIR})
15 .if !exists(${.CURDIR}/)
18 .if !exists(${.CURDIR}/.)
21 .if !exists(${.CURDIR}/..)
25 # Until 2020-10-04, assigning the result of a shell assignment to .CURDIR
26 # tried to add the shell command ("echo /") to the .PATH instead of the
27 # output of the shell command ("/"). Since "echo /" does not exist, the
28 # .PATH was left unmodified. See VarAssign_Eval.
30 # Since 2020-10-04, the output of the shell command is added to .PATH.
32 .if ${.PATH:M/} != "/"
36 # A normal assignment works fine, as does a substitution assignment.
37 # Appending to .CURDIR does not make sense, therefore it doesn't matter that
38 # this code path is buggy as well.
40 .if ${.PATH:M/} != "/"