xref: /freebsd/contrib/bmake/mk/sys.debug.mk (revision 8aac90f18aef7c9eea906c3ff9a001ca7b94f375)
1# SPDX-License-Identifier: BSD-2-Clause
2#
3# $Id: sys.debug.mk,v 1.3 2024/02/17 17:26:57 sjg Exp $
4#
5#	@(#) Copyright (c) 2009, Simon J. Gerraty
6#
7#	This file is provided in the hope that it will
8#	be of use.  There is absolutely NO WARRANTY.
9#	Permission to copy, redistribute or otherwise
10#	use this file is hereby granted provided that
11#	the above copyright notice and this notice are
12#	left intact.
13#
14#	Please send copies of changes and bug-fixes to:
15#	sjg@crufty.net
16#
17
18# Sometimes we want to turn on debugging in just one or two places
19# if .CURDIR is matched by any entry in DEBUG_MAKE_SYS_DIRS we
20# will apply DEBUG_MAKE_FLAGS now.
21# if an entry in DEBUG_MAKE_DIRS matches, we at the end of sys.mk
22# eg.  DEBUG_MAKE_FLAGS=-dv DEBUG_MAKE_SYS_DIRS="*lib/sjg"
23# use DEBUG_MAKE_FLAGS0 to apply only to .MAKE.LEVEL 0
24#
25.if ${.MAKE.LEVEL:U1} == 0
26# we use indirection, to simplify the tests below, and incase
27# DEBUG_* were given on our command line.
28_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS0}
29_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS0:U${DEBUG_MAKE_SYS_DIRS}}
30_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS0:U${DEBUG_MAKE_DIRS}}
31.else
32_DEBUG_MAKE_FLAGS = ${DEBUG_MAKE_FLAGS}
33_DEBUG_MAKE_SYS_DIRS = ${DEBUG_MAKE_SYS_DIRS}
34_DEBUG_MAKE_DIRS = ${DEBUG_MAKE_DIRS}
35.endif
36