From 21328ac4950d64aa5c09e3ab26a34da199323dda Mon Sep 17 00:00:00 2001 From: rillig Date: Fri, 28 Aug 2020 04:05:35 +0000 Subject: [PATCH] make(1): add test for the undocumented .NULL special dependency target --- usr.bin/make/unit-tests/Makefile | 6 +++++- usr.bin/make/unit-tests/deptgt-suffixes.exp | 6 ++++++ usr.bin/make/unit-tests/deptgt-suffixes.mk | 14 ++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/usr.bin/make/unit-tests/Makefile b/usr.bin/make/unit-tests/Makefile index a603ce06a654..fee65dce7c0f 100644 --- a/usr.bin/make/unit-tests/Makefile +++ b/usr.bin/make/unit-tests/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.122 2020/08/28 03:51:06 rillig Exp $ +# $NetBSD: Makefile,v 1.123 2020/08/28 04:05:35 rillig Exp $ # # Unit tests for make(1) # @@ -322,6 +322,8 @@ ENV.varmisc+= FROM_ENV_BEFORE=env ENV.varmisc+= FROM_ENV_AFTER=env # Override make flags for some of the tests; default is -k. +# If possible, write ".MAKEFLAGS: -dv" in the test .mk file instead of +# settings FLAGS.test=-dv here, since that is closer to the test code. FLAGS.archive= -dA FLAGS.counter= -dv FLAGS.doterror= # none @@ -360,6 +362,8 @@ SED_CMDS.varname-dot-shell+= -e 's,\[/[^]]*\],[(details omitted)],' # Some tests need an additional round of postprocessing. POSTPROC.counter= ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p' +POSTPROC.deptgt-suffixes= \ + ${TOOL_SED} -n -e '/^\#\*\*\* Suffixes/,/^\#\*/p' POSTPROC.vardebug= ${TOOL_SED} -n -e '/:RELEVANT = yes/,/:RELEVANT = no/p' POSTPROC.varmod-match-escape= ${TOOL_SED} -n -e '/^Pattern/p' POSTPROC.varname-dot-shell= \ diff --git a/usr.bin/make/unit-tests/deptgt-suffixes.exp b/usr.bin/make/unit-tests/deptgt-suffixes.exp index 39a9383953dd..b24f47becdaf 100644 --- a/usr.bin/make/unit-tests/deptgt-suffixes.exp +++ b/usr.bin/make/unit-tests/deptgt-suffixes.exp @@ -1 +1,7 @@ +#*** Suffixes: +# `.custom-null' [1] (SUFF_NULL) +# To: +# From: +# Search Path: . .. +#*** Transformations: exit status 0 diff --git a/usr.bin/make/unit-tests/deptgt-suffixes.mk b/usr.bin/make/unit-tests/deptgt-suffixes.mk index b2c98a22b420..791ff5eb5f03 100644 --- a/usr.bin/make/unit-tests/deptgt-suffixes.mk +++ b/usr.bin/make/unit-tests/deptgt-suffixes.mk @@ -1,8 +1,18 @@ -# $NetBSD: deptgt-suffixes.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $ +# $NetBSD: deptgt-suffixes.mk,v 1.3 2020/08/28 04:05:35 rillig Exp $ # # Tests for the special target .SUFFIXES in dependency declarations. +# +# See also: +# varname-dot-includes.mk +# varname-dot-libs.mk -# TODO: Implementation +.MAKEFLAGS: -dg1 + +.SUFFIXES: .custom-null + +# TODO: What is the effect of this? How is it useful? +.NULL: .custom-null +.PATH.custom-null: . .. all: @:;