From 057c870bc855fba43e61d666355df8acceb76e93 Mon Sep 17 00:00:00 2001 From: Till Blaha <28341894+tblaha@users.noreply.github.com> Date: Wed, 6 Nov 2024 01:16:31 +0100 Subject: [PATCH] enable passing in revision string to makefile --- .gitignore | 1 + Makefile | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 70c0821d8af..0b8464302fb 100644 --- a/.gitignore +++ b/.gitignore @@ -61,3 +61,4 @@ logs/ # remote definition remote.env +.githash diff --git a/Makefile b/Makefile index 4260499840f..e4118716cf8 100644 --- a/Makefile +++ b/Makefile @@ -103,15 +103,19 @@ endif include $(ROOT)/make/targets.mk +REVISION ?= + +ifeq ($(REVISION),) GITHASH := $(shell git log -1 --format="%h") DIRTYFLAG = ifneq ($(shell git diff --shortstat),) DIRTYFLAG = +dirty endif -REVISION := $(GITHASH)$(DIRTYFLAG) +REVISION = $(GITHASH)$(DIRTYFLAG) +endif check_dirty : -ifneq ($(shell git diff --shortstat),) +ifneq (,$(findstring dirty,$(REVISION))) ifeq ($(TARGET), MOCKUP) @echo "Uncommited changes. Continuing with build!" else