Use a different strategy for generating version tags

This commit is contained in:
Andreas Öman 2010-03-26 21:20:29 +00:00
parent a1202d7e60
commit f3fa3f0326
3 changed files with 12 additions and 13 deletions

View file

@ -148,10 +148,14 @@ BUNDLE_OBJS=$(BUNDLE_SRCS:%.c=%.o)
OBJDIRS+= $(sort $(dir $(BUNDLE_OBJS)))
.PRECIOUS: ${BUNDLE_SRCS}
VERSION=$(shell support/version.sh)
CURVERSION=$(shell cat ${BUILDDIR}/ver || echo "0")
# Common CFLAGS for all files
CFLAGS_com = -g -funsigned-char -O2
CFLAGS_com += -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
CFLAGS_com += -I${BUILDDIR} -I${CURDIR}/src -I${CURDIR}
CFLAGS_com += -DHTS_VERSION=\"$(VERSION)\"
all: ${PROG}
@ -174,17 +178,19 @@ ${BUILDDIR}/%.so: ${SRCS_EXTRA}
${CC} -O -fbuiltin -fomit-frame-pointer -fPIC -shared -o $@ $< -ldl
clean:
rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundles
rm -rf ${BUILDDIR}/src ${BUILDDIR}/bundles ${BUILDDIR}/ver
find . -name "*~" | xargs rm -f
distclean: clean
rm -rf build.*
# Create tvheadendversion.h
$(BUILDDIR)/tvheadendversion.h:
$(CURDIR)/support/version.sh $(CURDIR) $(BUILDDIR)/tvheadendversion.h
ifneq ($(VERSION), $(CURVERSION))
.PHONY: src/version.c
$(info Version changed)
src/version.c:
echo $(VERSION) >${BUILDDIR}/ver
endif
src/version.c: $(BUILDDIR)/tvheadendversion.h
# Include dependency files if they exist.
-include $(DEPS) $(BUNDLE_DEPS)

View file

@ -1,4 +1,3 @@
#include "tvheadendversion.h"
#include "config.h"
#ifdef HTS_RELEASE_TAG

View file

@ -20,10 +20,4 @@ fi
# no version number found
test $revision || revision=UNKNOWN
NEW_REVISION="#define HTS_VERSION \"$revision\""
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" > "$2"
fi
echo $revision