From c5f62bff95eea5969f3fe0afda55e5be966a4dd2 Mon Sep 17 00:00:00 2001 From: d00f <8052722+DrDoof@users.noreply.github.com> Date: Sun, 25 Oct 2026 22:49:37 +0100 Subject: [PATCH] build: name the sdcc/ revision in the toolchain line A commit hash can be looked up directly, a checksum cannot. Print the last commit that touched sdcc/, with -dirty for local changes, and fall back to the checksum when git is not available. The toolchain directory keeps the checksum. --- Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ec4de1a2..a9f72194 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,13 @@ ifeq ($(origin CC),default) SDCC = $(SDCC_PREFIX)/bin/sdcc CC = $(SDCC) ASM = $(SDCC_PREFIX)/bin/sdas8051 -SDCC_BANNER = $(SDCC_TOOLCHAIN) ($(words $(wildcard sdcc/*.patch)) patches) +SDCC_REV := $(shell git log -1 --format=%h -- sdcc 2>/dev/null) +ifneq ($(SDCC_REV),) +ifneq ($(shell git status --porcelain --untracked-files=no -- sdcc 2>/dev/null),) +SDCC_REV := $(SDCC_REV)-dirty +endif +endif +SDCC_BANNER = $(if $(SDCC_REV),sdcc/ at $(SDCC_REV),$(SDCC_TOOLCHAIN)) ($(words $(wildcard sdcc/*.patch)) patches) else SDCC_BANNER = system endif