aboutsummaryrefslogtreecommitdiffstats
path: root/common.mak
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2008-06-19 16:57:38 +0000
committerMåns Rullgård <mans@mansr.com>2008-06-19 16:57:38 +0000
commit9e6165b53eeef2932f2fd13a46c1b636719f7825 (patch)
tree124bb4be4ebc3f306a4c791cb1703db080834dc0 /common.mak
parent74d9441715a2c4b459df50f40025eac5ccb15e96 (diff)
downloadffmpeg-9e6165b53eeef2932f2fd13a46c1b636719f7825.tar.gz
enable version.h to be created from subdirs
Originally committed as revision 13819 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'common.mak')
-rw-r--r--common.mak18
1 files changed, 16 insertions, 2 deletions
diff --git a/common.mak b/common.mak
index e77d960d9c..c0ed6b957e 100644
--- a/common.mak
+++ b/common.mak
@@ -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_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
%$(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