Module Name:    src
Committed By:   rillig
Date:           Sun Jan 12 23:10:30 UTC 2025

Modified Files:
        src/usr.bin/make/unit-tests: suff.exp suff.mk

Log Message:
tests/make: fix suffix rule test in ATF mode


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/suff.exp \
    src/usr.bin/make/unit-tests/suff.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/make/unit-tests/suff.exp
diff -u src/usr.bin/make/unit-tests/suff.exp:1.1 src/usr.bin/make/unit-tests/suff.exp:1.2
--- src/usr.bin/make/unit-tests/suff.exp:1.1	Fri Jan 10 23:00:38 2025
+++ src/usr.bin/make/unit-tests/suff.exp	Sun Jan 12 23:10:30 2025
@@ -6,10 +6,10 @@ inserting ".to" (2) at end of list
 transformation .from.to complete
 Var_Parse: ${.PREFIX}${.ARCHIVE}.additional (eval-defined)
 Var_Parse: ${.ARCHIVE}.additional (eval-defined)
-Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional
-Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from
-Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional
-Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk
+Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional
+Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from
+Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional
+Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk
 Global: delete .PARSEDIR
 Global: delete .PARSEFILE
 Global: ignoring delete '.INCLUDEDFROMDIR' as it is not found
@@ -33,17 +33,16 @@ Command: ignoring delete 'v' as it is no
 Result of ${.MAKEOVERRIDES:@v@$v=${$v:Q}@} is ""
 Global: .INCLUDES = # (empty)
 Global: .LIBS = # (empty)
-Global: .TARGETS =  all
 Global: ignoring delete '.SHELL' as it is not found
 Command: .SHELL = /bin/sh
-Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk .END
-all: @ = all
-all: @ = all
-all: * = all
-SuffFindDeps "all"
-all: @ = all
-all: * = all
-	No valid suffix on all
+Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk .END
+step1: @ = step1
+step1: @ = step1
+step1: * = step1
+SuffFindDeps "step1"
+step1: @ = step1
+step1: * = step1
+	No valid suffix on step1
 Wildcard expanding "edge-case.to"...suffix is ".to"...
 edge-case.to: @ = edge-case.to
 edge-case.to: @ = edge-case.to
@@ -63,8 +62,8 @@ SuffFindDeps "everything"
 everything: @ = everything
 everything: * = everything
 Wildcard expanding "a*.mk"...
-archive-suffix.mk...Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk .END archive-suffix.mk
-archive.mk...Global: .ALLTARGETS =  all edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk .END archive-suffix.mk archive.mk
+archive-suffix.mk...Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk .END archive-suffix.mk
+archive.mk...Global: .ALLTARGETS =  step1 edge-case.to everything ${.PREFIX}${.ARCHIVE}.additional edge-case.from edge-case.additional a*.mk .END archive-suffix.mk archive.mk
 
 	No valid suffix on everything
 Wildcard expanding "edge-case.additional"...
@@ -130,10 +129,10 @@ everything: ? = archive-suffix.mk archiv
 Var_Parse: ${.TARGET} from ${.ALLSRC}. (eval)
 Var_Parse: ${.ALLSRC}. (eval)
 : Making everything from archive-suffix.mk archive.mk.
-all: > = edge-case.to
-all: ? = edge-case.to
-all: > = edge-case.to everything
-all: ? = edge-case.to everything
+step1: > = edge-case.to
+step1: ? = edge-case.to
+step1: > = edge-case.to everything
+step1: ? = edge-case.to everything
 .END: @ = .END
 .END: * = .END
 SuffFindDeps ".END"
Index: src/usr.bin/make/unit-tests/suff.mk
diff -u src/usr.bin/make/unit-tests/suff.mk:1.1 src/usr.bin/make/unit-tests/suff.mk:1.2
--- src/usr.bin/make/unit-tests/suff.mk:1.1	Fri Jan 10 23:00:38 2025
+++ src/usr.bin/make/unit-tests/suff.mk	Sun Jan 12 23:10:30 2025
@@ -1,8 +1,26 @@
-# $NetBSD: suff.mk,v 1.1 2025/01/10 23:00:38 rillig Exp $
+# $NetBSD: suff.mk,v 1.2 2025/01/12 23:10:30 rillig Exp $
 #
 # Demonstrate suffix rules and dependency resolution.
 
-all: .PHONY edge-case.to everything
+
+# Circumvent the file system cache.
+.if !make(init) && !make(step*)
+all:
+	@${MAKE} -f ${MAKEFILE} init
+	@${MAKE} -f ${MAKEFILE} step1
+.endif
+
+
+.if make(init)
+init:
+.  if ${.PARSEDIR:tA} != ${.CURDIR:tA}
+${:U}!=		cd ${MAKEFILE:H} && cp a*.mk ${.CURDIR}
+.  endif
+.endif
+
+
+.if make(step1)
+step1: .PHONY edge-case.to everything
 
 .MAKEFLAGS: -dsv
 
@@ -20,3 +38,4 @@ edge-case.from edge-case.additional:
 
 everything: .PHONY a*.mk
 	: Making ${.TARGET} from ${.ALLSRC}.
+.endif

Reply via email to