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