From 6708cfc4d3a079527409b2ba2fc75997a7975104 Mon Sep 17 00:00:00 2001 From: Diego Biurrun Date: Sun, 22 Mar 2009 22:33:41 +0000 Subject: [PATCH] Add rule for building API example programs. Originally committed as revision 18161 to svn://svn.ffmpeg.org/ffmpeg/trunk --- Makefile | 4 +++- common.mak | 6 ++++-- libavcodec/Makefile | 3 ++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 48f9620..c5e7203 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,8 @@ FFLIBS := avdevice avformat avcodec avutil swscale DATA_FILES := $(wildcard $(SRC_DIR)/ffpresets/*.ffpreset) +EXAMPLES = output_example$(EXESUF) + include common.mak FF_LDFLAGS := $(FFLDFLAGS) @@ -45,7 +47,7 @@ $(PROGS): %$(EXESUF): %_g$(EXESUF) cp -p $< $@ $(STRIP) $@ -SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS +SUBDIR_VARS := OBJS FFLIBS CLEANFILES DIRS TESTS EXAMPLES define RESET $(1) := diff --git a/common.mak b/common.mak index 9b1ebd7..d0dc7be 100644 --- a/common.mak +++ b/common.mak @@ -54,7 +54,7 @@ install: install-libs install-headers uninstall: uninstall-libs uninstall-headers -.PHONY: all depend dep *clean install* uninstall* tests +.PHONY: all depend dep *clean install* uninstall* examples tests endif CFLAGS += $(CFLAGS-yes) @@ -65,6 +65,7 @@ TESTS += $(TESTS-yes) FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS) FFLDFLAGS := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS) +EXAMPLES := $(addprefix $(SUBDIR),$(EXAMPLES)) OBJS := $(addprefix $(SUBDIR),$(OBJS)) TESTS := $(addprefix $(SUBDIR),$(TESTS)) @@ -97,7 +98,7 @@ $(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm $(YASM) $(YASMFLAGS) -I $$( $$@ clean:: - rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ + rm -f $(EXAMPLES) $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \ $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) distclean:: clean @@ -107,6 +108,7 @@ endef $(eval $(RULES)) +examples: $(EXAMPLES) tests: $(TESTS) -include $(DEPS) diff --git a/libavcodec/Makefile b/libavcodec/Makefile index 4843e09..196be01 100644 --- a/libavcodec/Makefile +++ b/libavcodec/Makefile @@ -525,11 +525,12 @@ OBJS-$(HAVE_VIS) += sparc/dsputil_vis.o \ sparc/simple_idct_vis.o \ +EXAMPLES = apiexample$(EXESUF) + TESTS = $(addsuffix -test$(EXESUF), cabac dct eval fft h264 rangecoder snow) TESTS-$(ARCH_X86) += x86/cpuid-test$(EXESUF) TESTS-$(HAVE_MMX) += motion-test$(EXESUF) -CLEANFILES = apiexample$(EXESUF) DIRS = alpha arm bfin mlib ppc ps2 sh4 sparc x86 include $(SUBDIR)../subdir.mak -- 2.7.4