1##
2##  Copyright (c) 2010 The WebM project authors. All Rights Reserved.
3##
4##  Use of this source code is governed by a BSD-style license
5##  that can be found in the LICENSE file in the root of the source
6##  tree. An additional intellectual property rights grant can be found
7##  in the file PATENTS.  All contributing project authors may
8##  be found in the AUTHORS file in the root of the source tree.
9##
10
11
12INSTALL_MAPS += docs/%    docs/%
13INSTALL_MAPS += src/%     %
14INSTALL_MAPS += %         %
15
16# Static documentation authored in doxygen
17CODEC_DOX :=    mainpage.dox \
18		keywords.dox \
19		usage.dox \
20		usage_cx.dox \
21		usage_dx.dox \
22
23# Other doxy files sourced in Markdown
24TXT_DOX = $(call enabled,TXT_DOX)
25
26%.dox: %.txt
27	@echo "    [DOXY] $@"
28	@$(SRC_PATH_BARE)/examples/gen_example_doxy.php \
29             $(@:.dox=)  "$($@.DESC)" > $@ < $<
30
31
32EXAMPLE_PATH += $(SRC_PATH_BARE) #for CHANGELOG, README, etc
33EXAMPLE_PATH += $(SRC_PATH_BARE)/examples
34
35doxyfile: $(if $(findstring examples, $(ALL_TARGETS)),examples.doxy)
36doxyfile: libs.doxy_template libs.doxy
37	@echo "    [CREATE] $@"
38	@cat $^ > $@
39	@echo "STRIP_FROM_PATH += $(SRC_PATH_BARE) $(BUILD_ROOT)" >> $@
40	@echo "INPUT += $(addprefix $(SRC_PATH_BARE)/,$(CODEC_DOX))" >> $@;
41	@echo "INPUT += $(TXT_DOX)" >> $@;
42	@echo "EXAMPLE_PATH += $(EXAMPLE_PATH)" >> $@
43
44CLEAN-OBJS += doxyfile $(wildcard docs/html/*)
45docs/html/index.html: doxyfile $(CODEC_DOX) $(TXT_DOX)
46	@echo "    [DOXYGEN] $<"
47	@doxygen $<
48DOCS-yes += docs/html/index.html
49
50DIST-DOCS-yes = $(wildcard docs/html/*)
51DIST-DOCS-$(CONFIG_CODEC_SRCS) += $(addprefix src/,$(CODEC_DOX))
52DIST-DOCS-$(CONFIG_CODEC_SRCS) += src/libs.doxy_template
53DIST-DOCS-yes                  += CHANGELOG
54DIST-DOCS-yes                  += README
55