Skip to content

Commit

Permalink
Update makefile whith NDEBUG, sanitize address and better git version
Browse files Browse the repository at this point in the history
  • Loading branch information
drhelius committed Jan 5, 2025
1 parent a6be35d commit 7dbe6cd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
4 changes: 2 additions & 2 deletions platforms/libretro/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 12 additions & 11 deletions platforms/shared/desktop/makefiles/Makefile.common
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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)
Expand Down

0 comments on commit 7dbe6cd

Please sign in to comment.