X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=inline;f=src%2FMakefile;h=fc6a4fae3fb81254460882a0d0b5e4709676b41e;hb=78fe0cfb8d118bc0f3585d95cb64030f36ed56c5;hp=dea8db04675e66d26b21e4c755f91df217ae85e3;hpb=089e54c7fdeb754f7375fea06aa6a464be1297cb;p=stockfish diff --git a/src/Makefile b/src/Makefile index dea8db04..fc6a4fae 100644 --- a/src/Makefile +++ b/src/Makefile @@ -20,11 +20,18 @@ ### Section 1. General Configuration ### ========================================================================== +### Establish the operating system name +UNAME = $(shell uname) + ### Executable name EXE = stockfish ### Installation dir definitions PREFIX = /usr/local +# Haiku has a non-standard filesystem layout +ifeq ($(UNAME),Haiku) + PREFIX=/boot/common +endif BINDIR = $(PREFIX)/bin ### Built-in benchmark for pgo-builds @@ -168,6 +175,7 @@ endif ifeq ($(COMP),mingw) comp=mingw CXX=g++ + prefetch = yes profile_prepare = gcc-profile-prepare profile_make = gcc-profile-make profile_use = gcc-profile-use @@ -177,6 +185,7 @@ endif ifeq ($(COMP),gcc) comp=gcc CXX=g++ + prefetch = yes profile_prepare = gcc-profile-prepare profile_make = gcc-profile-make profile_use = gcc-profile-use @@ -195,6 +204,7 @@ endif ifeq ($(COMP),clang) comp=clang CXX=clang++ + prefetch = yes profile_prepare = gcc-profile-prepare profile_make = gcc-profile-make profile_use = gcc-profile-use @@ -221,7 +231,7 @@ ifeq ($(comp),clang) endif ifeq ($(os),osx) - CXXFLAGS += -arch $(arch) + CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.6 endif ### 3.3 General linker settings @@ -229,11 +239,14 @@ LDFLAGS = $(EXTRALDFLAGS) ### On mingw use Windows threads, otherwise POSIX ifneq ($(comp),mingw) - LDFLAGS += -lpthread + # Haiku has pthreads in its libroot, so only link it in on other platforms + ifneq ($(UNAME),Haiku) + LDFLAGS += -lpthread + endif endif ifeq ($(os),osx) - LDFLAGS += -arch $(arch) + LDFLAGS += -arch $(arch) -mmacosx-version-min=10.6 endif ### 3.4 Debugging @@ -311,11 +324,13 @@ endif ### This is a mix of compile and link time options because the lto link phase ### needs access to the optimization flags. ifeq ($(comp),gcc) - 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 \))) - CXXFLAGS += -flto - LDFLAGS += $(CXXFLAGS) + ifeq ($(optimize),yes) + 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 \))) + CXXFLAGS += -flto + LDFLAGS += $(CXXFLAGS) + endif endif endif