]>
Commit | Line | Data |
---|---|---|
5c21198b | 1 | #!/bin/sh |
d711f013 | 2 | |
66bd0ba3 | 3 | VERSION="0.9.12" |
b6562f75 | 4 | OUT="version.h" |
7e10ba7c | 5 | |
d711f013 JB |
6 | if head=`git rev-parse --verify HEAD 2>/dev/null`; then |
7 | git update-index --refresh --unmerged > /dev/null | |
2dc285b7 JB |
8 | descr=$(git describe) |
9 | ||
10 | # on git builds check that the version number above | |
11 | # is correct... | |
5c21198b | 12 | [ "${descr%%-*}" = "v$VERSION" ] || exit 2 |
2dc285b7 | 13 | |
b6562f75 JB |
14 | echo -n '#define IW_VERSION "' > "$OUT" |
15 | echo -n "${descr#v}" >> "$OUT" | |
d711f013 | 16 | if git diff-index --name-only HEAD | read dummy ; then |
b6562f75 | 17 | echo -n "-dirty" >> "$OUT" |
d711f013 | 18 | fi |
b6562f75 | 19 | echo '"' >> "$OUT" |
d711f013 | 20 | else |
12045529 | 21 | echo "#define IW_VERSION \"$VERSION\"" > "$OUT" |
d711f013 | 22 | fi |