mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-22 12:41:21 +00:00
Add undefined behaviour sanitizer to the Makefile.
While here update some comments and add a comment sections for the command line variables.
This commit is contained in:
parent
a98d533ae1
commit
a52402fd3c
1 changed files with 25 additions and 0 deletions
25
Makefile
25
Makefile
|
@ -10,6 +10,7 @@
|
|||
# Base dependencies: #
|
||||
# - SDL 2.0 #
|
||||
# - libGL #
|
||||
# - Vulkan headers #
|
||||
# #
|
||||
# Optional dependencies: #
|
||||
# - CURL #
|
||||
|
@ -18,11 +19,22 @@
|
|||
# Platforms: #
|
||||
# - FreeBSD #
|
||||
# - Linux #
|
||||
# - NetBSD #
|
||||
# - OpenBSD #
|
||||
# - OS X #
|
||||
# - Windows (MinGW) #
|
||||
# ------------------------------------------------------ #
|
||||
|
||||
# Variables
|
||||
# ---------
|
||||
|
||||
# - ASAN: Builds with address sanitizer, includes DEBUG.
|
||||
# - DEBUG: Builds a debug build, forces -O0 and adds debug symbols.
|
||||
# - VERBOSE: Prints full compile, linker and misc commands.
|
||||
# - UBSAN: Builds with undefined behavior sanitizer, includes DEBUG.
|
||||
|
||||
# ----------
|
||||
|
||||
# User configurable options
|
||||
# -------------------------
|
||||
|
||||
|
@ -117,6 +129,11 @@ ifdef ASAN
|
|||
DEBUG=1
|
||||
endif
|
||||
|
||||
# UBSAN includes DEBUG
|
||||
ifdef UBSAN
|
||||
DEBUG=1
|
||||
endif
|
||||
|
||||
# ----------
|
||||
|
||||
# Base CFLAGS. These may be overridden by the environment.
|
||||
|
@ -127,6 +144,9 @@ CFLAGS ?= -O0 -g -Wall -pipe
|
|||
ifdef ASAN
|
||||
CFLAGS += -fsanitize=address
|
||||
endif
|
||||
ifdef UBSAN
|
||||
CFLAGS += -fsanitize=undefined
|
||||
endif
|
||||
else
|
||||
CFLAGS ?= -O2 -Wall -pipe -fomit-frame-pointer
|
||||
endif
|
||||
|
@ -288,6 +308,11 @@ ifdef ASAN
|
|||
LDFLAGS += -fsanitize=address
|
||||
endif
|
||||
|
||||
# Link undefined behavior sanitizer if requested.
|
||||
ifdef UBSAN
|
||||
LDFLAGS += -fsanitize=undefined
|
||||
endif
|
||||
|
||||
# Required libraries.
|
||||
ifeq ($(YQ2_OSTYPE),Linux)
|
||||
override LDFLAGS += -lm -ldl -rdynamic
|
||||
|
|
Loading…
Reference in a new issue