1 # $NetBSD: cond1.mk,v 1.3 2020/11/15 14:58:14 rillig Exp $
3 # TODO: Convert these tests into tutorial form.
4 # TODO: Split these tests by topic.
5 # TODO: Use better variable names and expression values that actually express
6 # the intended behavior. uname(1) has nothing to do with conditions.
16 .if ("${TEST_UNAME_S}")
19 .if (${TEST_UNAME_M} != ${TEST_MACHINE})
22 .if ${TEST_UNAME_M} != ${TEST_MACHINE}
25 .if !((${TEST_UNAME_M} != ${TEST_MACHINE}) && defined(X))
26 Ok+= !((var != var) && defined(name)),
34 .if defined(notMAKEOBJDIRPREFIX) || defined(norMAKEOBJDIR)
35 .if defined(notMAKEOBJDIRPREFIX)
36 o=${MAKEOBJDIRPREFIX}${__curdir}
44 # repeat the above to check we get the same result
48 .if defined(notMAKEOBJDIRPREFIX) || defined(norMAKEOBJDIR)
49 .if defined(notMAKEOBJDIRPREFIX)
50 o2=${MAKEOBJDIRPREFIX}${__curdir}
62 .if ${PRIMES:M$n} == ""
68 .if ${MACHINE_ARCH} == no-such
71 .if ${MACHINE_ARCH} == not-this
72 .if ${MACHINE_ARCH} == something-else
79 # We expect an extra else warning - we're not skipping here
81 A=this should be an error
89 # We expect an extra else warning - we are skipping here
91 B=this should be an error
97 .if "quoted" == quoted
103 .if defined(nosuch) && ${nosuch:Mx} != ""
104 # this should not happen
109 @echo "$n is $X prime"
110 @echo "A='$A' B='$B' C='$C' o='$o,${o2}'"
111 @echo "Passed:${.newline} ${Ok:S/,/${.newline}/}"
112 @echo "${NUMBERS:@n@$n is ${("${PRIMES:M$n}" == ""):?not:} prime${.newline}@}"
113 @echo "${"${DoNotQuoteHere:U0}" > 0:?OK:No}"
114 @echo "${${NoSuchNumber:U42} > 0:?OK:No}"