X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=358788bd7f2d7262740e3e686be0180b005e4a02;hp=ee09dc7b63fdb7f19b43fd621b79ee06e4930c00;hb=8de29390f2d2bd31585b93ff46eae3051126f666;hpb=1e8836d921b3b508e5d44d2fafab95230bdd03c6 diff --git a/src/Makefile b/src/Makefile index ee09dc7b..358788bd 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 @@ -160,18 +161,22 @@ endif ifeq ($(COMP),mingw) comp=mingw - ifeq ($(bits),64) - ifeq ($(shell which x86_64-w64-mingw32-c++-posix),) - CXX=x86_64-w64-mingw32-c++ + ifeq ($(UNAME),Linux) + ifeq ($(bits),64) + ifeq ($(shell which x86_64-w64-mingw32-c++-posix),) + CXX=x86_64-w64-mingw32-c++ + else + CXX=x86_64-w64-mingw32-c++-posix + endif else - CXX=x86_64-w64-mingw32-c++-posix + ifeq ($(shell which i686-w64-mingw32-c++-posix),) + CXX=i686-w64-mingw32-c++ + else + CXX=i686-w64-mingw32-c++-posix + endif endif else - ifeq ($(shell which i686-w64-mingw32-c++-posix),) - CXX=i686-w64-mingw32-c++ - else - CXX=i686-w64-mingw32-c++-posix - endif + CXX=g++ endif CXXFLAGS += -Wextra -Wshadow @@ -189,8 +194,8 @@ ifeq ($(COMP),clang) CXX=clang++ CXXFLAGS += -pedantic -Wextra -Wshadow ifeq ($(UNAME),Darwin) - CXXFLAGS += -std=c++0x -stdlib=libc++ - DEPENDFLAGS += -std=c++0x -stdlib=libc++ + CXXFLAGS += -stdlib=libc++ + DEPENDFLAGS += -stdlib=libc++ endif endif @@ -213,7 +218,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 @@ -360,7 +370,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 "" @@ -390,11 +400,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: