1LIBRARIES-$(CONFIG_AVUTIL) += libavutil 2LIBRARIES-$(CONFIG_SWSCALE) += libswscale 3LIBRARIES-$(CONFIG_SWRESAMPLE) += libswresample 4LIBRARIES-$(CONFIG_AVCODEC) += libavcodec 5LIBRARIES-$(CONFIG_AVFORMAT) += libavformat 6LIBRARIES-$(CONFIG_AVDEVICE) += libavdevice 7LIBRARIES-$(CONFIG_AVFILTER) += libavfilter 8 9COMPONENTS-$(CONFIG_AVUTIL) += ffmpeg-utils 10COMPONENTS-$(CONFIG_SWSCALE) += ffmpeg-scaler 11COMPONENTS-$(CONFIG_SWRESAMPLE) += ffmpeg-resampler 12COMPONENTS-$(CONFIG_AVCODEC) += ffmpeg-codecs ffmpeg-bitstream-filters 13COMPONENTS-$(CONFIG_AVFORMAT) += ffmpeg-formats ffmpeg-protocols 14COMPONENTS-$(CONFIG_AVDEVICE) += ffmpeg-devices 15COMPONENTS-$(CONFIG_AVFILTER) += ffmpeg-filters 16 17MANPAGES1 = $(AVPROGS-yes:%=doc/%.1) $(AVPROGS-yes:%=doc/%-all.1) $(COMPONENTS-yes:%=doc/%.1) 18MANPAGES3 = $(LIBRARIES-yes:%=doc/%.3) 19MANPAGES = $(MANPAGES1) $(MANPAGES3) 20PODPAGES = $(AVPROGS-yes:%=doc/%.pod) $(AVPROGS-yes:%=doc/%-all.pod) $(COMPONENTS-yes:%=doc/%.pod) $(LIBRARIES-yes:%=doc/%.pod) 21HTMLPAGES = $(AVPROGS-yes:%=doc/%.html) $(AVPROGS-yes:%=doc/%-all.html) $(COMPONENTS-yes:%=doc/%.html) $(LIBRARIES-yes:%=doc/%.html) \ 22 doc/developer.html \ 23 doc/faq.html \ 24 doc/fate.html \ 25 doc/general.html \ 26 doc/git-howto.html \ 27 doc/mailing-list-faq.html \ 28 doc/nut.html \ 29 doc/platform.html \ 30 31TXTPAGES = doc/fate.txt \ 32 33 34DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES) 35DOCS-$(CONFIG_PODPAGES) += $(PODPAGES) 36DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) 37DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) 38DOCS = $(DOCS-yes) 39 40all-$(CONFIG_DOC): doc 41 42doc: documentation 43 44apidoc: doc/doxy/html 45documentation: $(DOCS) 46 47TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d) 48 49doc/%.txt: TAG = TXT 50doc/%.txt: doc/%.texi 51 $(Q)$(TEXIDEP) 52 $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null 53 54GENTEXI = format codec 55GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi) 56 57$(GENTEXI): TAG = GENTEXI 58$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF) 59 $(M)doc/print_options $* > $@ 60 61doc/%.html: TAG = HTML 62doc/%-all.html: TAG = HTML 63 64ifdef HAVE_MAKEINFO_HTML 65doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI) 66 $(Q)$(TEXIDEP) 67 $(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $< 68 69doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI) 70 $(Q)$(TEXIDEP) 71 $(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $< 72else 73doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI) 74 $(Q)$(TEXIDEP) 75 $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $< 76 77doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI) 78 $(Q)$(TEXIDEP) 79 $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $< 80endif 81 82doc/%.pod: TAG = POD 83doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI) 84 $(Q)$(TEXIDEP) 85 $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@ 86 87doc/%-all.pod: TAG = POD 88doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI) 89 $(Q)$(TEXIDEP) 90 $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@ 91 92doc/%.1 doc/%.3: TAG = MAN 93doc/%.1: doc/%.pod $(GENTEXI) 94 $(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@ 95doc/%.3: doc/%.pod $(GENTEXI) 96 $(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@ 97 98$(DOCS) doc/doxy/html: | doc/ 99 100DOXY_INPUT = $(INSTHEADERS) 101DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak 102 103doc/doxy/html: TAG = DOXY 104doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS) 105 $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT); 106 107install-doc: install-html install-man 108 109install-html: 110 111install-man: 112 113ifdef CONFIG_HTMLPAGES 114install-progs-$(CONFIG_DOC): install-html 115 116install-html: $(HTMLPAGES) 117 $(Q)mkdir -p "$(DOCDIR)" 118 $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)" 119endif 120 121ifdef CONFIG_MANPAGES 122install-progs-$(CONFIG_DOC): install-man 123 124install-man: $(MANPAGES) 125 $(Q)mkdir -p "$(MANDIR)/man1" 126 $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1" 127 $(Q)mkdir -p "$(MANDIR)/man3" 128 $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3" 129endif 130 131uninstall: uninstall-doc 132 133uninstall-doc: uninstall-html uninstall-man 134 135uninstall-html: 136 $(RM) -r "$(DOCDIR)" 137 138uninstall-man: 139 $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1)) 140 $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3)) 141 142clean:: docclean 143 144distclean:: docclean 145 $(RM) doc/config.texi 146 147docclean:: 148 $(RM) $(CLEANSUFFIXES:%=doc/%) 149 $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi 150 $(RM) -r doc/doxy/html 151 152-include $(wildcard $(DOCS:%=%.d)) 153 154.PHONY: apidoc doc documentation 155