[MPlayer-cvslog] r29176 - in trunk: common.mak subdir.mak

diego subversion at mplayerhq.hu
Mon Apr 13 10:55:21 CEST 2009


Author: diego
Date: Mon Apr 13 10:55:20 2009
New Revision: 29176

Log:
Sync with latest FFmpeg changes.

Modified:
   trunk/common.mak
   trunk/subdir.mak

Modified: trunk/common.mak
==============================================================================
--- trunk/common.mak	Mon Apr 13 00:49:58 2009	(r29175)
+++ trunk/common.mak	Mon Apr 13 10:55:20 2009	(r29176)
@@ -5,9 +5,9 @@
 all: # make "all" default target
 
 ifndef SUBDIR
-vpath %.c $(SRC_DIR)
-vpath %.h $(SRC_DIR)
-vpath %.S $(SRC_DIR)
+vpath %.c   $(SRC_DIR)
+vpath %.h   $(SRC_DIR)
+vpath %.S   $(SRC_DIR)
 vpath %.asm $(SRC_DIR)
 
 ifeq ($(SRC_DIR),$(SRC_PATH_BARE))
@@ -18,14 +18,13 @@ endif
 
 ALLFFLIBS = avcodec avdevice avfilter avformat avutil postproc swscale
 
-CFLAGS := -DHAVE_AV_CONFIG_H -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
-          -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
+CFLAGS := -DHAVE_AV_CONFIG_H -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
 
 %.o: %.S
-	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
+	$(AS) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
 
 %.ho: %.h
 	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -Wno-unused -c -o $@ -x c $<
@@ -48,28 +47,31 @@ ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_E
 $(BUILD_ROOT_REL)/version.h: $(SVN_ENTRIES)
 endif
 
-$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh
+$(BUILD_ROOT_REL)/version.h: $(SRC_PATH_BARE)/version.sh config.mak
 	$< $(SRC_PATH) $@ $(EXTRA_VERSION)
 
 install: install-libs install-headers
 
 uninstall: uninstall-libs uninstall-headers
 
-.PHONY: all depend dep clean distclean install* uninstall* tests
+.PHONY: all depend dep *clean install* uninstall* examples testprogs
 endif
 
-CFLAGS   += $(CFLAGS-yes)
-OBJS     += $(OBJS-yes)
-FFLIBS   := $(FFLIBS-yes) $(FFLIBS)
-TESTS    += $(TESTS-yes)
+OBJS-$(HAVE_MMX) +=  $(MMX-OBJS-yes)
+
+CFLAGS    += $(CFLAGS-yes)
+OBJS      += $(OBJS-yes)
+FFLIBS    := $(FFLIBS-yes) $(FFLIBS)
+TESTPROGS += $(TESTPROGS-yes)
 
 FFEXTRALIBS := $(addprefix -l,$(addsuffix $(BUILDSUF),$(FFLIBS))) $(EXTRALIBS)
-FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(FFLIBS)) $(LDFLAGS)
+FFLDFLAGS   := $(addprefix -L$(BUILD_ROOT)/lib,$(ALLFFLIBS)) $(LDFLAGS)
 
-OBJS  := $(addprefix $(SUBDIR),$(OBJS))
-TESTS := $(addprefix $(SUBDIR),$(TESTS))
+EXAMPLES  := $(addprefix $(SUBDIR),$(addsuffix -example$(EXESUF),$(EXAMPLES)))
+OBJS      := $(addprefix $(SUBDIR),$(OBJS))
+TESTPROGS := $(addprefix $(SUBDIR),$(addsuffix -test$(EXESUF),$(TESTPROGS)))
 
