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