X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2FMakefile;h=2ad22de41bb55011e5d8baebec2a242c47ca1f5a;hp=782971e938c1364494642aa17112f8c3fda1319c;hb=834bd9edd79d11566ec3556945a858d2d84a726b;hpb=96f4ab48d8b2e3129a2d028f7739f12db2200667 diff --git a/src/Makefile b/src/Makefile index 782971e9..2ad22de4 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 @@ -32,7 +39,7 @@ PGOBENCH = ./$(EXE) bench 32 1 10 default depth ### Object files OBJS = benchmark.o bitbase.o bitboard.o book.o endgame.o evaluate.o main.o \ - material.o misc.o move.o movegen.o movepick.o pawns.o position.o \ + material.o misc.o movegen.o movepick.o notation.o pawns.o position.o \ search.o thread.o timeman.o tt.o uci.o ucioption.o ### ========================================================================== @@ -229,7 +236,10 @@ 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) @@ -270,7 +280,8 @@ ifeq ($(optimize),yes) endif ifeq ($(comp),clang) - CXXFLAGS += -O4 + ### -O4 requires a linker that supports LLVM's LTO + CXXFLAGS += -O3 ifeq ($(os),osx) ifeq ($(arch),i386) @@ -310,11 +321,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