summaryrefslogtreecommitdiff
path: root/usr.bin/make/unit-tests/include-sub.mk
blob: 57d2aafe9d1d5e234de17e2a678943f53eedc4f5 (plain)
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: include-sub.mk,v 1.9 2022/01/08 23:41:43 rillig Exp $

.if ${.INCLUDEDFROMFILE} == "include-main.mk"
.  info sub-before-ok
.else
.  warning sub-before-fail(${.INCLUDEDFROMFILE})
.endif

# As of 2020-09-05, the .for loop is implemented as "including a file"
# with a custom buffer.  Therefore this loop has side effects on these
# variables.
.for i in once
.  if ${.INCLUDEDFROMFILE} == "include-main.mk"
.    info sub-before-for-ok
.  else
.    warning sub-before-for-fail(${.INCLUDEDFROMFILE})
.  endif
.endfor

# To see the variable 'includes' in action:
#
# Breakpoints:
#	Parse_PushInput		at "Vector_Push(&includes)"
#	HandleMessage		at entry
# Watches:
#	((const IncludedFile *[10])(*includes.items))
#	*CurFile()

.for i in deeply
.  for i in nested
.    for i in include
.include "include-subsub.mk"
.    endfor
.  endfor
.endfor

.if ${.INCLUDEDFROMFILE} == "include-main.mk"
.  info sub-after-ok
.else
.  warning sub-after-fail(${.INCLUDEDFROMFILE})
.endif

.for i in once
.  if ${.INCLUDEDFROMFILE} == "include-main.mk"
.    info sub-after-for-ok
.  else
.    warning sub-after-for-fail(${.INCLUDEDFROMFILE})
.  endif
.endfor