directive-export.mk revision 1.3 1 # $NetBSD: directive-export.mk,v 1.3 2020/10/29 17:27:12 rillig Exp $
2 #
3 # Tests for the .export directive.
4
5 # TODO: Implementation
6
7 INDIRECT= indirect
8 VAR= value $$ ${INDIRECT}
9
10 # A variable is exported using the .export directive.
11 # During that, its value is expanded, just like almost everywhere else.
12 .export VAR
13 .if ${:!env | grep '^VAR'!} != "VAR=value \$ indirect"
14 . error
15 .endif
16
17 # Undefining a variable that has been exported implicitly removes it from
18 # the environment of all child processes.
19 .undef VAR
20 .if ${:!env | grep '^VAR' || true!} != ""
21 . error
22 .endif
23
24 all:
25 @:;
26