1 # $NetBSD: varname-dot-parsefile.mk,v 1.5 2020/10/24 08:50:17 rillig Exp $
3 # Tests for the special .PARSEFILE variable, which contains the basename part
4 # of the file that is currently parsed.
6 .if ${.PARSEFILE} != "varname-dot-parsefile.mk"
10 # During parsing, it is possible to undefine .PARSEFILE.
11 # Not that anyone would ever want to do this, but there's code in parse.c,
12 # function PrintLocation, that explicitly handles this situation.
13 .if !defined(.PARSEFILE)
17 .if defined(.PARSEFILE)
21 # The variable .PARSEFILE is indirectly used by the .info directive,
23 .info At this point, .PARSEFILE is undefined.
25 # There is absolutely no point in faking the location of the file that is
26 # being parsed. Technically, it's possible though, but only if the file
27 # being parsed is a relative pathname. See PrintLocation for details.
28 .PARSEFILE= fake-parsefile
29 .info The location can be faked in some cases.
31 # After including another file, .PARSEFILE is reset.
33 .info The location is no longer fake.
36 @echo At run time, .PARSEFILE is ${.PARSEFILE:Uundefined}.