aboutsummaryrefslogtreecommitdiff
path: root/contrib/bmake/unit-tests/directive-endif.mk
blob: 10dd6ce22ce82c9478d2e7ae61e1c2eb610bcf59 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# $NetBSD: directive-endif.mk,v 1.5 2020/12/14 21:56:17 rillig Exp $
#
# Tests for the .endif directive.
#
# Since 2020-12-15, the .endif directive no longer accepts arguments.
# The manual page had never allowed that, but the code didn't check it.
#
# See also:
#	Cond_EvalLine

# TODO: Implementation

.MAKEFLAGS: -dL

# Error: .endif does not take arguments
.if 0
# Since 2020-12-15, complain about the extra text after the 'endif'.
.endif 0

# Error: .endif does not take arguments
.if 1
# Since 2020-12-15, complain about the extra text after the 'endif'.
.endif 1

# Comments are allowed after an '.endif'.
.if 2
.endif # comment

# Only whitespace and comments are allowed after an '.endif', but nothing
# else.
.if 1
# Since 2020-12-15, complain about the extra text after the 'endif'.
.endif0

# Only whitespace and comments are allowed after an '.endif', but nothing
# else.
.if 1
# Since 2020-12-15, complain about the extra text after the 'endif'.
.endif/

# After an '.endif', no other letter must occur.  This 'endifx' is not
# parsed as an 'endif', therefore another '.endif' must follow to balance
# the directives.
.if 1
.endifx
.endif # to close the preceding '.if'

all:
	@:;