X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=f1fcfdeb5fc629ca352329c0766aadfef8c0e13b;hp=ee4374d8610462c22ef7cc54e95c435f6a3e221f;hb=5b7b330616b765c648d7d689403698223e9fee8e;hpb=c11edd3b0b43f24decc4d003472669042ae073e4 diff --git a/src/Makefile b/src/Makefile index ee4374d8..f1fcfdeb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,6 +1,6 @@ # Stockfish, a UCI chess playing engine derived from Glaurung 2.1 # Copyright (C) 2004-2008 Tord Romstad (Glaurung author) -# Copyright (C) 2008-2012 Marco Costalba, Joona Kiiski, Tord Romstad +# Copyright (C) 2008-2013 Marco Costalba, Joona Kiiski, 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 @@ -34,8 +34,9 @@ ifeq ($(UNAME),Haiku) endif BINDIR = $(PREFIX)/bin -### Built-in benchmark for pgo-builds +### Built-in benchmark for pgo-builds and signature PGOBENCH = ./$(EXE) bench 32 1 10 default depth +SIGNBENCH = ./$(EXE) bench ### Object files OBJS = benchmark.o bitbase.o bitboard.o book.o endgame.o evaluate.o main.o \ @@ -231,7 +232,7 @@ ifeq ($(COMP),clang) 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 @@ -242,7 +243,7 @@ ifeq ($(comp),mingw) endif ifeq ($(comp),icc) - CXXFLAGS += -wd383,981,1418,1419,10187,10188,11505,11503 -Wcheck -Wabi -Wdeprecated -strict-ansi + CXXFLAGS += -wd383,981,1418,1419,1476,10187,10188,11505,11503 -Wcheck -Wabi -Wdeprecated -strict-ansi endif ifeq ($(comp),clang) @@ -256,6 +257,10 @@ endif ### 3.3 General linker settings LDFLAGS = $(EXTRALDFLAGS) +ifeq ($(comp),mingw) + LDFLAGS += -static-libstdc++ -static-libgcc +endif + ### On mingw use Windows threads, otherwise POSIX ifneq ($(comp),mingw) # Haiku has pthreads in its libroot, so only link it in on other platforms @@ -271,6 +276,8 @@ endif ### 3.4 Debugging ifeq ($(debug),no) CXXFLAGS += -DNDEBUG +else + CXXFLAGS += -g endif ### 3.5 Optimization @@ -350,6 +357,7 @@ endif ### 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 \))) @@ -357,6 +365,7 @@ ifeq ($(comp),gcc) LDFLAGS += $(CXXFLAGS) endif endif + endif endif ### ========================================================================== @@ -413,6 +422,16 @@ build: $(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all +signature-build: + $(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity + $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all + @echo "Running benchmark for getting the signature ..." + @$(SIGNBENCH) 2>&1 | grep 'Nodes searched' | grep -o ": .*" | tr -d ': ' > sign.txt + @sed -i -e 's,^,/static const string Version/s/"\\(.*\\)"/"sig-,1' -e 's,$$,"/1,1' sign.txt + @sed -i -f sign.txt misc.cpp + @rm sign.txt + $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all + profile-build: $(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity @echo ""