Fix git version in nightlies

This commit is contained in:
Alexey Sokolov
2013-04-01 21:05:01 +07:00
parent 10b4890827
commit bbde9ab464
2 changed files with 6 additions and 2 deletions

View File

@@ -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)

View File

@@ -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`