mirror of
https://github.com/Interlisp/maiko.git
synced 2026-01-26 03:51:32 +00:00
Adds MaikoGitVersion string to vdate.o
The variable MaikoGitVersion will contain a git revision from the head of the source tree along with an indication if the status was "dirty". If git is not present on the system or the directory that the build happened in was not under git control the version will be "none".
This commit is contained in:
16
bin/mkvdate
16
bin/mkvdate
@@ -1,6 +1,22 @@
|
||||
#!/bin/sh
|
||||
if command -v "git" >/dev/null 2>&1; then
|
||||
MAIKO_REV="$(git status --porcelain)"
|
||||
if [ $? == 0 ]; then
|
||||
if [ ! -z "$(git status --porcelain)" ]; then
|
||||
MAIKO_REV="$(git rev-parse --short HEAD)-dirty"
|
||||
else
|
||||
MAIKO_REV="$(git rev-parse --short HEAD)"
|
||||
fi
|
||||
else
|
||||
MAIKO_REV="none"
|
||||
fi
|
||||
else
|
||||
MAIKO_REV = "none"
|
||||
fi
|
||||
cat <<EOF
|
||||
#include <time.h>
|
||||
extern const time_t MDate;
|
||||
const time_t MDate = $(date +%s);
|
||||
extern const char *MaikoGitVersion;
|
||||
const char *MaikoGitVersion = "maiko git version: $MAIKO_REV";
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user