Add explicit blank checks in the build system for user-set but blank variables that...
[pub/USBasp.git] / LUFA / Build / lufa.doxygen.in
1 #
2 # LUFA Library
3 # Copyright (C) Dean Camera, 2012.
4 #
5 # dean [at] fourwalledcubicle [dot] com
6 # www.lufa-lib.org
7 #
8
9 LUFA_BUILD_MODULES += DOXYGEN
10 LUFA_BUILD_TARGETS += doxygen
11 LUFA_BUILD_MANDATORY_VARS += LUFA_PATH
12 LUFA_BUILD_OPTIONAL_VARS += DOXYGEN_CONF DOXYGEN_FAIL_ON_WARNING DOXYGEN_OVERRIDE_PARAMS
13
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 # -----------------------------------------------------------------------------
37
38 # Sanity-check values of mandatory user-supplied variables
39 LUFA_PATH ?= $(error Makefile LUFA_PATH value not set)
40
41 # Default values of optionally user-supplied variables
42 DOXYGEN_CONF ?= Doxygen.conf
43 DOXYGEN_FAIL_ON_WARNING ?= Y
44 DOXYGEN_OVERRIDE_PARAMS ?= QUIET=YES HTML_STYLESHEET=$(patsubst %/,%,$(LUFA_PATH))/DoxygenPages/Style/Style.css
45
46 # Output Messages
47 MSG_DOXYGEN_CMD := ' [DOXYGEN] :'
48
49 # Determine Doxygen invocation command
50 BASE_DOXYGEN_CMD = ( cat Doxygen.conf $(DOXYGEN_OVERRIDE_PARAMS:%=; echo "%") ) | doxygen -
51 ifeq ($(DOXYGEN_FAIL_ON_WARNING), Y)
52 DOXYGEN_CMD = if ( $(BASE_DOXYGEN_CMD) 2>&1 | grep -v "warning: ignoring unsupported tag" ;); then exit 1; fi;
53 else ifeq ($(DOXYGEN_FAIL_ON_WARNING), N)
54 DOXYGEN_CMD = $(BASE_DOXYGEN_CMD)
55 else
56 $(error DOXYGEN_FAIL_ON_WARNING must be Y or N.)
57 endif
58
59 doxygen:
60 @echo $(MSG_DOXYGEN_CMD) Configuration file \"$(DOXYGEN_CONF)\" with parameters \"$(DOXYGEN_OVERRIDE_PARAMS)\"
61 $(DOXYGEN_CMD)
62
63 # Phony build targets for this module
64 .PHONY: doxygen