Keyboard firmwares for Atmel AVR and Cortex-M
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lufa_doxygen.mk 3.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #
  2. # LUFA Library
  3. # Copyright (C) Dean Camera, 2012.
  4. #
  5. # dean [at] fourwalledcubicle [dot] com
  6. # www.lufa-lib.org
  7. #
  8. LUFA_BUILD_MODULES += DOXYGEN
  9. LUFA_BUILD_TARGETS += doxygen
  10. LUFA_BUILD_MANDATORY_VARS += LUFA_PATH
  11. LUFA_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRIDE_PARAMS
  12. LUFA_BUILD_PROVIDED_VARS +=
  13. LUFA_BUILD_PROVIDED_MACROS +=
  14. # -----------------------------------------------------------------------------
  15. # LUFA Doxygen Buildsystem Makefile Module.
  16. # -----------------------------------------------------------------------------
  17. # DESCRIPTION:
  18. # Provides a set of targets to automatically build Doxygen documentation for
  19. # a project (see www.doxygen.org).
  20. # -----------------------------------------------------------------------------
  21. # TARGETS:
  22. #
  23. # doxygen - Build Doxygen Documentation
  24. #
  25. # MANDATORY PARAMETERS:
  26. #
  27. # LUFA_PATH - Path to the LUFA library core
  28. #
  29. # OPTIONAL PARAMETERS:
  30. #
  31. # DOXYGEN_CONF - Doxygen configuration filename
  32. # DOXYGEN_FAIL_ON_WARNING - Set to Y to fail the build on Doxygen warnings,
  33. # N to continue even if warnings occur
  34. # DOXYGEN_OVERRIDE_PARAMS - Parameters to override in the doxygen
  35. # configuration file
  36. # PROVIDED VARIABLES:
  37. #
  38. # (None)
  39. #
  40. # PROVIDED MACROS:
  41. #
  42. # (None)
  43. #
  44. # -----------------------------------------------------------------------------
  45. SHELL = /bin/sh
  46. ERROR_IF_UNSET ?= $(if $(filter undefined, $(origin $(strip $(1)))), $(error Makefile $(strip $(1)) value not set))
  47. ERROR_IF_EMPTY ?= $(if $(strip $($(strip $(1)))), , $(error Makefile $(strip $(1)) option cannot be blank))
  48. ERROR_IF_NONBOOL ?= $(if $(filter Y N, $($(strip $(1)))), , $(error Makefile $(strip $(1)) option must be Y or N))
  49. # Default values of optionally user-supplied variables
  50. DOXYGEN_CONF ?= Doxygen.conf
  51. DOXYGEN_FAIL_ON_WARNING ?= Y
  52. DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES HTML_STYLESHEET=$(patsubst %/,%,$(LUFA_PATH))/DoxygenPages/Style/Style.css
  53. # Sanity check user supplied values
  54. $(foreach MANDATORY_VAR, $(LUFA_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
  55. $(call ERROR_IF_EMPTY, DOXYGEN_CONF)
  56. $(call ERROR_IF_EMPTY, LUFA_PATH)
  57. $(call ERROR_IF_NONBOOL, DOXYGEN_FAIL_ON_WARNING)
  58. # Output Messages
  59. MSG_DOXYGEN_CMD := ' [DOXYGEN] :'
  60. # Determine Doxygen invocation command
  61. BASE_DOXYGEN_CMD := ( cat $(DOXYGEN_CONF) $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -
  62. ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y)
  63. DOXYGEN_CMD := if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi;
  64. else
  65. DOXYGEN_CMD := $(BASE_DOXYGEN_CMD)
  66. endif
  67. doxygen:
  68. @echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\"
  69. $(DOXYGEN_CMD)
  70. # Phony build targets for this module
  71. .PHONY: doxygen