]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/bmake/unit-tests/include-main.mk
Update to bmake-20200517
[FreeBSD/FreeBSD.git] / contrib / bmake / unit-tests / include-main.mk
1 # $NetBSD: include-main.mk,v 1.1 2020/05/17 12:36:26 rillig Exp $
2 #
3 # Demonstrates that the .INCLUDEDFROMFILE magic variable does not behave
4 # as described in the manual page.
5 #
6 # The manual page says that it is the "filename of the file this Makefile
7 # was included from", while in reality it is the "filename in which the
8 # latest .include happened".
9 #
10
11 .if !defined(.INCLUDEDFROMFILE)
12 LOG+=           main-before-ok
13 .else
14 .  for f in ${.INCLUDEDFROMFILE}
15 LOG+=           main-before-fail\(${f:Q}\)
16 .  endfor
17 .endif
18
19 .include "include-sub.mk"
20
21 .if !defined(.INCLUDEDFROMFILE)
22 LOG+=           main-after-ok
23 .else
24 .  for f in ${.INCLUDEDFROMFILE}
25 LOG+=           main-after-fail\(${f:Q}\)
26 .  endfor
27 .endif
28
29 all:
30         @printf '%s\n' ${LOG}