3 #==============================================================================
9 # Author: Øyvind A. Holm <sunny@sunbase.org>
10 # License: GNU General Public License version 2 or later.
11 #==============================================================================
16 exec_date
=STDyearDTS-00-00
18 tag_prefix
="v$exec_version"
19 has_git
=$
(git
--version |
grep -q "git version" && echo 1 ||
echo 0)
22 echo "#define $1 1" >>version.h
25 if test -d ..
/.git
-a $has_git -eq 1; then
26 if git tag |
grep -q ^
$tag_prefix; then
27 numsince
=$
(git log
--format=%h
$tag_prefix..
2>/dev
/null \
33 gitsha
=$
(git rev-parse
--short=12 HEAD
)
34 test -n "$(git diff-index --name-only HEAD)" \
35 && gitsha
="$gitsha-dirty"
36 exec_fullversion
="$exec_version+${numsince}git-$gitsha"
37 exec_date
=$
(git log
-1 --format=%ci | cut
-c -10)
39 exec_fullversion
=$exec_version
43 /* Generated by $progname */
44 #define EXEC_VERSION "$exec_fullversion"
45 #define EXEC_DATE "$exec_date"
48 # GCOV: Compile with coverage code for gcov(1)
49 test -n "$GCOV" && newdef GCOV
51 # NDEBUG: Disable assert()
52 test -n "$NDEBUG" && newdef NDEBUG
54 # Compile with profiling code for gprof(1) to find bottlenecks
55 test -n "$PROF" && newdef PROF
57 # UNUSED: Compile unused code
58 test -n "$UNUSED" && newdef UNUSED
62 # vim: set ts=8 sw=8 sts=8 noet fo+=w tw=79 fenc=UTF-8 :