X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=294634f69156656ddf617a0df157f0a550efc3f4;hp=4e4d3d918539f73d0df51e41b77dde2b1188bfc1;hb=8fb45caadef67fb2ccc27857c15ade987d9f5e2f;hpb=90f5937373974adf4ae7216feedf5abc4d62debd diff --git a/src/Makefile b/src/Makefile index 4e4d3d91..294634f6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,7 @@ # Stockfish, a UCI chess playing engine derived from Glaurung 2.1 # Copyright (C) 2004-2008 Tord Romstad (Glaurung author) # Copyright (C) 2008-2015 Marco Costalba, Joona Kiiski, Tord Romstad +# Copyright (C) 2015-2016 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad # # Stockfish is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -49,10 +50,8 @@ OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \ # optimize = yes/no --- (-O3/-fast etc.) --- Enable/Disable optimizations # arch = (name) --- (-arch) --- Target architecture # bits = 64/32 --- -DIS_64BIT --- 64-/32-bit operating system -# prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch x86 asm-instruction -# bsfq = yes/no --- -DUSE_BSFQ --- Use bsfq x86_64 asm-instruction (only -# with GCC and ICC 64-bit) -# popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt x86_64 asm-instruction +# prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction +# popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction # sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions # pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction # @@ -65,7 +64,6 @@ optimize = yes debug = no bits = 32 prefetch = no -bsfq = no popcnt = no sse = no pext = no @@ -95,7 +93,6 @@ ifeq ($(ARCH),x86-64) arch = x86_64 bits = 64 prefetch = yes - bsfq = yes sse = yes endif @@ -103,7 +100,6 @@ ifeq ($(ARCH),x86-64-modern) arch = x86_64 bits = 64 prefetch = yes - bsfq = yes popcnt = yes sse = yes endif @@ -112,7 +108,6 @@ ifeq ($(ARCH),x86-64-bmi2) arch = x86_64 bits = 64 prefetch = yes - bsfq = yes popcnt = yes sse = yes pext = yes @@ -121,7 +116,6 @@ endif ifeq ($(ARCH),armv7) arch = armv7 prefetch = yes - bsfq = yes endif ifeq ($(ARCH),ppc-32) @@ -151,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 @@ -191,10 +185,11 @@ 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 += -std=c++0x -stdlib=libc++ - DEPENDFLAGS += -std=c++0x -stdlib=libc++ + CXXFLAGS += -stdlib=libc++ + DEPENDFLAGS += -stdlib=libc++ endif endif @@ -217,7 +212,12 @@ endif ### Travis CI script uses COMPILER to overwrite CXX ifdef COMPILER - CXX=$(COMPILER) + COMPCXX=$(COMPILER) +endif + +### Allow overwriting CXX from command line +ifdef COMPCXX + CXX=$(COMPCXX) endif ### On mingw use Windows threads, otherwise POSIX @@ -303,11 +303,6 @@ else CXXFLAGS += -DNO_PREFETCH endif -### 3.8 bsfq -ifeq ($(bsfq),yes) - CXXFLAGS += -DUSE_BSFQ -endif - ### 3.9 popcnt ifeq ($(popcnt),yes) ifeq ($(comp),icc) @@ -364,7 +359,7 @@ help: @echo "" @echo "To compile stockfish, type: " @echo "" - @echo "make target ARCH=arch [COMP=comp]" + @echo "make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]" @echo "" @echo "Supported targets:" @echo "" @@ -394,11 +389,17 @@ help: @echo "clang > LLVM Clang compiler" @echo "icc > Intel compiler" @echo "" - @echo "Examples. If you don't know what to do, you likely want to run: " + @echo "Simple examples. If you don't know what to do, you likely want to run: " @echo "" @echo "make build ARCH=x86-64 (This is for 64-bit systems)" @echo "make build ARCH=x86-32 (This is for 32-bit systems)" @echo "" + @echo "Advanced examples, for experienced users: " + @echo "" + @echo "make build ARCH=x86-64 COMP=clang" + @echo "make profile-build ARCH=x86-64-modern COMP=gcc COMPCXX=g++-4.8" + @echo "" + .PHONY: build profile-build build: @@ -453,7 +454,6 @@ config-sanity: @echo "arch: '$(arch)'" @echo "bits: '$(bits)'" @echo "prefetch: '$(prefetch)'" - @echo "bsfq: '$(bsfq)'" @echo "popcnt: '$(popcnt)'" @echo "sse: '$(sse)'" @echo "pext: '$(pext)'" @@ -471,7 +471,6 @@ config-sanity: test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "armv7" @test "$(bits)" = "32" || test "$(bits)" = "64" @test "$(prefetch)" = "yes" || test "$(prefetch)" = "no" - @test "$(bsfq)" = "yes" || test "$(bsfq)" = "no" @test "$(popcnt)" = "yes" || test "$(popcnt)" = "no" @test "$(sse)" = "yes" || test "$(sse)" = "no" @test "$(pext)" = "yes" || test "$(pext)" = "no"