aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/dune10
-rwxr-xr-xtools/git_head.sh9
2 files changed, 19 insertions, 0 deletions
diff --git a/tools/dune b/tools/dune
new file mode 100644
index 0000000..2e223d4
--- /dev/null
+++ b/tools/dune
@@ -0,0 +1,10 @@
+(library
+ (name tools))
+
+(rule
+ (target git_hash.ml)
+ (deps git_head.sh)
+ (action
+ (with-stdout-to
+ %{target}
+ (bash "./git_head.sh"))))
diff --git a/tools/git_head.sh b/tools/git_head.sh
new file mode 100755
index 0000000..42c6dcb
--- /dev/null
+++ b/tools/git_head.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+# Include the git hash in an OCaml file.
+
+revision=$(git rev-parse --short HEAD)
+compile_date=$(date +%Y/%m/%d)
+
+
+echo "let revision = \"${revision} - compiled on ${compile_date}\""
+