head	1.1;
access;
symbols
	RELENG_9:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2012.10.03.00.41.46;	author marcel;	state Exp;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2012.10.03.00.41.46;	author svnexp;	state dead;
branches;
next	1.1.2.2;

1.1.2.2
date	2014.03.16.00.01.46;	author svnexp;	state Exp;
branches;
next	;


desc
@@


1.1
log
@SVN rev 241146 on 2012-10-03 00:41:46Z by marcel

Merge bmake-20120831 from vendor/NetBSD/bmake/dist.

Provenance: ftp://ftp.netbsd.org/pub/NetBSD/misc/sjg
@
text
@# $Id: forloop,v 1.1.1.1 2012/06/19 23:30:49 sjg Exp $

all: for-loop

LIST = one "two and three" four "five"

.if make(for-fail)
for-fail:

XTRA_LIST = xtra
.else

.for x in ${LIST}
X!= echo 'x=$x' >&2; echo
.endfor

CFL = -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
cfl=
.for x in ${CFL}
X!= echo 'x=$x' >&2; echo
.if empty(cfl)
cfl= $x
.else
cfl+= $x
.endif
.endfor
X!= echo 'cfl=${cfl}' >&2; echo

.if ${cfl} != ${CFL}
.error ${.newline}'${cfl}' != ${.newline}'${CFL}'
.endif

.for a b in ${EMPTY}
X!= echo 'a=$a b=$b' >&2; echo
.endfor
.endif

.for a b in ${LIST} ${LIST:tu} ${XTRA_LIST}
X!= echo 'a=$a b=$b' >&2; echo
.endfor

for-loop:
	@@echo We expect an error next:
	@@(cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} for-fail) && \
	{ echo "Oops that should have failed!"; exit 1; } || echo OK
@


1.1.2.1
log
@file forloop was added on branch RELENG_9 on 2014-03-16 00:01:46 +0000
@
text
@d1 45
@


1.1.2.2
log
@## SVN ## Exported commit - http://svnweb.freebsd.org/changeset/base/263212
## SVN ## CVS IS DEPRECATED: http://wiki.freebsd.org/CvsIsDeprecated
@
text
@a0 45
# $Id: forloop,v 1.1.1.1 2012/06/19 23:30:49 sjg Exp $

all: for-loop

LIST = one "two and three" four "five"

.if make(for-fail)
for-fail:

XTRA_LIST = xtra
.else

.for x in ${LIST}
X!= echo 'x=$x' >&2; echo
.endfor

CFL = -I/this -I"This or that" -Ithat "-DTHIS=\"this and that\""
cfl=
.for x in ${CFL}
X!= echo 'x=$x' >&2; echo
.if empty(cfl)
cfl= $x
.else
cfl+= $x
.endif
.endfor
X!= echo 'cfl=${cfl}' >&2; echo

.if ${cfl} != ${CFL}
.error ${.newline}'${cfl}' != ${.newline}'${CFL}'
.endif

.for a b in ${EMPTY}
X!= echo 'a=$a b=$b' >&2; echo
.endfor
.endif

.for a b in ${LIST} ${LIST:tu} ${XTRA_LIST}
X!= echo 'a=$a b=$b' >&2; echo
.endfor

for-loop:
	@@echo We expect an error next:
	@@(cd ${.CURDIR} && ${.MAKE} -f ${MAKEFILE} for-fail) && \
	{ echo "Oops that should have failed!"; exit 1; } || echo OK
@


