debug.mk 629 B

12345678910111213141516171819202122232425262728293031323334
  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. # debug flags:
  8. #
  9. # d: show subdirectory tree
  10. # t: show added targets
  11. # l: show legacy targets
  12. # v: verbose (no .SILENCE for common targets)
  13. ifeq ($(DEBUG),all)
  14. build_debug:=dltv
  15. else
  16. build_debug:=$(DEBUG)
  17. endif
  18. define debug
  19. $$(findstring $(2),$$(if $$(DEBUG_DIR),$$(if $$(filter $$(DEBUG_DIR)%,$(1)),$(build_debug)),$(build_debug)))
  20. endef
  21. define warn
  22. $$(if $(call debug,$(1),$(2)),$$(warning $(3)))
  23. endef
  24. define warn_eval
  25. $(call warn,$(1),$(2),$(3) $(4))
  26. $(4)
  27. endef