build: Separate building programs linking against libav* from building av*
[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_PERL)                             += $(MANPAGES) $(PODPAGES)
15 DOCS-$(CONFIG_TEXI2HTML)                        += $(HTMLPAGES)
16 DOCS = $(DOCS-yes)
17
18 all: $(DOCS)
19
20 apidoc: doc/doxy/html
21 documentation: $(DOCS)
22
23 TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
24
25 GENTEXI  = format codec
26 GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
27
28 $(GENTEXI): TAG = GENTEXI
29 $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
30         $(M)doc/print_options $* > $@
31
32 doc/%.html: TAG = HTML
33 doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
34         $(Q)$(TEXIDEP)
35         $(M)texi2html -I doc -monolithic --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
36
37 doc/%.pod: TAG = POD
38 doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
39         $(Q)$(TEXIDEP)
40         $(M)$(SRC_PATH)/doc/texi2pod.pl -Idoc $< $@
41
42 doc/%.1: TAG = MAN
43 doc/%.1: doc/%.pod $(GENTEXI)
44         $(M)pod2man --section=1 --center=" " --release=" " $< > $@
45
46 $(DOCS) doc/doxy/html: | doc/
47
48 doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS)
49         $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^
50
51 install-progs-$(CONFIG_PERL): install-man
52 install-progs-$(CONFIG_TEXI2HTML): install-doc
53
54 install-doc: $(HTMLPAGES)
55         $(Q)mkdir -p "$(DOCDIR)"
56         $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
57
58 install-man: $(MANPAGES)
59         $(Q)mkdir -p "$(MANDIR)/man1"
60         $(INSTALL) -m 644 $(MANPAGES) "$(MANDIR)/man1"
61
62 uninstall: uninstall-doc uninstall-man
63
64 uninstall-doc:
65         $(RM) -r "$(DOCDIR)"
66
67 uninstall-man:
68         $(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
69
70 clean::
71         $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi
72         $(RM) -r doc/doxy/html
73
74 -include $(wildcard $(DOCS:%=%.d))
75
76 .PHONY: apidoc documentation