next round of build system cleanup - convert package/ to new structure
[openwrt.org/openwrt.git] / include / debug.mk
nbd 1 #
2 # Copyright (C) 2007 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 # debug flags:
9 #
10 # d: show subdirectory tree
11 # t: show added targets
12 # l: show legacy targets
13 # v: verbose (no .SILENCE for common targets)
14
15 ifeq ($(DEBUG),all)
16 build_debug:=dltv
17 else
18 build_debug:=$(DEBUG)
19 endif
20
21 define debug
22 $$(findstring $(2),$$(if $$(DEBUG_DIR),$$(if $$(filter $$(DEBUG_DIR)%,$(1)),$(build_debug)),$(build_debug)))
23 endef
24
25 define warn
26 $$(if $(call debug,$(1),$(2)),$$(warning $(3)))
27 endef
28
29 define warn_eval
30 $(call warn,$(1),$(2),$(3) $(4))
31 $(4)
32 endef
33
34
35
comments