Update Drone CI image path.
[pub/USBasp.git] / LUFA / Build / DMBS / DMBS / doxygen.mk
1 #
2 # DMBS Build System
3 # Released into the public domain.
4 #
5 # dean [at] fourwalledcubicle [dot] com
6 # www.fourwalledcubicle.com
7 #
8
9 DMBS_BUILD_MODULES += DOXYGEN
10 DMBS_BUILD_TARGETS += doxygen doxygen-upgrade doxygen-create
11 DMBS_BUILD_MANDATORY_VARS +=
12 DMBS_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRIDE_PARAMS
13 DMBS_BUILD_PROVIDED_VARS +=
14 DMBS_BUILD_PROVIDED_MACROS +=
15
16 # Import the CORE module of DMBS
17 DMBS_MODULE_PATH := $(patsubst %/,%,$(dir $(lastword $(MAKEFILE_LIST))))
18 include $(DMBS_MODULE_PATH)/core.mk
19
20 # Default values of optionally user-supplied variables
21 DOXYGEN_CONF ?= doxyfile
22 DOXYGEN_FAIL_ON_WARNING ?= Y
23 DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES
24
25 # Sanity check user supplied values
26 $(foreach MANDATORY_VAR, $(DMBS_BUILD_MANDATORY_VARS), $(call ERROR_IF_UNSET, $(MANDATORY_VAR)))
27 $(call ERROR_IF_EMPTY, DOXYGEN_CONF)
28 $(call ERROR_IF_NONBOOL, DOXYGEN_FAIL_ON_WARNING)
29
30 # Output Messages
31 MSG_DOXYGEN_CMD := ' [DOXYGEN] :'
32
33 # Determine Doxygen invocation command
34 BASE_DOXYGEN_CMD := ( cat $(DOXYGEN_CONF) $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -
35 ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y)
36 DOXYGEN_CMD := if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi;
37 else
38 DOXYGEN_CMD := $(BASE_DOXYGEN_CMD)
39 endif
40
41 # Error if the specified Doxygen configuration file does not exist
42 $(DOXYGEN_CONF):
43 $(error Doxygen configuration file $@ does not exist)
44
45 # Builds the project documentation using the specified configuration file and the DOXYGEN tool
46 doxygen: $(DOXYGEN_CONF) $(MAKEFILE_LIST)
47 @echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\"
48 $(DOXYGEN_CMD)
49
50 # Upgrades an existing Doxygen configuration file to the latest Doxygen template, preserving settings
51 doxygen-upgrade: $(DOXYGEN_CONF) $(MAKEFILE_LIST)
52 @echo $(MSG_DOXYGEN_CMD) Upgrading configuration file \"$(DOXYGEN_CONF)\" with latest template
53 doxygen -u $(DOXYGEN_CONF) > /dev/null
54
55 # Creates a new Doxygen configuration file with the set file name
56 doxygen-create: $(MAKEFILE_LIST)
57 @echo $(MSG_DOXYGEN_CMD) Creating new configuration file \"$(DOXYGEN_CONF)\" with latest template
58 doxygen -g $(DOXYGEN_CONF) > /dev/null