examples: move API examples to a dedicated dir in doc
authorStefano Sabatini <stefano.sabatini-lala@poste.it>
Sun, 29 May 2011 10:47:40 +0000 (12:47 +0200)
committerStefano Sabatini <stefano.sabatini-lala@poste.it>
Mon, 30 May 2011 07:20:06 +0000 (09:20 +0200)
doc/examples/Makefile [new file with mode: 0644]
doc/examples/api-example.c [moved from libavcodec/api-example.c with 100% similarity]
doc/examples/output-example.c [moved from libavformat/output-example.c with 100% similarity]
libavcodec/Makefile
libavformat/Makefile

diff --git a/doc/examples/Makefile b/doc/examples/Makefile
new file mode 100644 (file)
index 0000000..facbd7e
--- /dev/null
@@ -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)
index 95d08ea..76cb8cd 100644 (file)
@@ -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
index 55f6152..6d3a027 100644 (file)
@@ -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