aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-if-nested.mk
blob: 93fce90b5d52895a723f0d2edfaed2e22aa230ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# $NetBSD: directive-if-nested.mk,v 1.2 2025/01/03 05:00:37 rillig Exp $
#
# Tests for deeply nested .if directives.  By default, memory for 128 nested
# .if directives is pre-allocated, any deeper nesting is reallocated.
#
# See also:
#	Cond_EvalLine

GEN=	directive-if-nested.inc

all: set-up test tear-down

set-up: .PHONY
	@{ printf '.if %s\n' ${:U:range=1000};				\
	   printf '.info deeply nested .if directives\n';		\
	   printf '.endif # %s\n' ${:U:range=1000:[-1..1]};		\
	   printf '\n';							\
	   printf 'all:\n';						\
	} > ${GEN}

test: .PHONY
	@${MAKE} -f ${GEN}

tear-down: .PHONY
	@rm -f ${GEN}