xref: /minix3/usr.bin/make/unit-tests/cond2.mk (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc# $Id: cond2.mk,v 1.1 2015/05/05 21:51:09 sjg Exp $
2*0a6a1f1dSLionel Sambuc
3*0a6a1f1dSLionel SambucTEST_UNAME_S= NetBSD
4*0a6a1f1dSLionel Sambuc
5*0a6a1f1dSLionel Sambuc# this should be ok
6*0a6a1f1dSLionel SambucX:= ${${TEST_UNAME_S} == "NetBSD":?Ok:fail}
7*0a6a1f1dSLionel Sambuc.if $X == "Ok"
8*0a6a1f1dSLionel SambucY= good
9*0a6a1f1dSLionel Sambuc.endif
10*0a6a1f1dSLionel Sambuc# expect: Bad conditional expression ` == "empty"' in  == "empty"?oops:ok
11*0a6a1f1dSLionel SambucX:= ${${TEST_NOT_SET} == "empty":?oops:ok}
12*0a6a1f1dSLionel Sambuc# expect: Malformed conditional ({TEST_TYPO} == "Ok")
13*0a6a1f1dSLionel Sambuc.if {TEST_TYPO} == "Ok"
14*0a6a1f1dSLionel SambucY= oops
15*0a6a1f1dSLionel Sambuc.endif
16*0a6a1f1dSLionel Sambuc.if empty(TEST_NOT_SET)
17*0a6a1f1dSLionel SambucY!= echo TEST_NOT_SET is empty or not defined >&2; echo
18*0a6a1f1dSLionel Sambuc.endif
19*0a6a1f1dSLionel Sambuc# expect: Malformed conditional (${TEST_NOT_SET} == "empty")
20*0a6a1f1dSLionel Sambuc.if ${TEST_NOT_SET} == "empty"
21*0a6a1f1dSLionel SambucY= oops
22*0a6a1f1dSLionel Sambuc.endif
23*0a6a1f1dSLionel Sambuc
24*0a6a1f1dSLionel Sambucall:
25*0a6a1f1dSLionel Sambuc	@echo $@
26