From bbde9ab464cfbc1760f640666f29084a6c2ba2cd Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Mon, 1 Apr 2013 21:05:01 +0700 Subject: [PATCH] Fix git version in nightlies --- Makefile.in | 6 ++++-- version.sh | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 02ed37b9..2558a18d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -101,12 +101,14 @@ src/%.o: src/%.cpp Makefile $(E) Building core object $*... $(Q)$(CXX) $(CXXFLAGS) -c -o $@ $< -MD -MF .depend/$*.dep -MT $@ -# If git-describe differs from .version_extra, add a phony target to dependencies, forcing version.o to be recompiled -# znc-0.200-430-g80acaa7 -> -DVERSION_EXTRA="\"-git-430-80acaa7\"" +ifneq "THIS_IS_NOT_NIGHTLY" "" +# If git commit was changed since previous build, add a phony target to dependencies, forcing version.o to be recompiled +# Nightlies have pregenerated version.cpp src/version.cpp: Makefile version.sh $(shell if [ x`cat .version_extra 2> /dev/null` != x`$(srcdir)/version.sh $(GIT) 2> /dev/null` ]; then echo version_extra_recompile; fi) @mkdir -p .depend src $(E) Building source file version.cpp... $(Q)WRITE_OUTPUT=yes $(srcdir)/version.sh "$(GIT)" > .version_extra 2> /dev/null +endif install: znc $(LIBZNC) test -d $(DESTDIR)$(bindir) || $(INSTALL) -d $(DESTDIR)$(bindir) diff --git a/version.sh b/version.sh index 5dde761d..91807a67 100755 --- a/version.sh +++ b/version.sh @@ -1,5 +1,7 @@ #!/bin/sh +# When changing this file, remember also about nightlies + # Get the path to the source directory GIT_DIR=`dirname $0`