doc/Makefile: change DOCLIBS check
[ffmpeg.git] / doc / Makefile
1 DOCLIBS-$(CONFIG_AVCODEC) += libavcodec
2
3 MANPAGES    = $(PROGS-yes:%=doc/%.1)    $(DOCLIBS-yes:%=doc/%.3)
4 PODPAGES    = $(PROGS-yes:%=doc/%.pod)  $(DOCLIBS-yes:%=doc/%.pod)
5 HTMLPAGES   = $(PROGS-yes:%=doc/%.html) $(DOCLIBS-yes:%=doc/%.html)     \
6               doc/developer.html                                        \
7               doc/faq.html                                              \
8               doc/fate.html                                             \
9               doc/general.html                                          \
10               doc/git-howto.html                                        \
11               doc/nut.html                                              \
12               doc/platform.html                                         \
13               doc/syntax.html                                           \
14
15 TXTPAGES    = doc/fate.txt                                              \
16
17
18 DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
19 DOCS-$(CONFIG_PODPAGES)  += $(PODPAGES)
20 DOCS-$(CONFIG_MANPAGES)  += $(MANPAGES)
21 DOCS-$(CONFIG_TXTPAGES)  += $(TXTPAGES)
22 DOCS = $(DOCS-yes)
23
24 all-$(CONFIG_DOC): doc
25
26 doc: documentation
27
28 apidoc: doc/doxy/html
29 documentation: $(DOCS)
30
31 TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
32
33 doc/%.txt: TAG = TXT
34 doc/%.txt: doc/%.texi
35         $(Q)$(TEXIDEP)
36         $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
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 $(GENTEXI)
52         $(Q)$(TEXIDEP)
53         $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
54
55 doc/%.1 doc/%.3: TAG = MAN
56 doc/%.1 doc/%.3: doc/%.pod $(GENTEXI)
57         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
58
59 $(DOCS) doc/doxy/html: | doc/
60
61 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
62         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
63
64 install-man:
65
66 ifdef CONFIG_MANPAGES
67 install-progs-$(CONFIG_DOC): install-man
68
69 install-man: $(MANPAGES)
70         $(Q)mkdir -p "$(MANDIR)/man1"
71         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
72 endif
73
74 uninstall: uninstall-man
75
76 uninstall-man:
77         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
78
79 clean::
80         $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
81         $(RM) -r doc/doxy/html
82
83 -include $(wildcard $(DOCS:%=%.d))
84
85 .PHONY: apidoc doc documentation