Makefile 5.2 KB

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