]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/modmatch.mk
Update to bmake-20200704
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / modmatch.mk
1
2 X=a b c d e
3
4 .for x in $X
5 LIB${x:tu}=/tmp/lib$x.a
6 .endfor
7
8 X_LIBS= ${LIBA} ${LIBD} ${LIBE}
9
10 LIB?=a
11
12 var = head
13 res = no
14 .if !empty(var:M${:Uhead\:tail:C/:.*//})
15 res = OK
16 .endif
17
18 all:    show-libs check-cclass slow
19
20 show-libs:
21         @for x in $X; do ${.MAKE} -f ${MAKEFILE} show LIB=$$x; done
22         @echo "Mscanner=${res}"
23
24 show:
25         @echo 'LIB=${LIB} X_LIBS:M$${LIB$${LIB:tu}} is "${X_LIBS:M${LIB${LIB:tu}}}"'
26         @echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a is "${X_LIBS:M*/lib${LIB}.a}"'
27         @echo 'LIB=${LIB} X_LIBS:M*/lib$${LIB}.a:tu is "${X_LIBS:M*/lib${LIB}.a:tu}"'
28
29 LIST= One Two Three Four five six seven
30
31 check-cclass:
32         @echo Upper=${LIST:M[A-Z]*}
33         @echo Lower=${LIST:M[^A-Z]*}
34         @echo nose=${LIST:M[^s]*[ex]}
35
36 # Before 2020-06-13, this expression took quite a long time in Str_Match,
37 # calling itself 601080390 times for 16 asterisks.
38 slow: .PHONY
39         @:;: ${:U****************:M****************b:Q}