Changeset - r9765:c3e5347475e9
[Not reviewed]
master
0 1 0
smatz - 16 years ago 2008-07-31 19:19:29
smatz@openttd.org
(svn r13901) -Fix: make sure REV_NR isn't empty, rev.cpp would fail to compile
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
Makefile.src.in
Show inline comments
 
@@ -122,51 +122,53 @@ REV_NR := $(shell echo $(REVISION) | sed
 
else
 
# Are we a SVN dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/.svn; then echo 1; fi), 1)
 
# Find if the local source if modified
 
# Find the revision like: rXXXX-branch
 
REV := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^URL:.*branch/ { split($$2, a, "/"); BRANCH="-"a[5] } /^Last Changed Rev:/ { REV="r"$$4"$(REV_MODIFIED)" } END { print REV BRANCH }')
 
REV_NR := $(shell LC_ALL=C svn info $(SRC_DIR) | $(AWK) '/^Last Changed Rev:/ { print $$4 }')
 
else
 
# Are we a git dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/../.git; then echo 1; fi), 1)
 
# Find the revision like: gXXXXM-branch
 
REV := g$(shell if head=`LC_ALL=C git rev-parse --verify HEAD 2>/dev/null`; then echo "$$head" | cut -c1-8; fi)$(REV_MODIFIED)$(shell git branch|grep '[*]' | sed 's/\* /-/;s/^-master$$//')
 
REV_NR := $(shell LC_ALL=C cd "$(SRC_DIR)/.." && git log --pretty=format:%s src | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
 
else
 
# Are we a hg (Mercurial) dir?
 
ifeq ($(shell if test -d $(SRC_DIR)/../.hg; then echo 1; fi), 1)
 
# Find the revision like: hXXXXM-branch
 
REV := h$(shell if head=`LC_ALL=C hg tip 2>/dev/null`; then echo "$$head" | head -n 1 | cut -c19-26; fi)$(REV_MODIFIED)$(shell hg branch | sed 's/^/-/;s/^-default$$//')
 
REV_NR := $(shell LC_ALL=C hg log -k "svn" -l 1 --template "{desc}\n" $(SRC_DIR) | grep -m 1 "^(svn r[0-9]*)" | sed "s/.*(svn r\([0-9]*\)).*/\1/" )
 
endif
 
endif
 
endif
 
endif
 

	
 
# Make sure we have something in REV
 
# Make sure we have something in REV and REV_NR
 
ifeq ($(REV),)
 
REV := norev000
 
endif
 
ifeq ($(REV_NR),)
 
REV_NR := 0
 
endif
 

	
 
# This helps to recompile if flags change
 
RES := $(shell if [ "`cat $(CONFIG_CACHE_COMPILER) 2>/dev/null`" != "$(CC_CFLAGS) $(CFLAGS)" ]; then echo "$(CC_CFLAGS) $(CFLAGS)" > $(CONFIG_CACHE_COMPILER); fi )
 
RES := $(shell if [ "`cat $(CONFIG_CACHE_LINKER) 2>/dev/null`" != "$(LDFLAGS) $(LIBS)" ]; then echo "$(LDFLAGS) $(LIBS)" > $(CONFIG_CACHE_LINKER); fi )
 
RES := $(shell if [ "`cat $(CONFIG_CACHE_ENDIAN) 2>/dev/null`" != "$(ENDIAN_FORCE)" ]; then echo "$(ENDIAN_FORCE)" > $(CONFIG_CACHE_ENDIAN); fi )
 

	
 
# If there is a change in the source-file-list, make sure we recheck the deps
 
RES := $(shell if [ "`cat $(CONFIG_CACHE_SOURCE) 2>/dev/null`" != "$(SRCS)" ]; then echo "$(SRCS)" > $(CONFIG_CACHE_SOURCE); fi )
 
# If there is a change in the revision, make sure we recompile rev.cpp
 
RES := $(shell if [ "`cat $(CONFIG_CACHE_VERSION) 2>/dev/null`" != "$(REV)" ]; then echo "$(REV)" > $(CONFIG_CACHE_VERSION); fi )
 

	
 
ifndef MAKEDEPEND
 
# The slow, but always correct, dep-check
 
DEP_MASK := %.d
 
DEPS     := $(OBJS:%.o=%.d)
 

	
 
# Only include the deps if we are compiling everything
 
ifeq ($(filter $(ENDIAN_TARGETS) %.o clean mrproper, $(MAKECMDGOALS)),)
 
-include $(DEPS)
 
else
 
# In case we want to compile a single target, include the .d file for it
 
ifneq ($(filter %.o, $(MAKECMDGOALS)),)
0 comments (0 inline, 0 general)