Module Name: src
Committed By: rillig
Date: Fri Oct 23 19:23:01 UTC 2020
Modified Files:
src/distrib/sets/lists/tests: mi
src/usr.bin/make/unit-tests: Makefile
Added Files:
src/usr.bin/make/unit-tests: depsrc-end.exp depsrc-end.mk
Log Message:
make(1): add test case in which .BEGIN depends on .END
Just for fun.
To generate a diff of this commit:
cvs rdiff -u -r1.947 -r1.948 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.172 -r1.173 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r0 -r1.1 src/usr.bin/make/unit-tests/depsrc-end.exp \
src/usr.bin/make/unit-tests/depsrc-end.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.947 src/distrib/sets/lists/tests/mi:1.948
--- src/distrib/sets/lists/tests/mi:1.947 Fri Oct 23 19:11:30 2020
+++ src/distrib/sets/lists/tests/mi Fri Oct 23 19:23:00 2020
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.947 2020/10/23 19:11:30 rillig Exp $
+# $NetBSD: mi,v 1.948 2020/10/23 19:23:00 rillig Exp $
#
# Note: don't delete entries from here - mark them as "obsolete" instead.
#
@@ -4641,6 +4641,8 @@
./usr/tests/usr.bin/make/unit-tests/dep-wildcards.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/dep.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/dep.mk tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/depsrc-end.exp tests-usr.bin-tests compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/depsrc-end.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-exec.exp tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-exec.mk tests-usr.bin-tests compattestfile,atf
./usr/tests/usr.bin/make/unit-tests/depsrc-ignore.exp tests-usr.bin-tests compattestfile,atf
Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.172 src/usr.bin/make/unit-tests/Makefile:1.173
--- src/usr.bin/make/unit-tests/Makefile:1.172 Fri Oct 23 19:11:30 2020
+++ src/usr.bin/make/unit-tests/Makefile Fri Oct 23 19:23:01 2020
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.172 2020/10/23 19:11:30 rillig Exp $
+# $NetBSD: Makefile,v 1.173 2020/10/23 19:23:01 rillig Exp $
#
# Unit tests for make(1)
#
@@ -81,6 +81,7 @@ TESTS+= dep-none
TESTS+= dep-var
TESTS+= dep-wildcards
TESTS+= depsrc
+TESTS+= depsrc-end
TESTS+= depsrc-exec
TESTS+= depsrc-ignore
TESTS+= depsrc-made
Added files:
Index: src/usr.bin/make/unit-tests/depsrc-end.exp
diff -u /dev/null src/usr.bin/make/unit-tests/depsrc-end.exp:1.1
--- /dev/null Fri Oct 23 19:23:01 2020
+++ src/usr.bin/make/unit-tests/depsrc-end.exp Fri Oct 23 19:23:01 2020
@@ -0,0 +1,4 @@
+: 'Making .END.'
+: 'Making .BEGIN.'
+: 'Making all.'
+exit status 0
Index: src/usr.bin/make/unit-tests/depsrc-end.mk
diff -u /dev/null src/usr.bin/make/unit-tests/depsrc-end.mk:1.1
--- /dev/null Fri Oct 23 19:23:01 2020
+++ src/usr.bin/make/unit-tests/depsrc-end.mk Fri Oct 23 19:23:01 2020
@@ -0,0 +1,14 @@
+# $NetBSD: depsrc-end.mk,v 1.1 2020/10/23 19:23:01 rillig Exp $
+#
+# Demonstrate the edge case that .BEGIN depends on .END, which sounds a bit
+# paradox but works since these special nodes are not in the dependency
+# hierarchy where the cycles are detected.
+
+.BEGIN:
+ : 'Making ${.TARGET}.'
+.END:
+ : 'Making ${.TARGET}.'
+all:
+ : 'Making ${.TARGET}.'
+
+.BEGIN: .END