diff options
author | Simon J. Gerraty <sjg@FreeBSD.org> | 2022-02-05 20:26:16 +0000 |
---|---|---|
committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2022-02-05 20:26:16 +0000 |
commit | 9f45a3c8c82ffead7044ae836d9257113c630d3b (patch) | |
tree | 28ee128050f4a20a077299fe36cd2a9a1ca8f883 /contrib/bmake/unit-tests/varname-makeflags.mk | |
parent | e515b9b44c20594288eff4628ca0cb155625fa3c (diff) | |
parent | cdde9e894dee2074ef0dd12ddc171e5d3f1513e3 (diff) | |
download | src-9f45a3c8c82ffead7044ae836d9257113c630d3b.tar.gz src-9f45a3c8c82ffead7044ae836d9257113c630d3b.zip |
Merge bmake-20220204
Diffstat (limited to 'contrib/bmake/unit-tests/varname-makeflags.mk')
-rw-r--r-- | contrib/bmake/unit-tests/varname-makeflags.mk | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/contrib/bmake/unit-tests/varname-makeflags.mk b/contrib/bmake/unit-tests/varname-makeflags.mk index 3b4fd91c3f57..f7840c2eb7a5 100644 --- a/contrib/bmake/unit-tests/varname-makeflags.mk +++ b/contrib/bmake/unit-tests/varname-makeflags.mk @@ -1,4 +1,4 @@ -# $NetBSD: varname-makeflags.mk,v 1.3 2020/12/01 20:37:30 rillig Exp $ +# $NetBSD: varname-makeflags.mk,v 1.5 2022/01/16 18:16:06 sjg Exp $ # # Tests for the special MAKEFLAGS variable, which is basically just a normal # environment variable. It is closely related to .MAKEFLAGS but captures the @@ -23,4 +23,22 @@ . error .endif + +# In POSIX mode, the environment variable MAKEFLAGS can contain letters only, +# for compatibility. These letters are exploded to form regular options. +OUTPUT!= env MAKEFLAGS=ikrs ${MAKE} -f /dev/null -v .MAKEFLAGS +.if ${OUTPUT} != " -i -k -r -s -V .MAKEFLAGS" +. error +.endif + +# As soon as there is a single non-alphabetic character in the environment +# variable MAKEFLAGS, it is no longer split. In this example, the word +# "d0ikrs" is treated as a target, but the option '-v' prevents any targets +# from being built. +OUTPUT!= env MAKEFLAGS=d0ikrs ${MAKE} -r -f /dev/null -v .MAKEFLAGS +.if ${OUTPUT} != " -r -V .MAKEFLAGS" +. error ${OUTPUT} +.endif + + all: |