Module Name:    src
Committed By:   rillig
Date:           Sun Aug 23 17:34:46 UTC 2020

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

Log Message:
make(1): add test for wildcards in archive dependency


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/usr.bin/make/unit-tests/archive.exp
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/make/unit-tests/archive.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/archive.exp
diff -u src/usr.bin/make/unit-tests/archive.exp:1.2 src/usr.bin/make/unit-tests/archive.exp:1.3
--- src/usr.bin/make/unit-tests/archive.exp:1.2	Sun Aug 16 14:39:50 2020
+++ src/usr.bin/make/unit-tests/archive.exp	Sun Aug 23 17:34:46 2020
@@ -5,6 +5,7 @@ ar t libprog.a
 archive.mk
 modmisc.mk
 varmisc.mk
+list-archive-wildcard: archive.mk
 depend-on-existing-member
 `depend-on-nonexistent-member' is up to date.
 rm -f libprog.a

Index: src/usr.bin/make/unit-tests/archive.mk
diff -u src/usr.bin/make/unit-tests/archive.mk:1.3 src/usr.bin/make/unit-tests/archive.mk:1.4
--- src/usr.bin/make/unit-tests/archive.mk:1.3	Sun Aug 16 14:39:50 2020
+++ src/usr.bin/make/unit-tests/archive.mk	Sun Aug 23 17:34:46 2020
@@ -1,4 +1,4 @@
-# $NetBSD: archive.mk,v 1.3 2020/08/16 14:39:50 rillig Exp $
+# $NetBSD: archive.mk,v 1.4 2020/08/23 17:34:46 rillig Exp $
 #
 # Very basic demonstration of handling archives, based on the description
 # in PSD.doc/tutorial.ms.
@@ -16,6 +16,7 @@ all:
 	${RUN} ${MAKE_CMD} remove-archive
 	${RUN} ${MAKE_CMD} create-archive
 	${RUN} ${MAKE_CMD} list-archive
+	${RUN} ${MAKE_CMD} list-archive-wildcard
 	${RUN} ${MAKE_CMD} depend-on-existing-member
 	${RUN} ${MAKE_CMD} depend-on-nonexistent-member
 	${RUN} ${MAKE_CMD} remove-archive
@@ -28,6 +29,12 @@ ${ARCHIVE}: ${ARCHIVE}(${FILES})
 list-archive: ${ARCHIVE}
 	ar t ${.ALLSRC}
 
+# XXX: I had expected that this dependency would select all *.mk files from
+# the archive.  Instead, the globbing is done in the current directory.
+# To prevent an overly long file list, the pattern is restricted to ar*.mk.
+list-archive-wildcard: ${ARCHIVE}(ar*.mk)
+	${RUN} printf '%s\n' ${.ALLSRC:O:@member@${.TARGET:Q}': '${member:Q}@}
+
 depend-on-existing-member: ${ARCHIVE}(archive.mk)
 	${RUN} echo $@
 

Reply via email to