1# $NetBSD: modmatch.mk,v 1.9 2020/10/24 08:50:17 rillig Exp $
2#
3# Tests for the :M and :S modifiers.
4
5X=	a b c d e
6
7.for x in $X
8LIB${x:tu}=	/tmp/lib$x.a
9.endfor
10
11X_LIBS=	${LIBA} ${LIBD} ${LIBE}
12
13LIB?=	a
14
15var=	head
16res=	no
17.if !empty(var:M${:Uhead\:tail:C/:.*//})
18res=	OK
19.endif
20
21all:	show-libs
22
23show-libs:
24	@for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done
25	@echo "Mscanner=${res}"
26
27show:
28	@echo 'LIB=${LIB} X_LIBS:M$${LIB$${LIB:tu}} is "${X_LIBS:M${LIB${LIB:tu}}}"'
29	@echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a is "${X_LIBS:M*/lib${LIB}.a}"'
30	@echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a:tu is "${X_LIBS:M*/lib${LIB}.a:tu}"'
31