Makefile 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. $(SRC_PATH)/doc/bootstrap.min.css \
  29. $(SRC_PATH)/doc/style.min.css \
  30. $(SRC_PATH)/doc/default.css \
  31. TXTPAGES = doc/fate.txt \
  32. DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
  33. DOCS-$(CONFIG_PODPAGES) += $(PODPAGES)
  34. DOCS-$(CONFIG_MANPAGES) += $(MANPAGES)
  35. DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES)
  36. DOCS = $(DOCS-yes)
  37. all-$(CONFIG_DOC): doc
  38. doc: documentation
  39. apidoc: doc/doxy/html
  40. documentation: $(DOCS)
  41. TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
  42. doc/%.txt: TAG = TXT
  43. doc/%.txt: doc/%.texi
  44. $(Q)$(TEXIDEP)
  45. $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
  46. GENTEXI = format codec
  47. GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
  48. $(GENTEXI): TAG = GENTEXI
  49. $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
  50. $(M)doc/print_options $* > $@
  51. doc/%.html: TAG = HTML
  52. doc/%-all.html: TAG = HTML
  53. ifdef HAVE_MAKEINFO_HTML
  54. doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
  55. $(Q)$(TEXIDEP)
  56. $(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
  57. doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
  58. $(Q)$(TEXIDEP)
  59. $(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
  60. else
  61. doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
  62. $(Q)$(TEXIDEP)
  63. $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
  64. doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
  65. $(Q)$(TEXIDEP)
  66. $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
  67. endif
  68. doc/%.pod: TAG = POD
  69. doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
  70. $(Q)$(TEXIDEP)
  71. $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
  72. doc/%-all.pod: TAG = POD
  73. doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
  74. $(Q)$(TEXIDEP)
  75. $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
  76. doc/%.1 doc/%.3: TAG = MAN
  77. doc/%.1: doc/%.pod $(GENTEXI)
  78. $(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
  79. doc/%.3: doc/%.pod $(GENTEXI)
  80. $(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
  81. $(DOCS) doc/doxy/html: | doc/
  82. DOXY_INPUT = $(INSTHEADERS)
  83. DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT)) ffbuild/config.mak
  84. doc/doxy/html: TAG = DOXY
  85. doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
  86. $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $$PWD/doc/doxy $(SRC_PATH) doc/Doxyfile $(DOXYGEN) $(DOXY_INPUT);
  87. install-doc: install-html install-man
  88. install-html:
  89. install-man:
  90. ifdef CONFIG_HTMLPAGES
  91. install-progs-$(CONFIG_DOC): install-html
  92. install-html: $(HTMLPAGES)
  93. $(Q)mkdir -p "$(DOCDIR)"
  94. $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
  95. endif
  96. ifdef CONFIG_MANPAGES
  97. install-progs-$(CONFIG_DOC): install-man
  98. install-man: $(MANPAGES)
  99. $(Q)mkdir -p "$(MANDIR)/man1"
  100. $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
  101. $(Q)mkdir -p "$(MANDIR)/man3"
  102. $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
  103. endif
  104. uninstall: uninstall-doc
  105. uninstall-doc: uninstall-html uninstall-man
  106. uninstall-html:
  107. $(RM) -r "$(DOCDIR)"
  108. uninstall-man:
  109. $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
  110. $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
  111. clean:: docclean
  112. distclean:: docclean
  113. $(RM) doc/config.texi
  114. docclean::
  115. $(RM) $(CLEANSUFFIXES:%=doc/%)
  116. $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
  117. $(RM) -r doc/doxy/html
  118. -include $(wildcard $(DOCS:%=%.d))
  119. .PHONY: apidoc doc documentation