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