Makefile 6.1 KB

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