2023-06-01 23:56:35 +03:00
|
|
|
# $NetBSD: directive-unexport.mk,v 1.8 2023/06/01 20:56:35 rillig Exp $
|
2020-08-16 15:07:50 +03:00
|
|
|
#
|
2020-08-16 17:25:16 +03:00
|
|
|
# Tests for the .unexport directive.
|
2020-12-12 21:11:42 +03:00
|
|
|
#
|
|
|
|
# Before 2020-12-13, misspelled directives like ".unexporting" or
|
|
|
|
# ".unexport-en" had not been detected properly.
|
2020-12-13 04:07:54 +03:00
|
|
|
#
|
|
|
|
# See also:
|
|
|
|
# directive-misspellings.mk
|
2020-08-16 15:07:50 +03:00
|
|
|
|
2020-10-30 20:55:10 +03:00
|
|
|
# First, export 3 variables.
|
2020-10-31 02:54:42 +03:00
|
|
|
UT_A= a
|
|
|
|
UT_B= b
|
|
|
|
UT_C= c
|
|
|
|
.export UT_A UT_B UT_C
|
2020-10-30 20:55:10 +03:00
|
|
|
|
|
|
|
# Show the exported variables and their values.
|
2023-06-01 23:56:35 +03:00
|
|
|
# expect+1: UT_A=a UT_B=b UT_C=c
|
2020-10-31 02:54:42 +03:00
|
|
|
.info ${:!env|sort|grep '^UT_'!}
|
2023-06-01 23:56:35 +03:00
|
|
|
# expect+1: UT_A UT_B UT_C
|
2020-10-30 20:55:10 +03:00
|
|
|
.info ${.MAKE.EXPORTED}
|
|
|
|
|
|
|
|
# XXX: Now try to unexport all of them. The variables are still exported
|
|
|
|
# but not mentioned in .MAKE.EXPORTED anymore.
|
|
|
|
# See the ":N" in Var_UnExport for the implementation.
|
|
|
|
*= asterisk
|
|
|
|
.unexport *
|
|
|
|
|
2023-06-01 23:56:35 +03:00
|
|
|
# expect+1: UT_A=a UT_B=b UT_C=c
|
2020-10-31 02:54:42 +03:00
|
|
|
.info ${:!env|sort|grep '^UT_'!}
|
2020-10-30 20:55:10 +03:00
|
|
|
.info ${.MAKE.EXPORTED}
|
|
|
|
|
2020-11-03 20:17:31 +03:00
|
|
|
.unexport # oops: missing argument
|
|
|
|
|
2020-08-16 15:07:50 +03:00
|
|
|
all:
|
|
|
|
@:;
|