From 7dbe6cd46baed2baa35bbe4b3c06c965d0ed944b Mon Sep 17 00:00:00 2001 From: Ignacio Sanchez Gines <863613+drhelius@users.noreply.github.com> Date: Sun, 5 Jan 2025 12:45:55 +0100 Subject: [PATCH] Update makefile whith NDEBUG, sanitize address and better git version --- platforms/libretro/Makefile | 4 ++-- .../shared/desktop/makefiles/Makefile.common | 23 ++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/platforms/libretro/Makefile b/platforms/libretro/Makefile index db43c03..5311506 100644 --- a/platforms/libretro/Makefile +++ b/platforms/libretro/Makefile @@ -329,8 +329,8 @@ else CXXFLAGS += -O3 -DNDEBUG endif -GIT_VERSION ?= "$(shell git describe --abbrev=7 --dirty --always --tags || echo unknown)" -ifneq ($(GIT_VERSION)," unknown") +GIT_VERSION ?= $(shell git describe --abbrev=7 --dirty --always --tags || echo unknown) +ifneq ($(GIT_VERSION), unknown) CXXFLAGS += -DEMULATOR_BUILD=\"$(GIT_VERSION)\" endif diff --git a/platforms/shared/desktop/makefiles/Makefile.common b/platforms/shared/desktop/makefiles/Makefile.common index f4ff0dd..34e436a 100644 --- a/platforms/shared/desktop/makefiles/Makefile.common +++ b/platforms/shared/desktop/makefiles/Makefile.common @@ -1,19 +1,20 @@ define HEADER - ____ __ - / ___| ___ __ _ _ __ __ _ _ __ __ _ / _|_ __ - | | _ / _ \\/ _` | '__/ _` | '__/ _` | |_\\ \\/ / - | |_| | __/ (_| | | | (_| | | | (_| | _|> < - \____|\\___|\\__,_|_| \\__, |_| \__,_|_| /_/\\_\\ - |___/ + ____ __ + / ___| ___ __ _ _ __ __ _ _ __ __ _ / _|_ __ + | | _ / _ \/ _` | '__/ _` | '__/ _` | |_\ \/ / + | |_| | __/ (_| | | | (_| | | | (_| | _|> < + \____|\___|\__,_|_| \__, |_| \__,_|_| /_/\_\ + |___/ ** Building for $(PLATFORM) platform ** ** Git version: $(GIT_VERSION) ** + ** Profile: $(BUILD_CONFIG) ** endef export HEADER TARGET_NAME = geargrafx -GIT_VERSION := "$(shell git describe --abbrev=7 --dirty --always --tags)" +GIT_VERSION := $(shell git describe --abbrev=7 --dirty --always --tags) UNAME_S := $(shell uname -s) PLATFORM = "undefined" @@ -36,17 +37,17 @@ CFLAGS += -std=c99 DEBUG ?= 0 ifeq ($(DEBUG), 1) BUILD_CONFIG = Debug - CPPFLAGS +=-DDEBUG -g3 + CPPFLAGS += -DDEBUG -g3 else BUILD_CONFIG = Release - CPPFLAGS +=-DNDEBUG -O3 -flto=auto + CPPFLAGS += -DNDEBUG -O3 -flto=auto LDFLAGS += -O3 -flto=auto endif SANITIZE ?= 0 ifeq ($(SANITIZE), 1) - CPPFLAGS +=-fsanitize=address - LDFLAGS += -lasan + CPPFLAGS += -fsanitize=address + LDFLAGS += -fsanitize=address endif ifeq ($(UNAME_S), Linux)