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