2020-11-07 19:39:21 +00:00
|
|
|
# $NetBSD: export-variants.mk,v 1.4 2020/10/24 08:46:08 rillig Exp $
|
2020-09-05 16:11:04 +00:00
|
|
|
#
|
|
|
|
# Test whether exported variables apply to each variant of running
|
|
|
|
# external commands:
|
|
|
|
#
|
|
|
|
# The != assignments.
|
|
|
|
# The :!cmd! modifier.
|
|
|
|
# The :sh modifier.
|
|
|
|
|
|
|
|
SHVAR!= env | grep ^UT_ || true
|
|
|
|
.if ${SHVAR} != ""
|
2020-11-07 19:39:21 +00:00
|
|
|
. warning At this point, no variable should be exported.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${:!env | grep ^UT_ || true!} != ""
|
2020-11-07 19:39:21 +00:00
|
|
|
. warning At this point, no variable should be exported.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${env | grep ^UT_ || true:L:sh} != ""
|
2020-11-07 19:39:21 +00:00
|
|
|
. warning At this point, no variable should be exported.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
UT_VAR= value
|
|
|
|
.export UT_VAR
|
|
|
|
|
|
|
|
SHVAR!= env | grep ^UT_ || true
|
|
|
|
.if ${SHVAR} != "UT_VAR=value"
|
2020-11-07 19:39:21 +00:00
|
|
|
. warning At this point, a single variable should be exported.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${:!env | grep ^UT_ || true!} != "UT_VAR=value"
|
2020-11-07 19:39:21 +00:00
|
|
|
. warning At this point, a single variable should be exported.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
.if ${env | grep ^UT_ || true:L:sh} != "UT_VAR=value"
|
2020-11-07 19:39:21 +00:00
|
|
|
. warning At this point, a single variable should be exported.
|
2020-09-05 16:11:04 +00:00
|
|
|
.endif
|
|
|
|
|
|
|
|
all:
|
|
|
|
@:;
|