Add a QSV decoding 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_AVCODEC_EXAMPLE)          += avcodec
19 DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)     += filter_audio
20 DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)         += metadata
21 DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)           += output
22 DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)           += qsvdec
23 DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)    += transcode_aac
24 ALL_DOC_EXAMPLES = avcodec filter_audio metadata output transcode_aac
25
26 DOC_EXAMPLES     := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
27 ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES:%=doc/examples/%$(EXESUF))
28 PROGS            += $(DOC_EXAMPLES)
29
30 all: $(DOCS)
31
32 apidoc: doc/doxy/html
33 documentation: $(DOCS)
34
35 examples: $(DOC_EXAMPLES)
36
37 TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
38
39 GENTEXI  = format codec
40 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
41
42 $(GENTEXI): TAG = GENTEXI
43 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
44         $(M)doc/print_options $* > $@
45
46 doc/%.html: TAG = HTML
47 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
48         $(Q)$(TEXIDEP)
49         $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
50
51 doc/%.pod: TAG = POD
52 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
53         $(Q)$(TEXIDEP)
54         $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
55
56 doc/%.1: TAG = MAN
57 doc/%.1: doc/%.pod $(GENTEXI)
58         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
59
60 $(DOCS) doc/doxy/html: | doc/
61 $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
62 OBJDIRS += doc/examples
63
64 DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c))
65 DOXY_TEMPLATES  = doxy_stylesheet.css footer.html header.html
66 DOXY_TEMPLATES := $(addprefix $(SRC_PATH)/doc/doxy/, $(DOXY_TEMPLATES))
67
68 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(DOXY_INPUT) $(DOXY_TEMPLATES)
69         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $< $(DOXY_INPUT)
70
71 install-progs-$(CONFIG_POD2MAN): install-man
72 install-progs-$(CONFIG_TEXI2HTML): install-doc
73
74 install-doc: $(HTMLPAGES)
75         $(Q)mkdir -p "$(DOCDIR)"
76         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
77
78 install-man: $(MANPAGES)
79         $(Q)mkdir -p "$(MANDIR)/man1"
80         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
81
82 uninstall: uninstall-doc uninstall-man
83
84 uninstall-doc:
85         $(RM) -r "$(DOCDIR)"
86
87 uninstall-man:
88         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
89
90 clean::
91         $(RM) $(ALL_DOC_EXAMPLES)
92         $(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%)
93         $(RM) doc/*.html doc/*.pod doc/*.1 doc/avoptions_*.texi
94         $(RM) -r doc/doxy/html
95
96 -include $(wildcard $(DOCS:%=%.d))
97
98 .PHONY: apidoc documentation