From 87b73606f12a3b57aef3c1f92b41ba5c6a42093a Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 27 Aug 2014 19:04:04 -0400 Subject: [PATCH] Add a VERSION define --- Makefile | 2 ++ _Makefile.master | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index bb97963b..5a22bead 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,10 @@ PORT = /dev/cu.usbmodem1421 ARDUINO_LIBS = #ARDUINO_CORE_PATH = hardware/keyboardio/cores/keyboardio #ALTERNATE_CORE = keyboardio +GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always) include _Makefile.Master + astyle: astyle --style=linux ArduinoKeyboard.ino *.h diff --git a/_Makefile.master b/_Makefile.master index 758a21d4..8d2550b9 100644 --- a/_Makefile.master +++ b/_Makefile.master @@ -352,6 +352,13 @@ ifdef EXT_C_FLAGS endif # Add extracted variable to compiler flags. +# + + +ifdef GIT_VERSION + EXTRA_FLAGS += -DVERSION=\"$(GIT_VERSION)\" +endif + ifdef BUILD_BOARD EXTRA_FLAGS += -DARDUINO_$(BUILD_BOARD) endif