1 # $Id: forloop.mk,v 1.1.1.3 2020/09/02 18:35:14 sjg Exp $
5 LIST = one "two and three" four "five"
14 X!= echo 'x=$x' >&2; echo
17 CFL = -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
20 X!= echo 'x=$x' >&2; echo
27 X!= echo 'cfl=${cfl}' >&2; echo
30 .error ${.newline}'${cfl}' != ${.newline}'${CFL}'
34 X!= echo 'a=$a b=$b' >&2; echo
37 # Since at least 1993, iteration stops at the first newline.
38 # Back then, the .newline variable didn't exist, therefore it was unlikely
39 # that a newline ever occurred.
40 .for var in a${.newline}b${.newline}c
41 X!= echo 'newline-item=('${var:Q}')' 1>&2; echo
46 .for a b in ${LIST} ${LIST:tu} ${XTRA_LIST}
47 X!= echo 'a=$a b=$b' >&2; echo
51 @echo We expect an error next:
52 @(cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} for-fail) && \
53 { echo "Oops that should have failed!"; exit 1; } || echo OK