summaryrefslogtreecommitdiff
path: root/usr.bin/make
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2021-12-01 23:56:29 +0000
committerrillig <rillig@NetBSD.org>2021-12-01 23:56:29 +0000
commit724ad5f46bbc3e12756f06c8abd641cf1af6cf63 (patch)
treea177ea99da7f088b7b4472ab9ed32448160a7268 /usr.bin/make
parent46d60dd2dd4e4de4b86434db895d03e615129e7d (diff)
tests/make: test target '.DEFAULT'
Diffstat (limited to 'usr.bin/make')
-rw-r--r--usr.bin/make/unit-tests/deptgt-default.exp1
-rw-r--r--usr.bin/make/unit-tests/deptgt-default.mk17
2 files changed, 14 insertions, 4 deletions
diff --git a/usr.bin/make/unit-tests/deptgt-default.exp b/usr.bin/make/unit-tests/deptgt-default.exp
index 39a9383953d..09fca899f06 100644
--- a/usr.bin/make/unit-tests/deptgt-default.exp
+++ b/usr.bin/make/unit-tests/deptgt-default.exp
@@ -1 +1,2 @@
+Default command is making 'not-a-target' from 'not-a-target'.
exit status 0
diff --git a/usr.bin/make/unit-tests/deptgt-default.mk b/usr.bin/make/unit-tests/deptgt-default.mk
index 814eaf72aed..bf5f1653656 100644
--- a/usr.bin/make/unit-tests/deptgt-default.mk
+++ b/usr.bin/make/unit-tests/deptgt-default.mk
@@ -1,8 +1,17 @@
-# $NetBSD: deptgt-default.mk,v 1.2 2020/08/16 14:25:16 rillig Exp $
+# $NetBSD: deptgt-default.mk,v 1.3 2021/12/01 23:56:29 rillig Exp $
#
-# Tests for the special target .DEFAULT in dependency declarations.
+# Tests for the special target .DEFAULT in dependency declarations, which
+# attaches its associated commands to all targets that don't specify any way
+# to create them.
-# TODO: Implementation
+all: test-default not-a-target
+
+test-default: .PHONY
+
+has-commands: .PHONY
+ @echo 'Making ${.TARGET} from ${.IMPSRC}.'
+
+.DEFAULT: dependency-is-ignored
+ @echo "Default command is making '${.TARGET}' from '${.IMPSRC}'."
all:
- @:;