aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authortstellanova <tstellanova+github@gmail.com>2013-09-06 10:18:08 -0700
committertstellanova <tstellanova+github@gmail.com>2013-09-06 10:18:08 -0700
commit23a355644b69585d11011954f1d4cbc9e04a8f3b (patch)
treeb175d820943e67fbe90aca48187229e3a49d542f /Makefile
parent3d821b8131f762836051b01bc8b2af145d99ebee (diff)
downloadpx4-firmware-23a355644b69585d11011954f1d4cbc9e04a8f3b.tar.gz
px4-firmware-23a355644b69585d11011954f1d4cbc9e04a8f3b.tar.bz2
px4-firmware-23a355644b69585d11011954f1d4cbc9e04a8f3b.zip
grab the git hash and inject it into every log file header
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 11 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 83a6f3ce9..0a8562251 100644
--- a/Makefile
+++ b/Makefile
@@ -40,6 +40,17 @@ export PX4_BASE := $(realpath $(dir $(lastword $(MAKEFILE_LIST))))/
include $(PX4_BASE)makefiles/setup.mk
#
+# Get a version string provided by git
+# This assumes that git command is available and that
+# the directory holding this file also contains .git directory
+#
+GIT_DESC := $(shell git log -1 --pretty=format:%H)
+ifneq ($(words $(GIT_DESC)),1)
+ GIT_DESC := "unknown_git_version"
+endif
+export GIT_DESC
+
+#
# Canned firmware configurations that we (know how to) build.
#
KNOWN_CONFIGS := $(subst config_,,$(basename $(notdir $(wildcard $(PX4_MK_DIR)config_*.mk))))