1 # $NetBSD: include-main.mk,v 1.5 2020/09/05 18:18:05 rillig Exp $
3 # Until 2020-09-05, the .INCLUDEDFROMFILE magic variable did not behave
4 # as described in the manual page.
6 # The manual page says that it is the "filename of the file this Makefile
7 # was included from", while before 2020-09-05 it was the "filename in which
8 # the latest .include happened". See parse.c, function ParseSetIncludeFile.
10 # Since 2020-09-05, the .INCLUDEDFROMDIR and .INCLUDEDFROMFILE variables
11 # properly handle nested includes and even .for loops.
13 .if !defined(.INCLUDEDFROMFILE)
16 . warning main-before-fail(${.INCLUDEDFROMFILE})
20 . if !defined(${.INCLUDEDFROMFILE})
21 . info main-before-for-ok
23 . warning main-before-for-fail(${.INCLUDEDFROMFILE})
27 .include "include-sub.mk"
29 .if !defined(.INCLUDEDFROMFILE)
32 . warning main-after-fail(${.INCLUDEDFROMFILE})
36 . if !defined(${.INCLUDEDFROMFILE})
37 . info main-after-for-ok
39 . warning main-after-for-fail(${.INCLUDEDFROMFILE})