X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=d6cdeca334c53c49ecb24f282f044ccff1768e25;hp=33b6d159a9b70c539d77c058a519aa242381cbe6;hb=323925b91c49449ec2f0eee8d85b7a51d6472ea3;hpb=1e814e0ca01458c1084862087af0374b043b5cd8 diff --git a/src/Makefile b/src/Makefile index 33b6d159..d6cdeca3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -50,7 +50,9 @@ OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \ # ---------------------------------------------------------------------------- # # debug = yes/no --- -DNDEBUG --- Enable/Disable debug mode -# sanitize = yes/no --- (-fsanitize ) --- enable undefined behavior checks +# sanitize = undefined/thread/no (-fsanitize ) +# --- ( undefined ) --- enable undefined behavior checks +# --- ( thread ) --- enable threading error checks # optimize = yes/no --- (-O3/-fast etc.) --- Enable/Disable optimizations # arch = (name) --- (-arch) --- Target architecture # bits = 64/32 --- -DIS_64BIT --- 64-/32-bit operating system @@ -139,7 +141,7 @@ endif ### 3.1 Selecting compiler (default = gcc) -CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 $(EXTRACXXFLAGS) +CXXFLAGS += -Wall -Wcast-qual -std=c++11 $(EXTRACXXFLAGS) DEPENDFLAGS += -std=c++11 LDFLAGS += $(EXTRALDFLAGS) @@ -155,7 +157,7 @@ ifeq ($(COMP),gcc) ifeq ($(ARCH),armv7) ifeq ($(OS),Android) CXXFLAGS += -m$(bits) - LDFLAGS += -m$(bits) + LDFLAGS += -m$(bits) endif else CXXFLAGS += -m$(bits) @@ -202,6 +204,9 @@ ifeq ($(COMP),clang) comp=clang CXX=clang++ CXXFLAGS += -pedantic -Wextra -Wshadow +ifneq ($(KERNEL),Darwin) + LDFLAGS += -latomic +endif ifeq ($(ARCH),armv7) ifeq ($(OS),Android) @@ -261,9 +266,9 @@ else endif ### 3.2.2 Debugging with undefined behavior sanitizers -ifeq ($(sanitize),yes) - CXXFLAGS += -g3 -fsanitize=undefined - LDFLAGS += -fsanitize=undefined +ifneq ($(sanitize),no) + CXXFLAGS += -g3 -fsanitize=$(sanitize) -fuse-ld=gold + LDFLAGS += -fsanitize=$(sanitize) -fuse-ld=gold endif ### 3.3 Optimization @@ -452,7 +457,7 @@ install: #clean all clean: objclean profileclean - @rm -f .depend *~ core + @rm -f .depend *~ core # clean binaries and objects objclean: @@ -496,7 +501,7 @@ config-sanity: @echo "Testing config sanity. If this fails, try 'make help' ..." @echo "" @test "$(debug)" = "yes" || test "$(debug)" = "no" - @test "$(sanitize)" = "yes" || test "$(sanitize)" = "no" + @test "$(sanitize)" = "undefined" || test "$(sanitize)" = "thread" || test "$(sanitize)" = "no" @test "$(optimize)" = "yes" || test "$(optimize)" = "no" @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \ test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7"