Skip to content

Commit

Permalink
update git version while bootstrap if git is available
Browse files Browse the repository at this point in the history
  • Loading branch information
ClausKlein committed Jul 18, 2012
1 parent b33ff36 commit 69e055c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 7 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,20 @@ ninja.bootstrap: bootstrap.py
fi; \
unzip -o $(gtestarchive); \
fi
if [ -d .git ]; then \
branch=`git status -bsu no`; \
revisioncount=`git log --oneline | wc -l`; \
projectversion=`git describe --tags --long --always`; \
echo "const char* kVersion = \"$${branch}-$${projectversion%%-*}\";" > src/version.h; \
fi
$(RM) build.ninja
./$<
cp -p -b ninja $@
-$(RM) build.ninja

# bootstrap with install ninja!
ninja: ninja.bootstrap build.ninja
./$< -v
./$<

manual:: README.html
README.html: README HACKING GNUmakefile $(bindir)/rst2html-2.7.py
Expand Down
5 changes: 2 additions & 3 deletions src/ninja.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@

namespace {

/// The version number of the current Ninja release. This will always
/// be "git" on trunk.
const char* kVersion = "git";
/// The version number of the current Ninja release.
#include "version.h"

/// Global information passed into subtools.
struct Globals {
Expand Down
1 change: 1 addition & 0 deletions src/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
const char* kVersion = "## develop-b33ff36";

0 comments on commit 69e055c

Please sign in to comment.