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# r: show autorebuild messages 14# v: verbose (no .SILENCE for common targets) 15 16ifeq ($(DUMP),) 17 ifeq ($(DEBUG),all) 18 build_debug:=dltvr 19 else 20 build_debug:=$(DEBUG) 21 endif 22endif 23 24define debug 25$$(findstring $(2),$$(if $$(DEBUG_DIR),$$(if $$(filter $$(DEBUG_DIR)%,$(1)),$(build_debug)),$(build_debug))) 26endef 27 28define warn 29$$(if $(call debug,$(1),$(2)),$$(warning $(3))) 30endef 31 32define debug_eval 33$$(if $(call debug,$(1),$(2)),$(3)) 34endef 35 36define warn_eval 37$(call warn,$(1),$(2),$(3) $(4)) 38$(4) 39endef 40 41 42