diff --git a/doc/examples/Makefile b/doc/examples/Makefile new file mode 100644 index 0000000000..facbd7e178 --- /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 95d08eaaa8..76cb8cd161 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 55f6152f8d..6d3a0276de 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