changeset 27868:c4913507c4ba

Sync with latest FFmpeg changes.
author diego
date Sat, 08 Nov 2008 09:51:12 +0000
parents b10d3e37076c
children c4fc6b71b123
files common.mak
diffstat 1 files changed, 26 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/common.mak	Sat Nov 08 04:51:46 2008 +0000
+++ b/common.mak	Sat Nov 08 09:51:12 2008 +0000
@@ -8,11 +8,18 @@
 vpath %.c $(SRC_DIR)
 vpath %.h $(SRC_DIR)
 vpath %.S $(SRC_DIR)
+vpath %.asm $(SRC_DIR)
+
+ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
+BUILD_ROOT_REL = .
+else
+BUILD_ROOT_REL = ..
+endif
 
 ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
 
-CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-         -D_ISOC9X_SOURCE -I$(BUILD_ROOT) -I$(SRC_PATH) $(OPTFLAGS)
+CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+          -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
@@ -32,8 +39,18 @@
 %.d: %.cpp
 	$(DEPEND_CMD) > $@
 
+%.o: %.d
+
 %$(EXESUF): %.c
 
+SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
+ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
+$(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
+endif
+
+$(BUILD_ROOT_REL)/version.h:
+	$(SRC_PATH)/version.sh $(SRC_PATH) $@ $(EXTRA_VERSION)
+
 install: install-libs install-headers
 
 uninstall: uninstall-libs uninstall-headers
@@ -43,18 +60,12 @@
 
 CFLAGS   += $(CFLAGS-yes)
 OBJS     += $(OBJS-yes)
-ASM_OBJS += $(ASM_OBJS-yes)
-CPP_OBJS += $(CPP_OBJS-yes)
 FFLIBS   := $(FFLIBS-yes) $(FFLIBS)
 TESTS    += $(TESTS-yes)
 
 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
 FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
 
-SRCS := $(OBJS:.o=.c) $(ASM_OBJS:.o=.S) $(CPP_OBJS:.o=.cpp)
-OBJS := $(OBJS) $(ASM_OBJS) $(CPP_OBJS)
-
-SRCS  := $(addprefix $(SUBDIR),$(SRCS))
 OBJS  := $(addprefix $(SUBDIR),$(OBJS))
 TESTS := $(addprefix $(SUBDIR),$(TESTS))
 
@@ -68,7 +79,7 @@
 
 CLEANSUFFIXES = *.o *~ *.ho
 LIBSUFFIXES   = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
-DISTCLEANSUFFIXES = *.d
+DISTCLEANSUFFIXES = *.d *.pc
 
 define RULES
 $(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
@@ -80,6 +91,12 @@
 $(SUBDIR)%-test.o: $(SUBDIR)%-test.c
 	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
 
+$(SUBDIR)i386/%.o: $(SUBDIR)i386/%.asm
+	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
+
+$(SUBDIR)i386/%.d: $(SUBDIR)i386/%.asm
+	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
+
 clean::
 	rm -f $(TESTS) $(addprefix $(SUBDIR),$(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
 	    $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))