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)

This commit is contained in:
Oliver Stöneberg 2013-05-04 09:48:04 +00:00
parent 78c8555f22
commit e7c50f6019

View File

@ -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