]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Disable flto when debugging
[stockfish] / src / Makefile
index b23d671f07600388a87a3956fc211980f1659352..7ddb643c11710713b2b782d4a4dfc8203577c928 100644 (file)
@@ -231,7 +231,7 @@ ifeq ($(COMP),clang)
 endif
 
 ### 3.2 General compiler settings
 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
 
 ifeq ($(comp),gcc)
        CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow
@@ -275,6 +275,8 @@ endif
 ### 3.4 Debugging
 ifeq ($(debug),no)
        CXXFLAGS += -DNDEBUG
 ### 3.4 Debugging
 ifeq ($(debug),no)
        CXXFLAGS += -DNDEBUG
+else
+       CXXFLAGS += -g 
 endif
 
 ### 3.5 Optimization
 endif
 
 ### 3.5 Optimization
@@ -354,6 +356,7 @@ endif
 ### needs access to the optimization flags.
 ifeq ($(comp),gcc)
        ifeq ($(optimize),yes)
 ### 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 \)))
                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 \)))
@@ -361,6 +364,7 @@ ifeq ($(comp),gcc)
                        LDFLAGS += $(CXXFLAGS)
                endif
        endif
                        LDFLAGS += $(CXXFLAGS)
                endif
        endif
+       endif
 endif
 
 ### ==========================================================================
 endif
 
 ### ==========================================================================