[FFmpeg-cvslog] examples: move API examples to a dedicated dir in doc

Stefano Sabatini git at videolan.org
Mon May 30 09:46:44 CEST 2011


ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Sun May 29 12:47:40 2011 +0200| [9362b5094114bd2f0cea74691ad900b19dac64f8] | committer: Stefano Sabatini

examples: move API examples to a dedicated dir in doc

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

 doc/examples/Makefile                          |   21 +++++++++++++++++++++
 {libavcodec => doc/examples}/api-example.c     |    0
 {libavformat => doc/examples}/output-example.c |    0
 libavcodec/Makefile                            |    2 --
 libavformat/Makefile                           |    1 -
 5 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/doc/examples/Makefile b/doc/examples/Makefile
new file mode 100644
index 0000000..facbd7e
--- /dev/null
+++ b/doc/examples/Makefile
@@ -0,0 +1,21 @@
+# use pkg-config for getting CFLAGS abd LDFLAGS
+FFMPEG_LIBS=libavdevice libavformat libavfilter libavcodec libswscale libavutil
+CFLAGS+=$(shell pkg-config  --cflags $(FFMPEG_LIBS))
+LDFLAGS+=$(shell pkg-config --libs $(FFMPEG_LIBS))
+
+EXAMPLES=api-example output-example
+
+OBJS=$(addsuffix .o,$(EXAMPLES))
+
+%: %.o
+	$(CC) $< $(LDFLAGS) -o $@
+
+%.o: %.c
+	$(CC) $< $(CFLAGS) -c -o $@
+
+.phony: all clean
+
+all: $(OBJS) $(EXAMPLES)
+
+clean:
+	rm -rf $(EXAMPLES) $(OBJS)
diff --git a/libavcodec/api-example.c b/doc/examples/api-example.c
similarity index 100%
rename from libavcodec/api-example.c
rename to doc/examples/api-example.c
diff --git a/libavformat/output-example.c b/doc/examples/output-example.c
similarity index 100%
rename from libavformat/output-example.c
rename to doc/examples/output-example.c
diff --git a/libavcodec/Makefile b/libavcodec/Makefile
index 95d08ea..76cb8cd 100644
--- a/libavcodec/Makefile
+++ b/libavcodec/Makefile
@@ -674,8 +674,6 @@ SKIPHEADERS-$(CONFIG_VAAPI)            += vaapi_internal.h
 SKIPHEADERS-$(CONFIG_VDPAU)            += vdpau.h
 SKIPHEADERS-$(CONFIG_XVMC)             += xvmc.h
 
-EXAMPLES = api
-
 TESTPROGS = cabac dct eval fft fft-fixed h264 iirfilter rangecoder snow
 TESTPROGS-$(HAVE_MMX) += motion
 TESTOBJS = dctref.o
diff --git a/libavformat/Makefile b/libavformat/Makefile
index 55f6152..6d3a027 100644
--- a/libavformat/Makefile
+++ b/libavformat/Makefile
@@ -340,7 +340,6 @@ OBJS-$(CONFIG_UDP_PROTOCOL)              += udp.o
 # libavdevice dependencies
 OBJS-$(CONFIG_JACK_INDEV)                += timefilter.o
 
-EXAMPLES  = output
 TESTPROGS = timefilter
 
 include $(SUBDIR)../subdir.mak



More information about the ffmpeg-cvslog mailing list