diff --git a/Makefile b/Makefile index f79712cddc..f169ce9def 100644 --- a/Makefile +++ b/Makefile @@ -93,6 +93,8 @@ endef $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D)))) +include $(SRC_PATH)/doc/Makefile + define DOPROG OBJS-$(1) += $(1).o $(EXEOBJS) $(OBJS-$(1)-yes) $(1)$(PROGSSUF)_g$(EXESUF): $$(OBJS-$(1)) @@ -168,7 +170,6 @@ config: check: all alltools examples testprogs fate -include $(SRC_PATH)/doc/Makefile include $(SRC_PATH)/tests/Makefile $(sort $(OBJDIRS)): diff --git a/configure b/configure index 6b0375bdff..4aeeb8075c 100755 --- a/configure +++ b/configure @@ -1164,6 +1164,10 @@ COMPONENT_LIST=" protocols " +EXAMPLE_LIST=" + muxing_example +" + EXTERNAL_LIBRARY_LIST=" avisynth bzlib @@ -1264,6 +1268,7 @@ PROGRAM_LIST=" CONFIG_LIST=" $COMPONENT_LIST $DOCUMENT_LIST + $EXAMPLE_LIST $EXTERNAL_LIBRARY_LIST $HWACCEL_LIST $LIBRARY_LIST @@ -2269,6 +2274,9 @@ tinterlace_merge_test_deps="tinterlace_filter" tinterlace_pad_test_deps="tinterlace_filter" zmq_filter_deps="libzmq" +# examples +muxing_example_deps="avcodec avformat avutil swscale" + # libraries avcodec_deps="avutil" avdevice_deps="avutil avcodec avformat" @@ -2339,6 +2347,7 @@ host_os=$target_os_default # configurable options enable $PROGRAM_LIST enable $DOCUMENT_LIST +enable $EXAMPLE_LIST enable $(filter_out avresample $LIBRARY_LIST) enable stripping diff --git a/doc/Makefile b/doc/Makefile index 17f34cfaf3..5856f3de01 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -36,6 +36,13 @@ DOCS-$(CONFIG_MANPAGES) += $(MANPAGES) DOCS-$(CONFIG_TXTPAGES) += $(TXTPAGES) DOCS = $(DOCS-yes) +DOC_EXAMPLES-$(CONFIG_MUXING_EXAMPLE) += muxing +ALL_DOC_EXAMPLES = muxing + +DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF)) +ALL_DOC_EXAMPLES := $(ALL_DOC_EXAMPLES:%=doc/examples/%$(EXESUF)) +PROGS += $(DOC_EXAMPLES) + all-$(CONFIG_DOC): doc doc: documentation @@ -43,6 +50,8 @@ doc: documentation apidoc: doc/doxy/html documentation: $(DOCS) +examples: $(DOC_EXAMPLES) + TEXIDEP = awk '/^@(verbatim)?include/ { printf "$@: $(@D)/%s\n", $$2 }' <$< >$(@:%=%.d) doc/%.txt: TAG = TXT @@ -84,6 +93,8 @@ doc/%.3: doc/%.pod $(GENTEXI) $(M)pod2man --section=3 --center=" " --release=" " $< > $@ $(DOCS) doc/doxy/html: | doc/ +$(DOC_EXAMPLES:%=%.o): | doc/examples +OBJDIRS += doc/examples doc/doxy/html: $(SRC_PATH)/doc/Doxyfile $(INSTHEADERS) $(M)$(SRC_PATH)/doc/doxy-wrapper.sh $(SRC_PATH) $^ @@ -129,7 +140,9 @@ distclean:: docclean $(RM) doc/config.texi docclean: - $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 $(CLEANSUFFIXES:%=doc/%) doc/avoptions_*.texi + $(RM) $(ALL_DOC_EXAMPLES) + $(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%) + $(RM) $(TXTPAGES) doc/*.html doc/*.pod doc/*.1 doc/*.3 doc/avoptions_*.texi $(RM) -r doc/doxy/html -include $(wildcard $(DOCS:%=%.d))