changeset 26155:ba3e34112e47

sync with FFmpeg r12354
author diego
date Fri, 07 Mar 2008 00:22:09 +0000
parents 0bb26e5c076c
children 3ba245a1febf
files common.mak
diffstat 1 files changed, 28 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/common.mak	Thu Mar 06 20:44:47 2008 +0000
+++ b/common.mak	Fri Mar 07 00:22:09 2008 +0000
@@ -2,17 +2,28 @@
 # common bits used by all libraries
 #
 
-VPATH = $(SRC_PATH_BARE)/lib$(NAME)
-SRC_DIR = "$(VPATH)"
+LIBSRC = $(SRC_PATH_BARE)/lib$(NAME)
+
+vpath %.c $(LIBSRC)
+vpath %.h $(LIBSRC)
+vpath %.S $(LIBSRC)
+
+SRC_DIR = "$(LIBSRC)"
+
+ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
 
 CFLAGS   += $(CFLAGS-yes)
 OBJS     += $(OBJS-yes)
 ASM_OBJS += $(ASM_OBJS-yes)
 CPP_OBJS += $(CPP_OBJS-yes)
+FFLIBS   += $(FFLIBS-yes)
 
 CFLAGS += -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
           -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) \
-          -I$(SRC_PATH)/libavutil $(OPTFLAGS)
+          $(addprefix -I$(SRC_PATH)/lib,$(ALLFFLIBS)) $(OPTFLAGS)
+
+EXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
+LDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
 
 SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPPOBJS:.o=.cpp)
 OBJS := $(OBJS) $(ASM_OBJS) $(CPPOBJS)
@@ -28,6 +39,7 @@
 	$(LN_S) $^ $@
 
 $(SLIBNAME_WITH_MAJOR): $(OBJS)
+	$(SLIB_CREATE_DEF_CMD)
 	$(CC) $(SHFLAGS) $(LDFLAGS) -o $@ $^ $(EXTRALIBS) $(EXTRAOBJS)
 	$(SLIB_EXTRA_CMD)
 
@@ -43,7 +55,7 @@
 %.ho: %.h
 	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
 
-ALLHEADERS = $(subst $(VPATH)/,,$(wildcard $(VPATH)/*.h))
+ALLHEADERS = $(subst $(LIBSRC)/,,$(wildcard $(LIBSRC)/*.h))
 checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
 
 depend dep: $(SRCS)
@@ -51,7 +63,7 @@
 
 clean::
 	rm -f *.o *~ *.a *.lib *.so *.so.* *.dylib *.dll \
-	      *.def *.dll.a *.exp *.ho
+	      *.def *.dll.a *.exp *.ho *.map $(TESTS)
 
 distclean: clean
 	rm -f .depend
@@ -78,10 +90,12 @@
 	install -m 644 $(LIBNAME) "$(LIBDIR)"
 	$(LIB_INSTALL_EXTRA_CMD)
 
+INCINSTDIR = $(INCDIR)/lib$(NAME)
+
 install-headers:
-	install -d "$(INCDIR)"
+	install -d "$(INCINSTDIR)"
 	install -d "$(LIBDIR)/pkgconfig"
-	install -m 644 $(addprefix $(SRC_DIR)/,$(HEADERS)) "$(INCDIR)"
+	install -m 644 $(addprefix $(SRC_DIR)/,$(HEADERS)) "$(INCINSTDIR)"
 	install -m 644 $(BUILD_ROOT)/lib$(NAME).pc "$(LIBDIR)/pkgconfig"
 
 uninstall: uninstall-libs uninstall-headers
@@ -94,9 +108,14 @@
 	-rm -f "$(LIBDIR)/$(LIBNAME)"
 
 uninstall-headers::
-	rm -f $(addprefix "$(INCDIR)/",$(HEADERS))
+	rm -f $(addprefix "$(INCINSTDIR)/",$(HEADERS))
 	rm -f "$(LIBDIR)/pkgconfig/lib$(NAME).pc"
 
-.PHONY: all depend dep clean distclean install* uninstall*
+tests: $(TESTS)
+
+%-test$(EXESUF): %.c $(LIBNAME)
+	$(CC) $(CFLAGS) $(LDFLAGS) -DTEST -o $@ $^ $(EXTRALIBS)
+
+.PHONY: all depend dep clean distclean install* uninstall* tests
 
 -include .depend