summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 15 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 86a4878a..39496fb7 100644
--- a/Makefile
+++ b/Makefile
@@ -29,6 +29,12 @@
#
#
+# Trusted Firmware Version
+#
+VERSION_MAJOR := 0
+VERSION_MINOR := 4
+
+#
# Default values for build configurations
#
@@ -76,6 +82,13 @@ else
BUILD_TYPE := release
endif
+# Default build string (git branch and commit)
+ifeq (${BUILD_STRING},)
+ BUILD_STRING := $(shell git log -n 1 --pretty=format:"%h")
+endif
+
+VERSION_STRING := v${VERSION_MAJOR}.${VERSION_MINOR}(${BUILD_TYPE}):${BUILD_STRING}
+
BL_COMMON_SOURCES := common/bl_common.c \
common/debug.c \
common/tf_printf.c \
@@ -377,7 +390,8 @@ $(BUILD_DIR) :
$(ELF) : $(OBJS) $(LINKERFILE)
@echo " LD $$@"
- @echo 'const char build_message[] = "Built : "__TIME__", "__DATE__;' | \
+ @echo 'const char build_message[] = "Built : "__TIME__", "__DATE__; \
+ const char version_string[] = "${VERSION_STRING}";' | \
$$(CC) $$(CFLAGS) -xc - -o $(BUILD_DIR)/build_message.o
$$(Q)$$(LD) -o $$@ $$(LDFLAGS) -Map=$(MAPFILE) --script $(LINKERFILE) \
$(BUILD_DIR)/build_message.o $(OBJS)