# 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-2019 Marco Costalba, Joona Kiiski, Gary Linscott, Tord Romstad
+# Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file)
#
# Stockfish is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
BINDIR = $(PREFIX)/bin
### Built-in benchmark for pgo-builds
-PGOBENCH = ./$(EXE) bench
+ifeq ($(SDE_PATH),)
+ PGOBENCH = ./$(EXE) bench
+else
+ PGOBENCH = $(SDE_PATH) -- ./$(EXE) bench
+endif
### Source and object files
SRCS = benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp main.cpp \
ifneq ($(KERNEL),Darwin)
ifneq ($(KERNEL),OpenBSD)
+ ifneq ($(KERNEL),FreeBSD)
LDFLAGS += -latomic
endif
endif
+ endif
ifeq ($(arch),$(filter $(arch),armv7 armv8))
ifeq ($(OS),Android)
CXXFLAGS += -mdynamic-no-pic
endif
endif
+
+ ifeq ($(comp),clang)
+ CXXFLAGS += -fexperimental-new-pass-manager
+ endif
endif
### 3.4 Bits
ifeq ($(optimize),yes)
ifeq ($(debug), no)
ifeq ($(comp),clang)
- CXXFLAGS += -flto=thin
+ CXXFLAGS += -flto
ifneq ($(findstring MINGW,$(KERNEL)),)
CXXFLAGS += -fuse-ld=lld
else ifneq ($(findstring MSYS,$(KERNEL)),)
LDFLAGS += -save-temps
endif
else
- CXXFLAGS += -flto=thin
+ CXXFLAGS += -flto
LDFLAGS += $(CXXFLAGS)
endif
config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
clang-profile-use clang-profile-make
-build: config-sanity net
+build: net config-sanity
$(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
profile-build: net config-sanity objclean profileclean
all: $(EXE) .depend
-config-sanity:
+config-sanity: net
@echo ""
@echo "Config:"
@echo "debug: '$(debug)'"