NetBSD/usr.bin/make/unit-tests/include-subsub.mk
rillig bf988a5d2f make(1): in -dp mode, print stack trace with each diagnostic
This makes it easier to track down where a warning or an error
originated from.  This information could be further enriched for .for
loops, to also include the variable names and their values.  For now,
it's good enough to replace the large comment describing how a stack
trace _could_ be generated with actual code that implements that idea.

The syntax of the locations is <filename>:<lineno>, which intentionally
differs from the traditional "<filename>" line <lineno>, since the
former is more widely supported by editors and IDEs.

Having this stacktrace information is especially intended for
complicated systems built upon make, such as pkgsrc.
2021-01-26 23:44:56 +00:00

10 lines
222 B
Makefile

# $NetBSD: include-subsub.mk,v 1.4 2021/01/26 23:44:56 rillig Exp $
.if ${.INCLUDEDFROMFILE} == "include-sub.mk"
.MAKEFLAGS: -dp
. info subsub-ok
.MAKEFLAGS: -d0
.else
. warning subsub-fail(${.INCLUDEDFROMFILE})
.endif