]> git.sesse.net Git - stockfish/commitdiff
Add signature-build make target
authorMarco Costalba <mcostalba@gmail.com>
Sun, 14 Jul 2013 07:00:19 +0000 (09:00 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 14 Jul 2013 08:59:25 +0000 (10:59 +0200)
When compiling with:

make signature-build ARCH=xxx COMP=xxx

After binary has been roduced, it will be run to
get the signature 'stockfish bench' and this
number will be used as Version, so that it
will be easy to track the original sources
from a binary.

No functinal change.

src/Makefile

index 7ddb643c11710713b2b782d4a4dfc8203577c928..1e8a9c6691d54da9ef56c7a3fdf7f49d204cbb70 100644 (file)
@@ -34,8 +34,9 @@ ifeq ($(UNAME),Haiku)
 endif
 BINDIR = $(PREFIX)/bin
 
-### Built-in benchmark for pgo-builds
+### Built-in benchmark for pgo-builds and signature
 PGOBENCH = ./$(EXE) bench 32 1 10 default depth
+SIGNBENCH = ./$(EXE) bench
 
 ### Object files
 OBJS = benchmark.o bitbase.o bitboard.o book.o endgame.o evaluate.o main.o \
@@ -421,6 +422,16 @@ build:
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
 
+signature-build:
+       $(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
+       $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
+       @echo "Running benchmark for getting the signature ..."
+       @$(SIGNBENCH) 2>&1 | grep 'Nodes searched' | grep -o ": .*" | tr -d ': ' > sign.txt
+       @sed -i -e 's,^,/static const string Tag/s/"\\(.*\\)"/",1' -e 's,$$,"/1,1' sign.txt
+       @sed -i -f sign.txt misc.cpp
+       @rm sign.txt        
+       $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
+        
 profile-build:
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
        @echo ""