This includes moving libavformat/output-example to doc/examples/output.
---
Compared to the last iteration it builds on the refactoring done in
the previous patch, places stuff in more sensible locations and is
somewhat cleaner overall. No more RFC tag on this iteration.
Makefile | 5 +++--
configure | 10 +++++++++-
doc/Makefile | 15 ++++++++++++++-
libavformat/output-example.c => doc/examples/output.c | 2 +-
libavformat/Makefile | 4 ----
5 files changed, 27 insertions(+), 9 deletions(-)
rename libavformat/output-example.c => doc/examples/output.c (99%)
diff --git a/Makefile b/Makefile
index 343854f..b0936f3 100644
--- a/Makefile
+++ b/Makefile
@@ -128,6 +128,8 @@ endef
$(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))
+include $(SRC_PATH)/doc/Makefile
+
define DOPROG
OBJS-$(1) += $(1).o $(EXEOBJS)
$(1)$(EXESUF): $$(OBJS-$(1))
@@ -137,7 +139,7 @@ $(1)$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
-include $$(OBJS-$(1):.o=.d)
endef
-$(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))
+$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P))))
$(PROGS): %$(EXESUF): %.o $(FF_DEP_LIBS)
$(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) $(FF_EXTRALIBS)
@@ -201,7 +203,6 @@ config:
check: all alltools checkheaders examples testprogs fate
-include $(SRC_PATH)/doc/Makefile
include $(SRC_PATH)/tests/Makefile
$(sort $(OBJDIRS)):
diff --git a/configure b/configure
index 0969fd5..6668e34 100755
--- a/configure
+++ b/configure
@@ -1041,6 +1041,10 @@ COMPONENT_LIST="
protocols
"
+EXAMPLE_LIST="
+ output_example
+"
+
EXTERNAL_LIBRARY_LIST="
avisynth
bzlib
@@ -1102,6 +1106,7 @@ PROGRAM_LIST="
CONFIG_LIST="
$COMPONENT_LIST
+ $EXAMPLE_LIST
$EXTERNAL_LIBRARY_LIST
$HWACCEL_LIST
$LIBRARY_LIST
@@ -1942,6 +1947,9 @@ ocv_filter_deps="libopencv"
scale_filter_deps="swscale"
yadif_filter_deps="gpl"
+# examples
+output_example_deps="avcodec avformat avutil swscale"
+
# libraries
avcodec_deps="avutil"
avdevice_deps="avutil avcodec avformat"
@@ -2000,7 +2008,7 @@ target_os_default=$(tolower $(uname -s))
host_os=$target_os_default
# configurable options
-enable $LIBRARY_LIST $PROGRAM_LIST
+enable $EXAMPLE_LIST $LIBRARY_LIST $PROGRAM_LIST
enable asm
enable debug
diff --git a/doc/Makefile b/doc/Makefile
index 47063bd..d810e95 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -15,11 +15,20 @@ DOCS-$(CONFIG_PERL) +=
$(MANPAGES) $(PODPAGES)
DOCS-$(CONFIG_TEXI2HTML) += $(HTMLPAGES)
DOCS = $(DOCS-yes)
+DOC_EXAMPLES-$(CONFIG_OUTPUT_EXAMPLE) += output
+ALL_DOC_EXAMPLES = output
+
+DOC_EXAMPLES := $(DOC_EXAMPLES-yes:%=doc/examples/%$(EXESUF))
+ALL_DOC_EXAMPLES := $(ALL_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
@@ -44,6 +53,8 @@ doc/%.1: doc/%.pod $(GENTEXI)
$(M)pod2man --section=1 --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) $^
@@ -68,7 +79,9 @@ uninstall-man:
$(RM) $(addprefix "$(MANDIR)/man1/",$(ALLMANPAGES))
clean::
- $(RM) doc/*.html doc/*.pod doc/*.1 $(CLEANSUFFIXES:%=doc/%)
doc/avoptions_*.texi
+ $(RM) $(ALL_DOC_EXAMPLES)
+ $(RM) $(CLEANSUFFIXES:%=doc/%) $(CLEANSUFFIXES:%=doc/examples/%)
+ $(RM) doc/*.html doc/*.pod doc/*.1 doc/avoptions_*.texi
$(RM) -r doc/doxy/html
-include $(wildcard $(DOCS:%=%.d))
diff --git a/libavformat/output-example.c b/doc/examples/output.c
similarity index 99%
rename from libavformat/output-example.c
rename to doc/examples/output.c
index eb8cb7d..2cd11f2 100644
--- a/libavformat/output-example.c
+++ b/doc/examples/output.c
@@ -24,7 +24,7 @@
* @file
* libavformat API example.
*
- * @example libavformat/output-example.c
+ * @example doc/examples/output.c
* Output a media file in any supported libavformat format.
* The default codecs are used.
*/
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 7135071..c66b4c6 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -392,7 +392,6 @@ SKIPHEADERS-$(CONFIG_FFRTMPCRYPT_PROTOCOL) += rtmpdh.h
SKIPHEADERS-$(CONFIG_NETWORK) += network.h rtsp.h
EXAMPLES = metadata \
- output \
TESTPROGS = seek \
srtp \
@@ -404,6 +403,3 @@ TOOLS = aviocat
\
ismindex \
pktdumper \
probetest \
-
-$(SUBDIR)output-example$(EXESUF): ELIBS = $(patsubst %,$(LD_LIB),swscale
avutil)
-$(SUBDIR)output-example$(EXESUF): $(call PATH_LIBNAME,swscale)
--
1.8.3.2
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel