From d8148255d3dd375957c12f70d018b834433285c4 Mon Sep 17 00:00:00 2001 From: Piotr Dymacz Date: Mon, 6 Feb 2017 10:21:31 +0100 Subject: [PATCH] Include git branch and hash in image filename --- Makefile | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c894b80..10863b3 100644 --- a/Makefile +++ b/Makefile @@ -89,9 +89,21 @@ $(if $(IMG_LZMA),\ ) endef +define git_branch +$(shell git symbolic-ref --short -q HEAD 2>/dev/null || echo "unknown") +endef + +define git_hash +$(shell git rev-parse --short=8 -q HEAD 2>/dev/null || echo "unknown") +endef + +define git_branch_hash +git_$(call git_branch)-$(call git_hash) +endef + # $(1): file extension define img_name -u-boot_mod__$(shell date +"%Y%m%d")__$@$(if \ +u-boot_mod__$(shell date +"%Y%m%d")__$(call git_branch_hash)__$@$(if \ $(filter $(IMG_RAM),1),__RAM-LOAD-ONLY)$(if $(1),.$(1)) endef -- 2.25.1