File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ CXXFLAGS ?= -std=c++17 -Wall -Wextra
66OPTFLAGS ?= -O3
77ifeq ($(LTO ) , yes)
88 OPTFLAGS += -flto
9+ ifeq ($(findstring clang++,$(CXX)),clang++)
10+ LDFLAGS += -fuse-ld=lld
11+ endif
912endif
1013ifeq ($(debug ) ,no)
1114 CXXFLAGS += -DNDEBUG
3134 test -d deps/chesslib || git clone https://github.com/winapiadmin/chesslib deps/chesslib
3235 test -d deps/tbprobe || git clone https://github.com/winapiadmin/tb_probing_tool deps/tbprobe
3336# Tuning is not required on Makefile, use CMake.
34- SRCS = $(filter-out tune_cmd.cpp, $(wildcard * .cpp) ) $(wildcard deps/chesslib/* .cpp) $(wildcard deps/tbprobe/* .cpp)
37+ CHESSLIB_SRCS := $(filter-out % tests.cpp,$(wildcard deps/chesslib/* .cpp) )
38+ SRCS := \
39+ $(filter-out tune_cmd.cpp,$(wildcard * .cpp) ) \
40+ $(CHESSLIB_SRCS ) \
41+ deps/tbprobe/syzygy/tbprobe.cpp
3542OBJS = $(SRCS:.cpp=.o )
43+ SHA := $(shell git rev-parse --short HEAD 2>/dev/null)
44+ TAG := $(shell git describe --tags --exact-match 2>/dev/null)
45+ ifeq ($(debug ) ,yes)
46+ BUILD_VERSION := debug-$(SHA )
47+ else ifneq ($(TAG),)
48+ BUILD_VERSION := $(TAG )
49+ else
50+ BUILD_VERSION := release-$(SHA )
51+ endif
3652
53+ CXXFLAGS += -DBUILD_VERSION=\"$(BUILD_VERSION ) \"
3754.PHONY : all clean deps
3855all : deps $(TARGET )
3956
You can’t perform that action at this time.
0 commit comments