diff options
Diffstat (limited to 'contrib/bmake/unit-tests/archive.mk')
-rw-r--r-- | contrib/bmake/unit-tests/archive.mk | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/contrib/bmake/unit-tests/archive.mk b/contrib/bmake/unit-tests/archive.mk index 2f91005f988c..f8815cf40a40 100644 --- a/contrib/bmake/unit-tests/archive.mk +++ b/contrib/bmake/unit-tests/archive.mk @@ -1,18 +1,15 @@ -# $NetBSD: archive.mk,v 1.10 2020/10/09 06:44:42 rillig Exp $ +# $NetBSD: archive.mk,v 1.11 2020/11/15 14:07:53 rillig Exp $ # # Very basic demonstration of handling archives, based on the description # in PSD.doc/tutorial.ms. # # This test aims at covering the code, not at being an introduction to -# archive handling. That's why it is more complicated and detailed than -# strictly necessary. +# archive handling. That's why it deviates from the tutorial style of +# several other tests. ARCHIVE= libprog.a FILES= archive.mk modmisc.mk varmisc.mk -MAKE_CMD= ${.MAKE} -f ${MAKEFILE} -RUN?= @set -eu; - all: .if ${.PARSEDIR:tA} != ${.CURDIR:tA} @cd ${MAKEFILE:H} && cp ${FILES} [at]*.mk ${.CURDIR} @@ -20,13 +17,13 @@ all: # The following targets create and remove files. The filesystem cache in # dir.c would probably not handle this correctly, therefore each of the # targets is run in its separate sub-make. - ${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 + @${MAKE} -f ${MAKEFILE} remove-archive + @${MAKE} -f ${MAKEFILE} create-archive + @${MAKE} -f ${MAKEFILE} list-archive + @${MAKE} -f ${MAKEFILE} list-archive-wildcard + @${MAKE} -f ${MAKEFILE} depend-on-existing-member + @${MAKE} -f ${MAKEFILE} depend-on-nonexistent-member + @${MAKE} -f ${MAKEFILE} remove-archive create-archive: ${ARCHIVE} pre post @@ -43,15 +40,16 @@ list-archive: ${ARCHIVE} pre post # 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 [at]*.mk. list-archive-wildcard: ${ARCHIVE}([at]*.mk) pre post - ${RUN} printf '%s\n' ${.ALLSRC:O:@member@${.TARGET:Q}': '${member:Q}@} + @printf '%s\n' ${.ALLSRC:O:@member@${.TARGET:Q}': '${member:Q}@} depend-on-existing-member: ${ARCHIVE}(archive.mk) pre post - ${RUN} echo $@ + @echo $@ depend-on-nonexistent-member: ${ARCHIVE}(nonexistent.mk) pre post - ${RUN} echo $@ + @echo $@ remove-archive: pre post rm -f ${ARCHIVE} |