Kokoro: make script runnable locally

Wanted to add lint and format checking but kokoro doesn't have the
dependencies. We'll try and get those running later.

Change-Id: Ida45cd8b2e79866469f0a98525be456118945348
diff --git a/kokoro/ubuntu/build.sh b/kokoro/ubuntu/build.sh
index 84718f2..85f4f98 100755
--- a/kokoro/ubuntu/build.sh
+++ b/kokoro/ubuntu/build.sh
@@ -2,8 +2,29 @@
 
 # Fail on any error.
 set -e
-# # Display commands being run.
+# Display commands being run.
 set -x
 
-cd git/hafnium
-CLANG="clang-3.9" make
+# Detect server vs local run. Local run should be from the project's root
+# directory.
+if [ -v KOKORO_JOB_NAME ]
+then
+	# Server
+	cd git/hafnium
+	export CLANG="clang-3.9"
+else
+	# Local
+	export CLANG=1
+fi
+
+# Check the build works
+make
+
+# # Check to code looks healthy, failing if any changes were made
+# make format
+# make tidy
+#
+# if [[ `git status --porcelain` ]]
+# then
+# 	exit 1
+# fi