X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=cb55c8b0b8ca8c3f27715509fedcab1a69e2983b;hp=0824072de8e95654f3b303a1dc4695103e1ed8b3;hb=4c95edddbf1aaec22c343adaca4796df0137e4c3;hpb=db4b0d8b7db8db15c16a71212990354094f00b0d diff --git a/src/Makefile b/src/Makefile index 0824072d..cb55c8b0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -145,7 +145,7 @@ endif ifeq ($(COMP),gcc) comp=gcc CXX=g++ - CXXFLAGS += -pedantic -Wextra -Wshadow + CXXFLAGS += -pedantic -Wextra -Wshadow -m$(bits) ifneq ($(UNAME),Darwin) LDFLAGS += -Wl,--no-as-needed endif @@ -185,7 +185,8 @@ endif ifeq ($(COMP),clang) comp=clang CXX=clang++ - CXXFLAGS += -pedantic -Wextra -Wshadow + CXXFLAGS += -pedantic -Wextra -Wshadow -m$(bits) + LDFLAGS += -m$(bits) ifeq ($(UNAME),Darwin) CXXFLAGS += -stdlib=libc++ DEPENDFLAGS += -stdlib=libc++ @@ -230,18 +231,19 @@ ifneq ($(comp),mingw) endif endif -### 3.4 Debugging +### 3.2 Debugging ifeq ($(debug),no) CXXFLAGS += -DNDEBUG else CXXFLAGS += -g endif -### 3.5 Optimization +### 3.3 Optimization ifeq ($(optimize),yes) + CXXFLAGS += -O3 + ifeq ($(comp),gcc) - CXXFLAGS += -O3 ifeq ($(UNAME),Darwin) ifeq ($(arch),i386) @@ -257,21 +259,13 @@ ifeq ($(optimize),yes) endif endif - ifeq ($(comp),mingw) - CXXFLAGS += -O3 - endif - ifeq ($(comp),icc) ifeq ($(UNAME),Darwin) - CXXFLAGS += -fast -mdynamic-no-pic - else - CXXFLAGS += -fast + CXXFLAGS += -mdynamic-no-pic endif endif ifeq ($(comp),clang) - CXXFLAGS += -O3 - ifeq ($(UNAME),Darwin) ifeq ($(pext),no) CXXFLAGS += -flto @@ -287,12 +281,12 @@ ifeq ($(optimize),yes) endif endif -### 3.6. Bits +### 3.4 Bits ifeq ($(bits),64) CXXFLAGS += -DIS_64BIT endif -### 3.7 prefetch +### 3.5 prefetch ifeq ($(prefetch),yes) ifeq ($(sse),yes) CXXFLAGS += -msse @@ -302,7 +296,7 @@ else CXXFLAGS += -DNO_PREFETCH endif -### 3.9 popcnt +### 3.6 popcnt ifeq ($(popcnt),yes) ifeq ($(comp),icc) CXXFLAGS += -msse3 -DUSE_POPCNT @@ -311,15 +305,15 @@ ifeq ($(popcnt),yes) endif endif -### 3.10 pext +### 3.7 pext ifeq ($(pext),yes) CXXFLAGS += -DUSE_PEXT ifeq ($(comp),$(filter $(comp),gcc clang mingw)) - CXXFLAGS += -mbmi -mbmi2 + CXXFLAGS += -mbmi2 endif endif -### 3.11 Link Time Optimization, it works since gcc 4.5 but not on mingw under Windows. +### 3.8 Link Time Optimization, it works since gcc 4.5 but not on mingw under Windows. ### This is a mix of compile and link time options because the lto link phase ### needs access to the optimization flags. ifeq ($(comp),gcc) @@ -342,7 +336,7 @@ ifeq ($(comp),mingw) endif endif -### 3.12 Android 5 can only run position independent executables. Note that this +### 3.9 Android 5 can only run position independent executables. Note that this ### breaks Android 4.0 and earlier. ifeq ($(arch),armv7) CXXFLAGS += -fPIE