]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Embed default net, and simplify using non-default nets
[stockfish] / src / Makefile
index 703aa23020ff6164510ce3ce2ffda2fef2957afa..5f363f024129f8cea66e2187f5ae53be9a33bb2a 100644 (file)
@@ -614,10 +614,12 @@ ifeq ($(debug), no)
 # So, only enable it for a cross from Linux by default.
        else ifeq ($(comp),mingw)
        ifeq ($(KERNEL),Linux)
 # So, only enable it for a cross from Linux by default.
        else ifeq ($(comp),mingw)
        ifeq ($(KERNEL),Linux)
+       ifneq ($(arch),i386)
                CXXFLAGS += -flto
                LDFLAGS += $(CXXFLAGS) -flto=jobserver
        endif
        endif
                CXXFLAGS += -flto
                LDFLAGS += $(CXXFLAGS) -flto=jobserver
        endif
        endif
+       endif
 endif
 endif
 
 endif
 endif
 
@@ -705,7 +707,7 @@ endif
         config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
         clang-profile-use clang-profile-make
 
         config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
         clang-profile-use clang-profile-make
 
-build: config-sanity
+build: config-sanity net
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
 
 profile-build: net config-sanity objclean profileclean
        $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
 
 profile-build: net config-sanity objclean profileclean
@@ -731,12 +733,13 @@ install:
        -cp $(EXE) $(BINDIR)
        -strip $(BINDIR)/$(EXE)
 
        -cp $(EXE) $(BINDIR)
        -strip $(BINDIR)/$(EXE)
 
-#clean all
+# clean all
 clean: objclean profileclean
        @rm -f .depend *~ core
 
 clean: objclean profileclean
        @rm -f .depend *~ core
 
+# evaluation network (nnue)
 net:
 net:
-       $(eval nnuenet := $(shell grep EvalFile ucioption.cpp | grep Option | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
+       $(eval nnuenet := $(shell grep EvalFileDefaultName evaluate.h | grep define | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
        @echo "Default net: $(nnuenet)"
        $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
        $(eval curl_or_wget := $(shell if hash curl 2>/dev/null; then echo "curl -skL"; elif hash wget 2>/dev/null; then echo "wget -qO-"; fi))
        @echo "Default net: $(nnuenet)"
        $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
        $(eval curl_or_wget := $(shell if hash curl 2>/dev/null; then echo "curl -skL"; elif hash wget 2>/dev/null; then echo "wget -qO-"; fi))
@@ -758,7 +761,6 @@ net:
             echo "shasum / sha256sum not found, skipping net validation"; \
         fi
 
             echo "shasum / sha256sum not found, skipping net validation"; \
         fi
 
-
 # clean binaries and objects
 objclean:
        @rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o
 # clean binaries and objects
 objclean:
        @rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o