Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make/unit-tests make(1): test that .PHONY targets ar...



details:   https://anonhg.NetBSD.org/src/rev/3f3849bd467e
branches:  trunk
changeset: 957289:3f3849bd467e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Nov 23 15:00:32 2020 +0000

description:
make(1): test that .PHONY targets are not resolved using suffix rules

diffstat:

 distrib/sets/lists/tests/mi            |   4 +++-
 usr.bin/make/unit-tests/Makefile       |   3 ++-
 usr.bin/make/unit-tests/suff-phony.exp |  13 +++++++++++++
 usr.bin/make/unit-tests/suff-phony.mk  |  21 +++++++++++++++++++++
 4 files changed, 39 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r a988243e1bb8 -r 3f3849bd467e distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Mon Nov 23 14:47:12 2020 +0000
+++ b/distrib/sets/lists/tests/mi       Mon Nov 23 15:00:32 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.974 2020/11/22 23:45:20 rillig Exp $
+# $NetBSD: mi,v 1.975 2020/11/23 15:00:32 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5289,6 +5289,8 @@
 ./usr/tests/usr.bin/make/unit-tests/suff-main-several.mk                       tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-main.exp                              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-main.mk                               tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-phony.exp                             tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/make/unit-tests/suff-phony.mk                              tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-rebuild.exp                           tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-rebuild.mk                            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/make/unit-tests/suff-self.exp                              tests-usr.bin-tests     compattestfile,atf
diff -r a988243e1bb8 -r 3f3849bd467e usr.bin/make/unit-tests/Makefile
--- a/usr.bin/make/unit-tests/Makefile  Mon Nov 23 14:47:12 2020 +0000
+++ b/usr.bin/make/unit-tests/Makefile  Mon Nov 23 15:00:32 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.219 2020/11/22 23:45:20 rillig Exp $
+# $NetBSD: Makefile,v 1.220 2020/11/23 15:00:32 rillig Exp $
 #
 # Unit tests for make(1)
 #
@@ -268,6 +268,7 @@
 TESTS+=                suff-lookup
 TESTS+=                suff-main
 TESTS+=                suff-main-several
+TESTS+=                suff-phony
 TESTS+=                suff-rebuild
 TESTS+=                suff-self
 TESTS+=                suff-transform-debug
diff -r a988243e1bb8 -r 3f3849bd467e usr.bin/make/unit-tests/suff-phony.exp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/suff-phony.exp    Mon Nov 23 15:00:32 2020 +0000
@@ -0,0 +1,13 @@
+Adding suffix ".c"
+defining transformation from `.c' to `'
+inserting ".c" (1) at end of list
+inserting "" (0) at end of list
+transformation .c complete
+SuffFindDeps "all"
+       No valid suffix on all
+SuffFindDeps ".END"
+       No known suffix on .END. Using .NULL suffix
+adding suffix rules
+       trying .END.c...not there
+Wildcard expanding ".END"...
+exit status 0
diff -r a988243e1bb8 -r 3f3849bd467e usr.bin/make/unit-tests/suff-phony.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/usr.bin/make/unit-tests/suff-phony.mk     Mon Nov 23 15:00:32 2020 +0000
@@ -0,0 +1,21 @@
+# $NetBSD: suff-phony.mk,v 1.1 2020/11/23 15:00:32 rillig Exp $
+#
+# Test that .PHONY targets are not resolved using suffix rules.
+#
+# The purpose of the .PHONY attribute is to mark them as independent from the
+# file system.
+#
+# See also:
+#      FindDepsRegular, Ctrl+F OP_PHONY
+
+.MAKEFLAGS: -ds
+
+all: .PHONY
+
+.SUFFIXES: .c
+
+.c:
+       : Making ${.TARGET} from ${.IMPSRC}.
+
+all.c:
+       : Making ${.TARGET} out of nothing.



Home | Main Index | Thread Index | Old Index