doc: attempt to get rid of doxygenlayouts and doxyfiles.

Generate doc root doxygenlayout file, as well as devices stuff, based on main
Makefile $(TARGETS) and template files. Avoids painfull sync/merge of 20 files+
when adding a new device.
bonus : allow to build only one device doc easily (make TARGETS=stm32f0 doc)

regression: we currently loose device "fancy" naming as device name is
guessed (toUpper()..) from folder name.
This commit is contained in:
Guillaume Revaillot
2019-02-17 17:55:04 +01:00
committed by Karl Palsson
parent ebe8c4a66c
commit bdc38eed16
67 changed files with 121 additions and 6115 deletions

View File

@@ -3,52 +3,50 @@
# 14 September 2012
# (C) Ken Sarkies <ksarkies@internode.on.net>
ARCHS := stm32f0 stm32f1 stm32f2 stm32f3 stm32f4 stm32f7
ARCHS += stm32l0 stm32l1 stm32l4
ARCHS += efm32g efm32gg efm32hg efm32lg efm32tg
ARCHS += lm3s lm4f msp432e4
ARCHS += lpc13xx lpc17xx lpc43xx
ARCHS += sam3a sam3n sam3s sam3u sam3x
ARCHS += vf6xx
# setup TARGETS if not set for legacy and ease of debug.
TARGETS ?= stm32/f0 stm32/f1 stm32/f2 stm32/f3 stm32/f4 stm32/f7 \
stm32/l0 stm32/l1 stm32/l4 \
efm32/g efm32/gg efm32/hg efm32/lg efm32/tg \
lm3s lm4f \
msp432/e4 \
lpc13xx lpc17xx lpc43xx \
sam/3a sam/3n sam/3s sam/3u sam/3x \
vf6xx
TARGETS_DIRS = $(subst /,,$(TARGETS))
doc: html
html: rebuildsources $(ARCHS)
DoxygenLayout.xml: templates/DoxygenLayout_Root.xml
../scripts/gendoxylayout.py --template $< --out $@ $(TARGETS_DIRS)
define gen_DOC_TARGET
DOC_TARGETS += doc_$(1)
$(1)/:
@mkdir -p $$@
$(1)/doxy.sourcelist: $(1)/
@../scripts/gendoxylist ../lib/$(TARGET_SRC_DIR) $(1)
$(1)/Doxyfile: templates/Doxyfile_Device | $(1)/
@cat $$< | sed -s s/#device#/$(1)/g > $$@
$(1)/DoxygenLayout_$(1).xml: templates/DoxygenLayout_Device.xml | $(1)/
@../scripts/gendoxylayout.py --template $$< --out $$@ --target $(1) $$(TARGETS_DIRS)
doc_$(1): $(1)/doxy.sourcelist $(1)/Doxyfile $(1)/DoxygenLayout_$(1).xml
@(cd $(1); doxygen)
endef
$(foreach TARGET_SRC_DIR, $(TARGETS), $(eval $(call gen_DOC_TARGET,$(subst /,,$(TARGET_SRC_DIR)))))
html: $(DOC_TARGETS) DoxygenLayout.xml
doxygen
$(ARCHS):
cd $@/; doxygen
clean:
@rm -rf html/ */html/ */*.tag */doxy.sourcelist */doxygen_*.log
rebuildsources:
@printf "Manually regenerating source lists from build deps\n"
../scripts/gendoxylist ../lib/stm32/f0 stm32f0
../scripts/gendoxylist ../lib/stm32/f1 stm32f1
../scripts/gendoxylist ../lib/stm32/f2 stm32f2
../scripts/gendoxylist ../lib/stm32/f3 stm32f3
../scripts/gendoxylist ../lib/stm32/f4 stm32f4
../scripts/gendoxylist ../lib/stm32/f7 stm32f7
../scripts/gendoxylist ../lib/stm32/l0 stm32l0
../scripts/gendoxylist ../lib/stm32/l1 stm32l1
../scripts/gendoxylist ../lib/stm32/l4 stm32l4
../scripts/gendoxylist ../lib/efm32/g efm32g
../scripts/gendoxylist ../lib/efm32/gg efm32gg
../scripts/gendoxylist ../lib/efm32/hg efm32hg
../scripts/gendoxylist ../lib/efm32/lg efm32lg
../scripts/gendoxylist ../lib/efm32/tg efm32tg
../scripts/gendoxylist ../lib/lm3s lm3s
../scripts/gendoxylist ../lib/lm4f lm4f
../scripts/gendoxylist ../lib/msp432/e4 msp432e4
../scripts/gendoxylist ../lib/lpc13xx lpc13xx
../scripts/gendoxylist ../lib/lpc17xx lpc17xx
../scripts/gendoxylist ../lib/sam/3a sam3a
../scripts/gendoxylist ../lib/sam/3n sam3n
../scripts/gendoxylist ../lib/sam/3s sam3s
../scripts/gendoxylist ../lib/sam/3u sam3u
../scripts/gendoxylist ../lib/sam/3x sam3x
../scripts/gendoxylist ../lib/vf6xx vf6xx
.PHONY: doc html $(ARCHS) rebuildsources
@rm -rf html/ $(TARGETS_DIRS) DoxygenLayout.xml doxygen.log
.PHONY: doc html $(DOC_TARGETS)