summaryrefslogtreecommitdiffstatshomepage
path: root/makefile
diff options
context:
space:
mode:
author Oliver Stöneberg <firewave@users.noreply.github.com>2013-05-04 09:48:04 +0000
committer Oliver Stöneberg <firewave@users.noreply.github.com>2013-05-04 09:48:04 +0000
commite7c50f60191fa71fd8bb8a17da27082a6620480f (patch)
treee274c63d94f3fad65ebbb4c21abb780647959732 /makefile
parent78c8555f22a619d9a84fb546492d4bc3b64c1a38 (diff)
added makefile define SANITIZE to specify the sanitizer to use (supported by latest GCC and clang versions) / added additional library necessary to link with clang on linux (nw)
Diffstat (limited to 'makefile')
-rw-r--r--makefile13
1 files changed, 13 insertions, 0 deletions
diff --git a/makefile b/makefile
index 4fe689a3d84..041a7df3cf3 100644
--- a/makefile
+++ b/makefile
@@ -247,6 +247,9 @@ BUILD_MIDILIB = 1
# uncomment next line to generate verbose build information
# VERBOSE = 1
+# specify the sanitizer to use or leave empty to use none
+# SANITIZE =
+
# specify optimization level or leave commented to use the default
# (default is OPTIMIZE = 3 normally, or OPTIMIZE = 0 with symbols)
# OPTIMIZE = 3
@@ -528,6 +531,9 @@ CCOMFLAGS += \
-Wno-self-assign-field
endif
+ifdef SANITIZE
+CCOMFLAGS += -fsanitize=$(SANITIZE)
+endif
#-------------------------------------------------
# include paths
@@ -594,6 +600,9 @@ ifdef MAP
LDFLAGSEMULATOR += -Wl,-Map,$(FULLNAME).map
endif
+ifdef SANITIZE
+LDFLAGS += -fsanitize=$(SANITIZE)
+endif
#-------------------------------------------------
@@ -684,6 +693,10 @@ LIBS += -lportmidi
MIDI_LIB =
endif
+ifneq (,$(findstring clang,$(CC)))
+LIBS += -lstdc++ -lpthread
+endif
+
#-------------------------------------------------
# 'default' target needs to go here, before the
# include files which define additional targets