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): add test for wildcards in a...
details: https://anonhg.NetBSD.org/src/rev/a8f4dee4342c
branches: trunk
changeset: 937692:a8f4dee4342c
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Aug 23 17:34:46 2020 +0000
description:
make(1): add test for wildcards in archive dependency
diffstat:
usr.bin/make/unit-tests/archive.exp | 1 +
usr.bin/make/unit-tests/archive.mk | 9 ++++++++-
2 files changed, 9 insertions(+), 1 deletions(-)
diffs (41 lines):
diff -r c187cac683c0 -r a8f4dee4342c usr.bin/make/unit-tests/archive.exp
--- a/usr.bin/make/unit-tests/archive.exp Sun Aug 23 17:22:52 2020 +0000
+++ b/usr.bin/make/unit-tests/archive.exp Sun Aug 23 17:34:46 2020 +0000
@@ -5,6 +5,7 @@
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
diff -r c187cac683c0 -r a8f4dee4342c usr.bin/make/unit-tests/archive.mk
--- a/usr.bin/make/unit-tests/archive.mk Sun Aug 23 17:22:52 2020 +0000
+++ b/usr.bin/make/unit-tests/archive.mk Sun Aug 23 17:34:46 2020 +0000
@@ -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 @@
${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 @@
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 $@
Home |
Main Index |
Thread Index |
Old Index