examples/avcodec: split audio decoding into a separate example
[libav.git] / doc / Makefile
1 ALLMANPAGES = $(AVBASENAMES:%=%.1)
2 MANPAGES = $(AVPROGS-yes:%=doc/%.1)
3 PODPAGES = $(AVPROGS-yes:%=doc/%.pod)
4 PROGSHTML = $(AVPROGS-yes:%=doc/%.html)
5 HTMLPAGES = $(PROGSHTML) \
6 doc/developer.html \
7 doc/faq.html \
8 doc/fate.html \
9 doc/general.html \
10 doc/git-howto.html \
11 doc/libavfilter.html \
12 doc/nut.html \
13 doc/platform.html \
14
15 DOCS-$(CONFIG_POD2MAN) += $(MANPAGES) $(PODPAGES)
16 DOCS-$(CONFIG_TEXI2HTML) += $(HTMLPAGES)
17 DOCS = $(DOCS-yes)
18
19 DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
20 DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE) += decode_audio
21 DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE) += encode_audio
22 DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
23 DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
24 DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE) += output
25 DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE) += qsvdec
26 DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac
27 ALL_DOC_EXAMPLES = avcodec decode_audio encode_audio filter_audio metadata \
28 output transcode_aac
29
30 DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
31 ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES:%=doc/examples/%$(EXESUF))
32 PROGS += $(DOC_EXAMPLES)
33
34 all: $(DOCS)
35
36 apidoc: doc/doxy/html
37 documentation: $(DOCS)
38
39 examples: $(DOC_EXAMPLES)
40
41 TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
42
43 GENTEXI = format codec
44 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
45
46 $(MANPAGES) $(PODPAGES) $(PROGSHTML): $(GENTEXI)
47
48 $(GENTEXI): TAG = GENTEXI
49 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
50 $(M)doc/print_options $* > $@
51
52 doc/%.html: TAG = HTML
53 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init
54 $(Q)$(TEXIDEP)
55 $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
56
57 doc/%.pod: TAG = POD
58 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl
59 $(Q)$(TEXIDEP)
60 $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
61
62 doc/%.1: TAG = MAN
63 doc/%.1: doc/%.pod
64 $(M)pod2man --section=1 --center=" " --release=" " $< > $@
65
66 $(DOCS) doc/doxy/html: | doc/
67 $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
68 OBJDIRS += doc/examples
69
70 DOXY_INPUT = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
71 DOXY_TEMPLATES = doxy_stylesheet.css footer.html header.html
72 DOXY_TEMPLATES := $(addprefix $(SRC_PATH)/doc/doxy/, $(DOXY_TEMPLATES))
73
74 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(DOXY_INPUT) $(DOXY_TEMPLATES)
75 $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXY_INPUT)
76
77 install-progs-$(CONFIG_POD2MAN): install-man
78 install-progs-$(CONFIG_TEXI2HTML): install-doc
79
80 install-doc: $(HTMLPAGES)
81 $(Q)mkdir -p "$(DOCDIR)"
82 $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
83
84 install-man: $(MANPAGES)
85 $(Q)mkdir -p "$(MANDIR)/man1"
86 $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
87
88 uninstall: uninstall-doc uninstall-man
89
90 uninstall-doc:
91 $(RM) -r "$(DOCDIR)"
92
93 uninstall-man:
94 $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
95
96 clean::
97 $(RM) $(ALL_DOC_EXAMPLES)
98 $(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%)
99 $(RM) doc/*.html doc/*.pod doc/*.1 doc/avoptions_*.texi
100 $(RM) -r doc/doxy/html
101
102 -include $(wildcard $(DOCS:%=%.d))
103
104 .PHONY: apidoc documentation