Makefile 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  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/nut.html \
  26. doc/platform.html \
  27. TXTPAGES = doc/fate.txt \
  28. DOCS-$(CONFIG_HTMLPAGES) += $(HTMLPAGES)
  29. DOCS-$(CONFIG_PODPAGES) += $(PODPAGES)
  30. DOCS-$(CONFIG_MANPAGES) += $(MANPAGES)
  31. DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES)
  32. DOCS = $(DOCS-yes)
  33. DOC_EXAMPLES-$(CONFIG_AVIO_DIR_CMD_EXAMPLE) += avio_dir_cmd
  34. DOC_EXAMPLES-$(CONFIG_AVIO_READING_EXAMPLE) += avio_reading
  35. DOC_EXAMPLES-$(CONFIG_AVCODEC_EXAMPLE) += avcodec
  36. DOC_EXAMPLES-$(CONFIG_DECODING_ENCODING_EXAMPLE) += decoding_encoding
  37. DOC_EXAMPLES-$(CONFIG_DEMUXING_DECODING_EXAMPLE) += demuxing_decoding
  38. DOC_EXAMPLES-$(CONFIG_EXTRACT_MVS_EXAMPLE) += extract_mvs
  39. DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE) += filter_audio
  40. DOC_EXAMPLES-$(CONFIG_FILTERING_AUDIO_EXAMPLE) += filtering_audio
  41. DOC_EXAMPLES-$(CONFIG_FILTERING_VIDEO_EXAMPLE) += filtering_video
  42. DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE) += metadata
  43. DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE) += muxing
  44. DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE) += qsvdec
  45. DOC_EXAMPLES-$(CONFIG_REMUXING_EXAMPLE) += remuxing
  46. DOC_EXAMPLES-$(CONFIG_RESAMPLING_AUDIO_EXAMPLE) += resampling_audio
  47. DOC_EXAMPLES-$(CONFIG_SCALING_VIDEO_EXAMPLE) += scaling_video
  48. DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE) += transcode_aac
  49. DOC_EXAMPLES-$(CONFIG_TRANSCODING_EXAMPLE) += transcoding
  50. ALL_DOC_EXAMPLES_LIST = $(DOC_EXAMPLES-) $(DOC_EXAMPLES-yes)
  51. DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(PROGSSUF)$(EXESUF))
  52. ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)$(EXESUF))
  53. ALL_DOC_EXAMPLES_G := $(ALL_DOC_EXAMPLES_LIST:%=doc/examples/%$(PROGSSUF)_g$(EXESUF))
  54. PROGS += $(DOC_EXAMPLES)
  55. all-$(CONFIG_DOC): doc
  56. doc: documentation
  57. apidoc: doc/doxy/html
  58. documentation: $(DOCS)
  59. examples: $(DOC_EXAMPLES)
  60. TEXIDEP = perl $(SRC_PATH)/doc/texidep.pl $(SRC_PATH) $< $@ >$(@:%=%.d)
  61. doc/%.txt: TAG = TXT
  62. doc/%.txt: doc/%.texi
  63. $(Q)$(TEXIDEP)
  64. $(M)makeinfo --force --no-headers -o $@ $< 2>/dev/null
  65. GENTEXI = format codec
  66. GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
  67. $(GENTEXI): TAG = GENTEXI
  68. $(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
  69. $(M)doc/print_options $* > $@
  70. doc/%.html: TAG = HTML
  71. doc/%-all.html: TAG = HTML
  72. ifdef HAVE_MAKEINFO_HTML
  73. doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
  74. $(Q)$(TEXIDEP)
  75. $(M)makeinfo --html -I doc --no-split -D config-not-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
  76. doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.pm $(GENTEXI)
  77. $(Q)$(TEXIDEP)
  78. $(M)makeinfo --html -I doc --no-split -D config-all --init-file=$(SRC_PATH)/doc/t2h.pm --output $@ $<
  79. else
  80. doc/%.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
  81. $(Q)$(TEXIDEP)
  82. $(M)texi2html -I doc -monolithic --D=config-not-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
  83. doc/%-all.html: doc/%.texi $(SRC_PATH)/doc/t2h.init $(GENTEXI)
  84. $(Q)$(TEXIDEP)
  85. $(M)texi2html -I doc -monolithic --D=config-all --init-file $(SRC_PATH)/doc/t2h.init --output $@ $<
  86. endif
  87. doc/%.pod: TAG = POD
  88. doc/%.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
  89. $(Q)$(TEXIDEP)
  90. $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-not-all=yes -Idoc $< $@
  91. doc/%-all.pod: TAG = POD
  92. doc/%-all.pod: doc/%.texi $(SRC_PATH)/doc/texi2pod.pl $(GENTEXI)
  93. $(Q)$(TEXIDEP)
  94. $(M)perl $(SRC_PATH)/doc/texi2pod.pl -Dconfig-all=yes -Idoc $< $@
  95. doc/%.1 doc/%.3: TAG = MAN
  96. doc/%.1: doc/%.pod $(GENTEXI)
  97. $(M)pod2man --section=1 --center=" " --release=" " --date=" " $< > $@
  98. doc/%.3: doc/%.pod $(GENTEXI)
  99. $(M)pod2man --section=3 --center=" " --release=" " --date=" " $< > $@
  100. $(DOCS) doc/doxy/html: | doc/
  101. $(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
  102. OBJDIRS += doc/examples
  103. DOXY_INPUT = $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c) $(LIB_EXAMPLES:%$(EXESUF)=%.c)
  104. DOXY_INPUT_DEPS = $(addprefix $(SRC_PATH)/, $(DOXY_INPUT))
  105. doc/doxy/html: TAG = DOXY
  106. doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(SRC_PATH)/doc/doxy-wrapper.sh $(DOXY_INPUT_DEPS)
  107. $(M)OUT_DIR=$$PWD/doc/doxy; cd $(SRC_PATH); ./doc/doxy-wrapper.sh $$OUT_DIR $< $(DOXYGEN) $(DOXY_INPUT);
  108. install-doc: install-html install-man
  109. install-html:
  110. install-man:
  111. ifdef CONFIG_HTMLPAGES
  112. install-progs-$(CONFIG_DOC): install-html
  113. install-html: $(HTMLPAGES)
  114. $(Q)mkdir -p "$(DOCDIR)"
  115. $(INSTALL) -m 644 $(HTMLPAGES) "$(DOCDIR)"
  116. endif
  117. ifdef CONFIG_MANPAGES
  118. install-progs-$(CONFIG_DOC): install-man
  119. install-man: $(MANPAGES)
  120. $(Q)mkdir -p "$(MANDIR)/man1"
  121. $(INSTALL) -m 644 $(MANPAGES1) "$(MANDIR)/man1"
  122. $(Q)mkdir -p "$(MANDIR)/man3"
  123. $(INSTALL) -m 644 $(MANPAGES3) "$(MANDIR)/man3"
  124. endif
  125. uninstall: uninstall-doc
  126. uninstall-doc: uninstall-html uninstall-man
  127. uninstall-html:
  128. $(RM) -r "$(DOCDIR)"
  129. uninstall-man:
  130. $(RM) $(addprefix "$(MANDIR)/man1/",$(AVPROGS-yes:%=%.1) $(AVPROGS-yes:%=%-all.1) $(COMPONENTS-yes:%=%.1))
  131. $(RM) $(addprefix "$(MANDIR)/man3/",$(LIBRARIES-yes:%=%.3))
  132. clean:: docclean
  133. distclean:: docclean
  134. $(RM) doc/config.texi
  135. examplesclean:
  136. $(RM) $(ALL_DOC_EXAMPLES) $(ALL_DOC_EXAMPLES_G)
  137. $(RM) $(CLEANSUFFIXES:%=doc/examples/%)
  138. docclean: examplesclean
  139. $(RM) $(CLEANSUFFIXES:%=doc/%)
  140. $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi
  141. $(RM) -r doc/doxy/html
  142. -include $(wildcard $(DOCS:%=%.d))
  143. .PHONY: apidoc doc documentation