From 60e81e2bd2ec15c6007d085411f7b431de5856c1 Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Mon, 31 Mar 2025 19:30:43 -0400 Subject: [PATCH] Make Git hash only dev or debug --- Makefile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index fac5309ef..fe8b603b1 100644 --- a/Makefile +++ b/Makefile @@ -334,15 +334,6 @@ OPT_FLAGS += $(BITS) TARGET := sm64.$(VERSION) -# Stuff for showing the git hash and build time in dev builds -# Originally from https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source -ifneq ($(shell git rev-parse --abbrev-ref HEAD),main) - GIT_HASH=$(shell git rev-parse --short HEAD) - COMPILE_TIME=$(shell date -u +'%Y-%m-%d %H:%M:%S UTC') - C_DEFINES += -DGIT_HASH="\"$(GIT_HASH)\"" -DCOMPILE_TIME="\"$(COMPILE_TIME)\"" -endif - - # GRUCODE - selects which RSP microcode to use. # f3d_old - default for JP and US versions # f3d_new - default for EU and Shindou versions @@ -1024,6 +1015,12 @@ ifeq ($(IS_DEV_OR_DEBUG),0) ifeq ($(OSX_BUILD),0) LDFLAGS += -Wl,--build-id=none endif + + # Stuff for showing the git hash and build time in dev builds + # Originally from https://stackoverflow.com/questions/44038428/include-git-commit-hash-and-or-branch-name-in-c-c-source + GIT_HASH=$(shell git rev-parse --short HEAD) + COMPILE_TIME=$(shell date -u +'%Y-%m-%d %H:%M:%S UTC') + C_DEFINES += -DGIT_HASH="\"$(GIT_HASH)\"" -DCOMPILE_TIME="\"$(COMPILE_TIME)\"" endif # Enable ASLR