[FFmpeg-cvslog] r13819 - in trunk: Makefile common.mak configure version.sh

mru subversion
Thu Jun 19 18:57:38 CEST 2008


Author: mru
Date: Thu Jun 19 18:57:38 2008
New Revision: 13819

Log:
enable version.h to be created from subdirs


Modified:
   trunk/Makefile
   trunk/common.mak
   trunk/configure
   trunk/version.sh

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	(original)
+++ trunk/Makefile	Thu Jun 19 18:57:38 2008
@@ -67,14 +67,6 @@ ffserver_g$(EXESUF): FF_LDFLAGS += $(FFS
 %_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
 	$(CC) $(FF_LDFLAGS) -o $@ $< cmdutils.o $(FF_EXTRALIBS)
 
-SVN_ENTRIES = $(SRC_PATH_BARE)/.svn/entries
-ifeq ($(wildcard $(SVN_ENTRIES)),$(SVN_ENTRIES))
-version.h: $(SVN_ENTRIES)
-endif
-
-version.h:
-	$(SRC_PATH)/version.sh $(SRC_PATH)
-
 output_example$(EXESUF): output_example.o $(FF_DEP_LIBS)
 	$(CC) $(CFLAGS) $(FF_LDFLAGS) -o $@ $< $(FF_EXTRALIBS)
 

Modified: trunk/common.mak
==============================================================================
--- trunk/common.mak	(original)
+++ trunk/common.mak	Thu Jun 19 18:57:38 2008
@@ -9,10 +9,16 @@ vpath %.c $(SRC_DIR)
 vpath %.h $(SRC_DIR)
 vpath %.S $(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 \
+          -D_ISOC9X_SOURCE -I$(BUILD_ROOT_REL) -I$(SRC_PATH) $(OPTFLAGS)
 
 %.o: %.c
 	$(CC) $(CFLAGS) $(LIBOBJFLAGS) -c -o $@ $<
@@ -34,6 +40,14 @@ CFLAGS = -DHAVE_AV_CONFIG_H -D_FILE_OFFS
 
 %$(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) $@
+
 install: install-libs install-headers
 
 uninstall: uninstall-libs uninstall-headers

Modified: trunk/configure
==============================================================================
--- trunk/configure	(original)
+++ trunk/configure	Thu Jun 19 18:57:38 2008
@@ -969,7 +969,7 @@ SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMA
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
 # gcc stupidly only outputs the basename of targets with -MM
-DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/,"'
+DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,[[:space:]]version\\.h,\$$(BUILD_ROOT_REL)/&,"'
 
 # find source path
 source_path="`dirname \"$0\"`"

Modified: trunk/version.sh
==============================================================================
--- trunk/version.sh	(original)
+++ trunk/version.sh	Thu Jun 19 18:57:38 2008
@@ -20,5 +20,5 @@ OLD_REVISION=`cat version.h 2> /dev/null
 
 # Update version.h only on revision changes to avoid spurious rebuilds
 if test "$NEW_REVISION" != "$OLD_REVISION"; then
-    echo "$NEW_REVISION" > version.h
+    echo "$NEW_REVISION" > "$2"
 fi




More information about the ffmpeg-cvslog mailing list