doc: add apidoc target for doxygen API documentation

Documentation includes only the externally visible API of the installed
headers.

Based on a patch by Anton Khirnov <anton@khirnov.net>.

Signed-off-by: Anton Khirnov <anton@khirnov.net>
This commit is contained in:
Janne Grunau 2012-10-29 16:26:59 +01:00 committed by Anton Khirnov
parent 34871beb5e
commit b3fab1f2cd
3 changed files with 23 additions and 2 deletions

View File

@ -14,6 +14,7 @@ DOCS = $(HTMLPAGES) $(MANPAGES) $(PODPAGES)
all-$(CONFIG_DOC): documentation all-$(CONFIG_DOC): documentation
apidoc: doc/doxy/html
documentation: $(DOCS) documentation: $(DOCS)
TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d) TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
@ -39,7 +40,10 @@ doc/%.1: TAG = MAN
doc/%.1: doc/%.pod $(GENTEXI) doc/%.1: doc/%.pod $(GENTEXI)
$(M)pod2man --section=1 --center=" " --release=" " $< > $@ $(M)pod2man --section=1 --center=" " --release=" " $< > $@
$(DOCS): | doc/ $(DOCS) doc/doxy/html: | doc/
doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
$(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
install-progs-$(CONFIG_DOC): install-man install-progs-$(CONFIG_DOC): install-man
@ -54,7 +58,8 @@ uninstall-man:
clean:: clean::
$(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
$(RM) -r doc/doxy/html
-include $(wildcard $(DOCS:%=%.d)) -include $(wildcard $(DOCS:%=%.d))
.PHONY: documentation .PHONY: apidoc documentation

14
doc/doxy-wrapper.sh Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
SRC_PATH="${1}"
DOXYFILE="${2}"
shift 2
doxygen - <<EOF
@INCLUDE = ${DOXYFILE}
INPUT = $@
HTML_HEADER = ${SRC_PATH}/doc/doxy/header.html
HTML_FOOTER = ${SRC_PATH}/doc/doxy/footer.html
HTML_STYLESHEET = ${SRC_PATH}/doc/doxy/doxy_stylesheet.css
EOF

View File

@ -6,6 +6,8 @@ LIBVERSION := $(lib$(NAME)_VERSION)
LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR) LIBMAJOR := $(lib$(NAME)_VERSION_MAJOR)
INCINSTDIR := $(INCDIR)/lib$(NAME) INCINSTDIR := $(INCDIR)/lib$(NAME)
INSTHEADERS := $(INSTHEADERS) $(HEADERS:%=$(SUBDIR)%)
all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME) all-$(CONFIG_STATIC): $(SUBDIR)$(LIBNAME)
all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME) all-$(CONFIG_SHARED): $(SUBDIR)$(SLIBNAME)