Get revision at build time
This commit is contained in:
parent
dcf162259c
commit
cab7c2a50a
|
@ -1,5 +1,6 @@
|
||||||
/.depend
|
/.depend
|
||||||
/Makefile.config
|
/Makefile.config
|
||||||
|
/Makefile.version
|
||||||
Transmission.xcodeproj/*.mode1
|
Transmission.xcodeproj/*.mode1
|
||||||
Transmission.xcodeproj/*.pbxuser
|
Transmission.xcodeproj/*.pbxuser
|
||||||
beos/.depend
|
beos/.depend
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -1,12 +1,13 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
-include Makefile.config
|
-include Makefile.config
|
||||||
include Makefile.common
|
|
||||||
|
|
||||||
ifndef CONFIGURE_RUN
|
ifndef CONFIGURE_RUN
|
||||||
$(error You must run ./configure first)
|
$(error You must run ./configure first)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
-include Makefile.version
|
||||||
|
include Makefile.common
|
||||||
|
|
||||||
ifneq ($(SYSTEM),Darwin)
|
ifneq ($(SYSTEM),Darwin)
|
||||||
|
|
||||||
TARGETS = .cli
|
TARGETS = .cli
|
||||||
|
@ -19,7 +20,7 @@ endif
|
||||||
|
|
||||||
all: $(TARGETS)
|
all: $(TARGETS)
|
||||||
|
|
||||||
.lib:
|
.lib: .version
|
||||||
@echo "* Building libtransmission"
|
@echo "* Building libtransmission"
|
||||||
@$(MAKE) -C libtransmission
|
@$(MAKE) -C libtransmission
|
||||||
|
|
||||||
|
@ -59,7 +60,7 @@ endif
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
all:
|
all: .version
|
||||||
@$(MAKE) -C macosx
|
@$(MAKE) -C macosx
|
||||||
@xcodebuild -alltargets -activeconfiguration | grep -v "^$$"
|
@xcodebuild -alltargets -activeconfiguration | grep -v "^$$"
|
||||||
|
|
||||||
|
@ -97,3 +98,9 @@ package-release:
|
||||||
$(PACKAGE_RULE2)
|
$(PACKAGE_RULE2)
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Makefile.version: .version
|
||||||
|
|
||||||
|
.version:
|
||||||
|
@echo "Checking SVN revision..."
|
||||||
|
@./version.sh
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
include ../Makefile.config
|
include ../Makefile.config
|
||||||
|
include ../Makefile.version
|
||||||
include ../Makefile.common
|
include ../Makefile.common
|
||||||
|
|
||||||
SRCS = transmissioncli.c
|
SRCS = transmissioncli.c
|
||||||
|
|
|
@ -18,8 +18,6 @@ CXX="${CXX-c++}"
|
||||||
CXXFLAGS="${CXXFLAGS}"
|
CXXFLAGS="${CXXFLAGS}"
|
||||||
LDFLAGS="${LDFLAGS}"
|
LDFLAGS="${LDFLAGS}"
|
||||||
|
|
||||||
SVNREV="`echo '$Rev$' | sed 's/[^0-9]*//g'`"
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions
|
# Functions
|
||||||
#
|
#
|
||||||
|
@ -291,7 +289,6 @@ lrintf_test
|
||||||
rm -f Makefile.config
|
rm -f Makefile.config
|
||||||
cat > Makefile.config << EOF
|
cat > Makefile.config << EOF
|
||||||
CONFIGURE_RUN = yes
|
CONFIGURE_RUN = yes
|
||||||
SVN_REVISION = $SVNREV
|
|
||||||
SYSTEM = $SYSTEM
|
SYSTEM = $SYSTEM
|
||||||
PREFIX = $PREFIX
|
PREFIX = $PREFIX
|
||||||
LOCALEDIR = $LOCALEDIR
|
LOCALEDIR = $LOCALEDIR
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
include ../Makefile.config
|
include ../Makefile.config
|
||||||
|
include ../Makefile.version
|
||||||
include ../Makefile.common
|
include ../Makefile.common
|
||||||
|
|
||||||
Info.plist: Info.plist.in ../Makefile.common
|
Info.plist: Info.plist.in ../Makefile.version ../Makefile.common
|
||||||
$(RM) $@
|
$(RM) $@
|
||||||
sed "s/%%VERSION%%/$(VERSION_STRING)/g" < $< > $@
|
sed "s/%%VERSION%%/$(VERSION_STRING)/g" < $< > $@
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
#! /bin/sh
|
||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
|
||||||
|
REVMAX=0
|
||||||
|
|
||||||
|
for pattern in '*.[chm]' '*.cpp' '*.po' 'Makefile*' 'configure' 'version.sh'; do
|
||||||
|
for f in `find . -name "$pattern"`; do
|
||||||
|
REV=`grep '\$Id:' $f | sed 's/.*\$Id: [^ ]* \([0-9]*\) .*/\1/'`
|
||||||
|
if [ -n "$REV" ]; then
|
||||||
|
if [ "$REV" -gt "$REVMAX" ]; then
|
||||||
|
REVMAX="$REV"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -f Makefile.version
|
||||||
|
echo "SVN_REVISION = $REVMAX" > Makefile.version
|
||||||
|
|
||||||
|
exit 0
|
Loading…
Reference in New Issue