-DEP_LIBS:=$(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME))
+DEP_LIBS := $(foreach NAME,$(FFLIBS),lib$(NAME)/$($(BUILD_SHARED:yes=S)LIBNAME))
 
 ALLHEADERS := $(subst $(SRC_DIR)/,$(SUBDIR),$(wildcard $(SRC_DIR)/*.h $(SRC_DIR)/$(ARCH)/*.h))
 checkheaders: $(filter-out %_template.ho,$(ALLHEADERS:.h=.ho))
@@ -77,37 +79,8 @@ checkheaders: $(filter-out %_template.ho
 DEPS := $(OBJS:.o=.d)
 depend dep: $(DEPS)
 
-CLEANSUFFIXES = *.o *~ *.ho
-LIBSUFFIXES   = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
+CLEANSUFFIXES     = *.o *~ *.ho
 DISTCLEANSUFFIXES = *.d *.pc
-
-define RULES
-$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
-	$(CC) $(FFLDFLAGS) -o $$@ $$^ $(SUBDIR)$(LIBNAME) $(FFEXTRALIBS)
-
-$(SUBDIR)%-test.o: $(SUBDIR)%.c
-	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
-
-$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
-	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
-
-$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
-	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
-
-$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.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))))
-
-distclean:: clean
-	rm -f  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
-            $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
-endef
-
-$(eval $(RULES))
-
-tests: $(TESTS)
+LIBSUFFIXES       = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp *.map
 
 -include $(DEPS)

Modified: trunk/subdir.mak
==============================================================================
--- trunk/subdir.mak	Mon Apr 13 00:49:58 2009	(r29175)
+++ trunk/subdir.mak	Mon Apr 13 10:55:20 2009	(r29176)
@@ -18,7 +18,32 @@ endif
 
 INCINSTDIR := $(INCDIR)/lib$(NAME)
 
+THIS_LIB := $(SUBDIR)$($(BUILD_SHARED:yes=S)LIBNAME)
+
 define RULES
+$(SUBDIR)%$(EXESUF): $(SUBDIR)%.o
+	$(CC) $(FFLDFLAGS) -o $$@ $$^ -l$(FULLNAME) $(FFEXTRALIBS) $$(ELIBS)
+
+$(SUBDIR)%-test.o: $(SUBDIR)%.c
+	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
+
+$(SUBDIR)%-test.o: $(SUBDIR)%-test.c
+	$(CC) $(CFLAGS) -DTEST -c -o $$@ $$^
+
+$(SUBDIR)x86/%.o: $(SUBDIR)x86/%.asm
+	$(YASM) $(YASMFLAGS) -I $$(<D)/ -o $$@ $$<
+
+$(SUBDIR)x86/%.d: $(SUBDIR)x86/%.asm
+	$(YASM) $(YASMFLAGS) -I $$(<D)/ -M -o $$(@:%.d=%.o) $$< > $$@
+
+clean::
+	rm -f $(EXAMPLES) $(addprefix $(SUBDIR),*-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
+	    $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+
+distclean:: clean
+	rm -f  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
+            $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+
 ifdef BUILD_SHARED
 all: $(SUBDIR)$(SLIBNAME)
 
@@ -39,7 +64,7 @@ endif
 
 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
 	install -d "$(SHLIBDIR)"
-	install -m 755 $(SUBDIR)$(SLIBNAME) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
+	install -m 755 $$< "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
 	$(STRIP) "$(SHLIBDIR)/$(SLIBNAME_WITH_VERSION)"
 	cd "$(SHLIBDIR)" && \
 		$(LN_S) $(SLIBNAME_WITH_VERSION) $(SLIBNAME_WITH_MAJOR)
@@ -49,7 +74,7 @@ install-lib$(NAME)-shared: $(SUBDIR)$(SL
 
 install-lib$(NAME)-static: $(SUBDIR)$(LIBNAME)
 	install -d "$(LIBDIR)"
-	install -m 644 $(SUBDIR)$(LIBNAME) "$(LIBDIR)"
+	install -m 644 $$< "$(LIBDIR)"
 	$(LIB_INSTALL_EXTRA_CMD)
 
 install-headers::
@@ -72,3 +97,8 @@ uninstall-headers::
 endef
 
 $(eval $(RULES))
+
+$(EXAMPLES) $(TESTPROGS): $(THIS_LIB) $(DEP_LIBS)
+
+examples: $(EXAMPLES)
+testprogs: $(TESTPROGS)


More information about the MPlayer-cvslog mailing list