]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Rename *last to *end
[stockfish] / src / Makefile
index 3fd601ffe20c96cee61c94c1ab9ec5e2a8aa2078..2ad22de41bb55011e5d8baebec2a242c47ca1f5a 100644 (file)
@@ -321,11 +321,13 @@ endif
 ### This is a mix of compile and link time options because the lto link phase
 ### needs access to the optimization flags.
 ifeq ($(comp),gcc)
-       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 \)))
-               CXXFLAGS += -flto
-               LDFLAGS += $(CXXFLAGS)
+       ifeq ($(optimize),yes)
+               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 \)))
+                       CXXFLAGS += -flto
+                       LDFLAGS += $(CXXFLAGS)
+               endif
        endif
 endif