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