]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/include-sub.mk
Merge bmake-20201117
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / include-sub.mk
1 # $NetBSD: include-sub.mk,v 1.7 2020/11/02 19:07:09 rillig Exp $
2
3 .if ${.INCLUDEDFROMFILE} == "include-main.mk"
4 .  info sub-before-ok
5 .else
6 .  warning sub-before-fail(${.INCLUDEDFROMFILE})
7 .endif
8
9 # As of 2020-09-05, the .for loop is implemented as "including a file"
10 # with a custom buffer.  Therefore this loop has side effects on these
11 # variables.
12 .for i in once
13 .  if ${.INCLUDEDFROMFILE} == "include-main.mk"
14 .    info sub-before-for-ok
15 .  else
16 .    warning sub-before-for-fail(${.INCLUDEDFROMFILE})
17 .  endif
18 .endfor
19
20 # To see the variable 'includes' in action:
21 #
22 # Breakpoints:
23 #       Parse_File              at "Vector_Push(&includes)"
24 #       ParseMessage            at entry
25 # Watches:
26 #       ((const IFile *[10])(*includes.items))
27 #       *curFile
28
29 .for i in deeply
30 .  for i in nested
31 .    for i in include
32 .include "include-subsub.mk"
33 .    endfor
34 .  endfor
35 .endfor
36
37 .if ${.INCLUDEDFROMFILE} == "include-main.mk"
38 .  info sub-after-ok
39 .else
40 .  warning sub-after-fail(${.INCLUDEDFROMFILE})
41 .endif
42
43 .for i in once
44 .  if ${.INCLUDEDFROMFILE} == "include-main.mk"
45 .    info sub-after-for-ok
46 .  else
47 .    warning sub-after-for-fail(${.INCLUDEDFROMFILE})
48 .  endif
49 .endfor