xref: /freebsd/contrib/bmake/unit-tests/directive-if-nested.mk (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1# $NetBSD: directive-if-nested.mk,v 1.1 2020/11/10 22:23:37 rillig Exp $
2#
3# Tests for deeply nested .if directives.  By default, memory for 128 nested
4# .if directives is pre-allocated, any deeper nesting is reallocated.
5#
6# See also:
7#	Cond_EvalLine
8
9GEN=	directive-if-nested.inc
10
11all: set-up test tear-down
12
13set-up: .PHONY
14	@{ printf '.if %s\n' ${:U:range=1000};				\
15	   printf '.info deeply nested .if directives\n';		\
16	   printf '.endif # %s\n' ${:U:range=1000};			\
17	   printf '\n';							\
18	   printf 'all:\n';						\
19	} > ${GEN}
20
21test: .PHONY
22	@${MAKE} -f ${GEN}
23
24tear-down: .PHONY
25	@rm -f ${GEN}
26