X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2FMakefile;h=917bd5c06c7a83f9d4c48f9a531df196b0cb2d9d;hb=e048d1182562eb7ce1eae45f626681206da446b8;hp=e481aca5141a54377b1b43185faee8b672d42ffb;hpb=ad2aa8c06f438de8b8bb7b7c8726430e3f2a5685;p=stockfish diff --git a/src/Makefile b/src/Makefile index e481aca5..917bd5c0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -682,6 +682,18 @@ ifeq ($(pext),yes) endif endif +### 3.7.1 Try to include git commit sha for versioning +GIT_SHA = $(shell git rev-parse --short HEAD 2>/dev/null) +ifneq ($(GIT_SHA), ) + CXXFLAGS += -DGIT_SHA=\"$(GIT_SHA)\" +endif + +### 3.7.2 Try to include git commit date for versioning +GIT_DATE = $(shell git show -s --date=format:'%Y%m%d' --format=%cd HEAD 2>/dev/null) +ifneq ($(GIT_DATE), ) + CXXFLAGS += -DGIT_DATE=\"$(GIT_DATE)\" +endif + ### 3.8 Link Time Optimization ### This is a mix of compile and link time options because the lto link phase ### needs access to the optimization flags. @@ -800,7 +812,7 @@ endif .PHONY: help build profile-build strip install clean net objclean profileclean \ config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \ - clang-profile-use clang-profile-make + clang-profile-use clang-profile-make FORCE build: net config-sanity $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all @@ -948,6 +960,10 @@ config-sanity: net $(EXE): $(OBJS) +$(CXX) -o $@ $(OBJS) $(LDFLAGS) +# Force recompilation to ensure version info is up-to-date +misc.o: FORCE +FORCE: + clang-profile-make: $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \ EXTRACXXFLAGS='-fprofile-instr-generate ' \