X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=7ddb643c11710713b2b782d4a4dfc8203577c928;hp=6c90ac2bac8ca8fef68801356b21ca0058d8cf03;hb=ddcb572c41d660f7ed2baa8c21fb56dec0bc7a7c;hpb=c5ec94d0f1b128fc2c691c7231663a345409d5cc diff --git a/src/Makefile b/src/Makefile index 6c90ac2b..7ddb643c 100644 --- a/src/Makefile +++ b/src/Makefile @@ -231,7 +231,7 @@ ifeq ($(COMP),clang) endif ### 3.2 General compiler settings -CXXFLAGS = -g -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) +CXXFLAGS = -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) ifeq ($(comp),gcc) CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow @@ -256,6 +256,10 @@ endif ### 3.3 General linker settings LDFLAGS = $(EXTRALDFLAGS) +ifeq ($(comp),mingw) + LDFLAGS += -static-libstdc++ -static-libgcc +endif + ### On mingw use Windows threads, otherwise POSIX ifneq ($(comp),mingw) # Haiku has pthreads in its libroot, so only link it in on other platforms @@ -271,6 +275,8 @@ endif ### 3.4 Debugging ifeq ($(debug),no) CXXFLAGS += -DNDEBUG +else + CXXFLAGS += -g endif ### 3.5 Optimization @@ -350,6 +356,7 @@ endif ### needs access to the optimization flags. ifeq ($(comp),gcc) ifeq ($(optimize),yes) + ifeq ($(debug),no) GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.` GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.` ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \))) @@ -357,6 +364,7 @@ ifeq ($(comp),gcc) LDFLAGS += $(CXXFLAGS) endif endif + endif endif ### ==========================================================================