X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=16eb9c5535404e7e8217ea02d95853e1d1c682cd;hp=80867feb578aba8ac534b61507733d29045a3280;hb=6fa6da3ee13d2b7bdbec3cd24ff8ca43233c74fb;hpb=b15dcd977487c58409de48016eb7680850481d5d diff --git a/src/Makefile b/src/Makefile index 80867feb..16eb9c55 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-2014 Marco Costalba, Joona Kiiski, Tord Romstad +# Copyright (C) 2008-2015 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 @@ -31,7 +31,7 @@ PREFIX = /usr/local BINDIR = $(PREFIX)/bin ### Built-in benchmark for pgo-builds -PGOBENCH = ./$(EXE) bench 16 1 1 default time +PGOBENCH = ./$(EXE) bench 16 1 1000 default time ### Object files OBJS = benchmark.o bitbase.o bitboard.o endgame.o evaluate.o main.o \ @@ -140,7 +140,7 @@ endif ### 3.1 Selecting compiler (default = gcc) -CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -fno-rtti $(EXTRACXXFLAGS) +CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 $(EXTRACXXFLAGS) LDFLAGS += $(EXTRALDFLAGS) ifeq ($(COMP),) @@ -150,7 +150,12 @@ endif ifeq ($(COMP),gcc) comp=gcc CXX=g++ - CXXFLAGS += -ansi -pedantic -Wno-long-long -Wextra -Wshadow + CXXFLAGS += -pedantic -Wno-long-long -Wextra -Wshadow + ifneq ($(UNAME),Darwin) + LDFLAGS += -Wl,--no-as-needed + else + LDFLAGS += -Wl + endif endif ifeq ($(COMP),mingw) @@ -170,6 +175,9 @@ ifeq ($(COMP),clang) comp=clang CXX=clang++ CXXFLAGS += -pedantic -Wno-long-long -Wextra -Wshadow + ifeq ($(UNAME),Darwin) + CXXFLAGS += -std=c++0x -stdlib=libc++ + endif endif ifeq ($(comp),icc) @@ -185,8 +193,8 @@ else endif ifeq ($(UNAME),Darwin) - CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.6 - LDFLAGS += -arch $(arch) -mmacosx-version-min=10.6 + CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.9 + LDFLAGS += -arch $(arch) -mmacosx-version-min=10.9 endif ### On mingw use Windows threads, otherwise POSIX @@ -310,6 +318,14 @@ ifeq ($(comp),gcc) endif endif +### 3.12 Android 5 can only run position independent executables. Note that this +### breaks Android 4.0 and earlier. +ifeq ($(arch),armv7) + CXXFLAGS += -fPIE + LDFLAGS += -fPIE -pie +endif + + ### ========================================================================== ### Section 4. Public targets ### ========================================================================== @@ -445,7 +461,7 @@ gcc-profile-make: gcc-profile-use: $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \ - EXTRACXXFLAGS='-fprofile-use' \ + EXTRACXXFLAGS='-fprofile-use -fno-peel-loops -fno-tracer' \ EXTRALDFLAGS='-lgcov' \ all