[FFmpeg-cvslog] build: Split logic for building examples off into a separate Makefile

Diego Biurrun git at videolan.org
Fri Sep 29 21:39:43 EEST 2017


ffmpeg | branch: master | Diego Biurrun <diego at biurrun.de> | Wed Feb 15 13:31:52 2017 +0100| [acb0dea27efff4b35796015b96570b59fd517078] | committer: Diego Biurrun

build: Split logic for building examples off into a separate Makefile

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=acb0dea27efff4b35796015b96570b59fd517078
---

 Makefile              |  4 ++--
 doc/Makefile          | 23 ++---------------------
 doc/examples/Makefile | 26 ++++++++++++++++++++++++++
 3 files changed, 30 insertions(+), 23 deletions(-)

diff --git a/Makefile b/Makefile
index b14b29d76a..c96e07916d 100644
--- a/Makefile
+++ b/Makefile
@@ -154,6 +154,7 @@ endef
 $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
 
 include $(SRC_PATH)/doc/Makefile
+include $(SRC_PATH)/doc/examples/Makefile
 
 define DOPROG
 OBJS-$(1) += $(1).o $(OBJS-$(1)-yes)
@@ -239,5 +240,4 @@ $(sort $(OBJDIRS)):
 # so this saves some time on slow systems.
 .SUFFIXES:
 
-.PHONY: all all-yes alltools check *clean config examples install*
-.PHONY: testprogs uninstall*
+.PHONY: all all-yes alltools check *clean config install* testprogs uninstall*
diff --git a/doc/Makefile b/doc/Makefile
index 365ac5d913..381eca9c01 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -16,27 +16,11 @@ DOCS-$(CONFIG_POD2MAN)                          += $(MANPAGES) $(PODPAGES)
 DOCS-$(CONFIG_TEXI2HTML)                        += $(HTMLPAGES)
 DOCS = $(DOCS-yes)
 
-DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)     += decode_audio
-DOC_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)     += decode_video
-DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)     += encode_audio
-DOC_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)     += encode_video
-DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)     += filter_audio
-DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)         += metadata
-DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)           += output
-DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)           += qsvdec
-DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)    += transcode_aac
-
-DOC_EXAMPLES     := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
-ALL_DOC_EXAMPLES := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(EXESUF))
-PROGS            += $(DOC_EXAMPLES)
-
 all: $(DOCS)
 
 apidoc: doc/doxy/html
 documentation: $(DOCS)
 
-examples: $(DOC_EXAMPLES)
-
 TEXIDEP = awk '/^@include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d)
 
 GENTEXI  = format codec
@@ -63,10 +47,8 @@ doc/%.1: doc/%.pod
 	$(M)pod2man --section=1 --center=" " --release=" " $< > $@
 
 $(DOCS) doc/doxy/html: | doc/
-$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
-OBJDIRS += doc/examples
 
-DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS) $(DOC_EXAMPLES:%$(EXESUF)=%.c))
+DOXY_INPUT      = $(addprefix $(SRC_PATH)/, $(INSTHEADERS))
 DOXY_TEMPLATES  = doxy_stylesheet.css footer.html header.html
 DOXY_TEMPLATES := $(addprefix $(SRC_PATH)/doc/doxy/, $(DOXY_TEMPLATES))
 
@@ -93,8 +75,7 @@ uninstall-man:
 	$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
 
 clean::
-	$(RM) $(ALL_DOC_EXAMPLES)
-	$(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%)
+	$(RM) $(CLEANSUFFIXES:%=doc/%)
 	$(RM) doc/*.html doc/*.pod doc/*.1 doc/avoptions_*.texi
 	$(RM) -r doc/doxy/html
 
diff --git a/doc/examples/Makefile b/doc/examples/Makefile
new file mode 100644
index 0000000000..b24ca28aff
--- /dev/null
+++ b/doc/examples/Makefile
@@ -0,0 +1,26 @@
+DOC_EXAMPLES-$(CONFIG_DECODE_AUDIO_EXAMPLE)     += decode_audio
+DOC_EXAMPLES-$(CONFIG_DECODE_VIDEO_EXAMPLE)     += decode_video
+DOC_EXAMPLES-$(CONFIG_ENCODE_AUDIO_EXAMPLE)     += encode_audio
+DOC_EXAMPLES-$(CONFIG_ENCODE_VIDEO_EXAMPLE)     += encode_video
+DOC_EXAMPLES-$(CONFIG_FILTER_AUDIO_EXAMPLE)     += filter_audio
+DOC_EXAMPLES-$(CONFIG_METADATA_EXAMPLE)         += metadata
+DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE)           += output
+DOC_EXAMPLES-$(CONFIG_QSVDEC_EXAMPLE)           += qsvdec
+DOC_EXAMPLES-$(CONFIG_TRANSCODE_AAC_EXAMPLE)    += transcode_aac
+
+DOC_EXAMPLES     := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
+ALL_DOC_EXAMPLES := $(DOC_EXAMPLES) $(DOC_EXAMPLES-:%=doc/examples/%$(EXESUF))
+PROGS            += $(DOC_EXAMPLES)
+
+examples: $(DOC_EXAMPLES)
+
+$(DOC_EXAMPLES:%$(EXESUF)=%.o): | doc/examples
+OBJDIRS += doc/examples
+
+DOXY_INPUT += $(addprefix $(SRC_PATH)/, $(DOC_EXAMPLES:%$(EXESUF)=%.c))
+
+clean::
+	$(RM) $(ALL_DOC_EXAMPLES)
+	$(RM) $(CLEANSUFFIXES:%=doc/examples/%)
+
+.PHONY: examples



More information about the ffmpeg-cvslog mailing list