1 # Stockfish, a UCI chess playing engine derived from Glaurung 2.1
2 # Copyright (C) 2004-2021 The Stockfish developers (see AUTHORS file)
4 # Stockfish is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation, either version 3 of the License, or
7 # (at your option) any later version.
9 # Stockfish is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ### ==========================================================================
19 ### Section 1. General Configuration
20 ### ==========================================================================
29 ### Installation dir definitions
31 BINDIR = $(PREFIX)/bin
33 ### Built-in benchmark for pgo-builds
35 PGOBENCH = ./$(EXE) bench
37 PGOBENCH = $(SDE_PATH) -- ./$(EXE) bench
40 ### Source and object files
41 SRCS = benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp main.cpp \
42 material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp \
43 search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp \
44 nnue/evaluate_nnue.cpp nnue/features/half_ka_v2_hm.cpp
46 OBJS = $(notdir $(SRCS:.cpp=.o))
48 VPATH = syzygy:nnue:nnue/features
50 ### Establish the operating system name
51 KERNEL = $(shell uname -s)
52 ifeq ($(KERNEL),Linux)
53 OS = $(shell uname -o)
56 ### ==========================================================================
57 ### Section 2. High-level Configuration
58 ### ==========================================================================
60 # flag --- Comp switch --- Description
61 # ----------------------------------------------------------------------------
63 # debug = yes/no --- -DNDEBUG --- Enable/Disable debug mode
64 # sanitize = none/<sanitizer> ... (-fsanitize )
65 # --- ( undefined ) --- enable undefined behavior checks
66 # --- ( thread ) --- enable threading error checks
67 # --- ( address ) --- enable memory access checks
68 # --- ...etc... --- see compiler documentation for supported sanitizers
69 # optimize = yes/no --- (-O3/-fast etc.) --- Enable/Disable optimizations
70 # arch = (name) --- (-arch) --- Target architecture
71 # bits = 64/32 --- -DIS_64BIT --- 64-/32-bit operating system
72 # prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction
73 # popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction
74 # pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction
75 # sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions
76 # mmx = yes/no --- -mmmx --- Use Intel MMX instructions
77 # sse2 = yes/no --- -msse2 --- Use Intel Streaming SIMD Extensions 2
78 # ssse3 = yes/no --- -mssse3 --- Use Intel Supplemental Streaming SIMD Extensions 3
79 # sse41 = yes/no --- -msse4.1 --- Use Intel Streaming SIMD Extensions 4.1
80 # avx2 = yes/no --- -mavx2 --- Use Intel Advanced Vector Extensions 2
81 # avxvnni = yes/no --- -mavxvnni --- Use Intel Vector Neural Network Instructions AVX
82 # avx512 = yes/no --- -mavx512bw --- Use Intel Advanced Vector Extensions 512
83 # vnni256 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 256
84 # vnni512 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 512
85 # neon = yes/no --- -DUSE_NEON --- Use ARM SIMD architecture
87 # Note that Makefile is space sensitive, so when adding new architectures
88 # or modifying existing flags, you have to make sure there are no extra spaces
89 # at the end of the line for flag values.
91 # Example of use for these flags:
92 # make build ARCH=x86-64-avx512 debug=yes sanitize="address undefined"
95 ### 2.1. General and architecture defaults
99 help_skip_sanity = yes
101 # explicitly check for the list of supported architectures (as listed with make help),
102 # the user can override with `make ARCH=x86-32-vnni256 SUPPORTED_ARCH=true`
103 ifeq ($(ARCH), $(filter $(ARCH), \
104 x86-64-vnni512 x86-64-vnni256 x86-64-avx512 x86-64-avxvnni x86-64-bmi2 \
105 x86-64-avx2 x86-64-sse41-popcnt x86-64-modern x86-64-ssse3 x86-64-sse3-popcnt \
106 x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 e2k \
107 armv7 armv7-neon armv8 apple-silicon general-64 general-32))
134 ### 2.2 Architecture specific
136 ifeq ($(findstring x86,$(ARCH)),x86)
140 ifeq ($(findstring x86-32,$(ARCH)),x86-32)
151 ifeq ($(findstring -sse,$(ARCH)),-sse)
155 ifeq ($(findstring -popcnt,$(ARCH)),-popcnt)
159 ifeq ($(findstring -mmx,$(ARCH)),-mmx)
163 ifeq ($(findstring -sse2,$(ARCH)),-sse2)
168 ifeq ($(findstring -ssse3,$(ARCH)),-ssse3)
174 ifeq ($(findstring -sse41,$(ARCH)),-sse41)
181 ifeq ($(findstring -modern,$(ARCH)),-modern)
189 ifeq ($(findstring -avx2,$(ARCH)),-avx2)
198 ifeq ($(findstring -avxvnni,$(ARCH)),-avxvnni)
209 ifeq ($(findstring -bmi2,$(ARCH)),-bmi2)
219 ifeq ($(findstring -avx512,$(ARCH)),-avx512)
230 ifeq ($(findstring -vnni256,$(ARCH)),-vnni256)
241 ifeq ($(findstring -vnni512,$(ARCH)),-vnni512)
257 # 64-bit pext is not available on x86-32
264 # all other architectures
266 ifeq ($(ARCH),general-32)
271 ifeq ($(ARCH),general-64)
282 ifeq ($(ARCH),armv7-neon)
299 ifeq ($(ARCH),apple-silicon)
307 ifeq ($(ARCH),ppc-32)
312 ifeq ($(ARCH),ppc-64)
318 ifeq ($(findstring e2k,$(ARCH)),e2k)
331 ### ==========================================================================
332 ### Section 3. Low-level Configuration
333 ### ==========================================================================
335 ### 3.1 Selecting compiler (default = gcc)
336 CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS)
337 DEPENDFLAGS += -std=c++17
338 LDFLAGS += $(EXTRALDFLAGS)
347 CXXFLAGS += -pedantic -Wextra -Wshadow
349 ifeq ($(arch),$(filter $(arch),armv7 armv8))
351 CXXFLAGS += -m$(bits)
355 CXXFLAGS += -m$(bits)
359 ifeq ($(arch),$(filter $(arch),armv7))
363 ifneq ($(KERNEL),Darwin)
364 LDFLAGS += -Wl,--no-as-needed
371 ifeq ($(KERNEL),Linux)
373 ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
374 CXX=x86_64-w64-mingw32-c++
376 CXX=x86_64-w64-mingw32-c++-posix
379 ifeq ($(shell which i686-w64-mingw32-c++-posix),)
380 CXX=i686-w64-mingw32-c++
382 CXX=i686-w64-mingw32-c++-posix
389 CXXFLAGS += -pedantic -Wextra -Wshadow
396 CXXFLAGS += -diag-disable 1476,10120 -Wcheck -Wabi -Wdeprecated -strict-ansi
402 CXXFLAGS += -pedantic -Wextra -Wshadow
404 ifneq ($(KERNEL),Darwin)
405 ifneq ($(KERNEL),OpenBSD)
406 ifneq ($(KERNEL),FreeBSD)
407 ifneq ($(RTLIB),compiler-rt)
414 ifeq ($(arch),$(filter $(arch),armv7 armv8))
416 CXXFLAGS += -m$(bits)
420 CXXFLAGS += -m$(bits)
425 ifeq ($(KERNEL),Darwin)
426 CXXFLAGS += -mmacosx-version-min=10.14
427 LDFLAGS += -mmacosx-version-min=10.14
429 CXXFLAGS += -arch $(arch)
430 LDFLAGS += -arch $(arch)
435 # To cross-compile for Android, NDK version r21 or later is recommended.
436 # In earlier NDK versions, you'll need to pass -fno-addrsig if using GNU binutils.
437 # Currently we don't know how to make PGO builds with the NDK yet.
439 CXXFLAGS += -stdlib=libc++ -fPIE
442 CXX=armv7a-linux-androideabi16-clang++
443 CXXFLAGS += -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon
444 STRIP=arm-linux-androideabi-strip
447 CXX=aarch64-linux-android21-clang++
448 STRIP=aarch64-linux-android-strip
450 LDFLAGS += -static-libstdc++ -pie -lm -latomic
454 profile_make = icc-profile-make
455 profile_use = icc-profile-use
456 else ifeq ($(comp),clang)
457 profile_make = clang-profile-make
458 profile_use = clang-profile-use
460 profile_make = gcc-profile-make
461 profile_use = gcc-profile-use
462 ifeq ($(KERNEL),Darwin)
463 EXTRAPROFILEFLAGS = -fvisibility=hidden
467 ### Travis CI script uses COMPILER to overwrite CXX
472 ### Allow overwriting CXX from command line
477 ### Sometimes gcc is really clang
479 gccversion = $(shell $(CXX) --version)
480 gccisclang = $(findstring clang,$(gccversion))
481 ifneq ($(gccisclang),)
482 profile_make = clang-profile-make
483 profile_use = clang-profile-use
487 ### On mingw use Windows threads, otherwise POSIX
488 ifneq ($(comp),mingw)
489 CXXFLAGS += -DUSE_PTHREADS
490 # On Android Bionic's C library comes with its own pthread implementation bundled in
491 ifneq ($(OS),Android)
492 # Haiku has pthreads in its libroot, so only link it in on other platforms
493 ifneq ($(KERNEL),Haiku)
508 ### 3.2.2 Debugging with undefined behavior sanitizers
509 ifneq ($(sanitize),none)
510 CXXFLAGS += -g3 $(addprefix -fsanitize=,$(sanitize))
511 LDFLAGS += $(addprefix -fsanitize=,$(sanitize))
515 ifeq ($(optimize),yes)
520 ifeq ($(OS), Android)
521 CXXFLAGS += -fno-gcse -mthumb -march=armv7-a -mfloat-abi=softfp
525 ifeq ($(comp),$(filter $(comp),gcc clang icc))
526 ifeq ($(KERNEL),Darwin)
527 CXXFLAGS += -mdynamic-no-pic
532 CXXFLAGS += -fexperimental-new-pass-manager
538 CXXFLAGS += -DIS_64BIT
541 ### 3.5 prefetch and popcount
542 ifeq ($(prefetch),yes)
547 CXXFLAGS += -DNO_PREFETCH
551 ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64))
552 CXXFLAGS += -DUSE_POPCNT
553 else ifeq ($(comp),icc)
554 CXXFLAGS += -msse3 -DUSE_POPCNT
556 CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT
560 ### 3.6 SIMD architectures
562 CXXFLAGS += -DUSE_AVX2
563 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
568 ifeq ($(avxvnni),yes)
569 CXXFLAGS += -DUSE_VNNI -DUSE_AVXVNNI
570 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
571 CXXFLAGS += -mavxvnni
576 CXXFLAGS += -DUSE_AVX512
577 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
578 CXXFLAGS += -mavx512f -mavx512bw
582 ifeq ($(vnni256),yes)
583 CXXFLAGS += -DUSE_VNNI
584 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
585 CXXFLAGS += -mavx512f -mavx512bw -mavx512vnni -mavx512dq -mavx512vl -mprefer-vector-width=256
589 ifeq ($(vnni512),yes)
590 CXXFLAGS += -DUSE_VNNI
591 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
592 CXXFLAGS += -mavx512vnni -mavx512dq -mavx512vl
597 CXXFLAGS += -DUSE_SSE41
598 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
604 CXXFLAGS += -DUSE_SSSE3
605 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
611 CXXFLAGS += -DUSE_SSE2
612 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
618 CXXFLAGS += -DUSE_MMX
619 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
625 CXXFLAGS += -DUSE_NEON=$(arm_version)
626 ifeq ($(KERNEL),Linux)
628 ifneq ($(arch),armv8)
629 CXXFLAGS += -mfpu=neon
637 CXXFLAGS += -DUSE_PEXT
638 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
643 ### 3.8 Link Time Optimization
644 ### This is a mix of compile and link time options because the lto link phase
645 ### needs access to the optimization flags.
646 ifeq ($(optimize),yes)
650 ifneq ($(findstring MINGW,$(KERNEL)),)
651 CXXFLAGS += -fuse-ld=lld
652 else ifneq ($(findstring MSYS,$(KERNEL)),)
653 CXXFLAGS += -fuse-ld=lld
655 LDFLAGS += $(CXXFLAGS)
657 # GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
658 # GCC on some systems.
659 else ifeq ($(comp),gcc)
660 ifeq ($(gccisclang),)
662 LDFLAGS += $(CXXFLAGS) -flto=jobserver
663 ifneq ($(findstring MINGW,$(KERNEL)),)
664 LDFLAGS += -save-temps
665 else ifneq ($(findstring MSYS,$(KERNEL)),)
666 LDFLAGS += -save-temps
670 LDFLAGS += $(CXXFLAGS)
673 # To use LTO and static linking on windows, the tool chain requires a recent gcc:
674 # gcc version 10.1 in msys2 or TDM-GCC version 9.2 are known to work, older might not.
675 # So, only enable it for a cross from Linux by default.
676 else ifeq ($(comp),mingw)
677 ifeq ($(KERNEL),Linux)
680 LDFLAGS += $(CXXFLAGS) -flto=jobserver
687 ### 3.9 Android 5 can only run position independent executables. Note that this
688 ### breaks Android 4.0 and earlier.
689 ifeq ($(OS), Android)
691 LDFLAGS += -fPIE -pie
694 ### ==========================================================================
695 ### Section 4. Public Targets
696 ### ==========================================================================
701 @echo "To compile stockfish, type: "
703 @echo "make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]"
705 @echo "Supported targets:"
707 @echo "help > Display architecture details"
708 @echo "build > Standard build"
709 @echo "net > Download the default nnue net"
710 @echo "profile-build > Faster build (with profile-guided optimization)"
711 @echo "strip > Strip executable"
712 @echo "install > Install executable"
713 @echo "clean > Clean up"
715 @echo "Supported archs:"
717 @echo "x86-64-vnni512 > x86 64-bit with vnni support 512bit wide"
718 @echo "x86-64-vnni256 > x86 64-bit with vnni support 256bit wide"
719 @echo "x86-64-avx512 > x86 64-bit with avx512 support"
720 @echo "x86-64-avxvnni > x86 64-bit with avxvnni support"
721 @echo "x86-64-bmi2 > x86 64-bit with bmi2 support"
722 @echo "x86-64-avx2 > x86 64-bit with avx2 support"
723 @echo "x86-64-sse41-popcnt > x86 64-bit with sse41 and popcnt support"
724 @echo "x86-64-modern > common modern CPU, currently x86-64-sse41-popcnt"
725 @echo "x86-64-ssse3 > x86 64-bit with ssse3 support"
726 @echo "x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support"
727 @echo "x86-64 > x86 64-bit generic (with sse2 support)"
728 @echo "x86-32-sse41-popcnt > x86 32-bit with sse41 and popcnt support"
729 @echo "x86-32-sse2 > x86 32-bit with sse2 support"
730 @echo "x86-32 > x86 32-bit generic (with mmx and sse support)"
731 @echo "ppc-64 > PPC 64-bit"
732 @echo "ppc-32 > PPC 32-bit"
733 @echo "armv7 > ARMv7 32-bit"
734 @echo "armv7-neon > ARMv7 32-bit with popcnt and neon"
735 @echo "armv8 > ARMv8 64-bit with popcnt and neon"
736 @echo "e2k > Elbrus 2000"
737 @echo "apple-silicon > Apple silicon ARM64"
738 @echo "general-64 > unspecified 64-bit"
739 @echo "general-32 > unspecified 32-bit"
741 @echo "Supported compilers:"
743 @echo "gcc > Gnu compiler (default)"
744 @echo "mingw > Gnu compiler with MinGW under Windows"
745 @echo "clang > LLVM Clang compiler"
746 @echo "icc > Intel compiler"
747 @echo "ndk > Google NDK to cross-compile for Android"
749 @echo "Simple examples. If you don't know what to do, you likely want to run: "
751 @echo "make -j build ARCH=x86-64 (A portable, slow compile for 64-bit systems)"
752 @echo "make -j build ARCH=x86-32 (A portable, slow compile for 32-bit systems)"
754 @echo "Advanced examples, for experienced users looking for performance: "
756 @echo "make help ARCH=x86-64-bmi2"
757 @echo "make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0"
758 @echo "make -j build ARCH=x86-64-ssse3 COMP=clang"
760 @echo "-------------------------------"
761 ifeq ($(SUPPORTED_ARCH)$(help_skip_sanity), true)
762 @echo "The selected architecture $(ARCH) will enable the following configuration: "
763 @$(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
765 @echo "Specify a supported architecture with the ARCH option for more details"
770 .PHONY: help build profile-build strip install clean net objclean profileclean \
771 config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
772 clang-profile-use clang-profile-make
774 build: net config-sanity
775 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
777 profile-build: net config-sanity objclean profileclean
779 @echo "Step 1/4. Building instrumented executable ..."
780 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make)
782 @echo "Step 2/4. Running benchmark for pgo-build ..."
783 $(PGOBENCH) 2>&1 | tail -n 4
785 @echo "Step 3/4. Building optimized executable ..."
786 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
787 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use)
789 @echo "Step 4/4. Deleting profile data ..."
790 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) profileclean
796 -mkdir -p -m 755 $(BINDIR)
798 -strip $(BINDIR)/$(EXE)
801 clean: objclean profileclean
802 @rm -f .depend *~ core
804 # evaluation network (nnue)
806 $(eval nnuenet := $(shell grep EvalFileDefaultName evaluate.h | grep define | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
807 @echo "Default net: $(nnuenet)"
808 $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
809 $(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))
810 @if test -f "$(nnuenet)"; then \
811 echo "Already available."; \
813 if [ "x$(curl_or_wget)" = "x" ]; then \
814 echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \
816 echo "Downloading $(nnuedownloadurl)"; $(curl_or_wget) $(nnuedownloadurl) > $(nnuenet);\
819 $(eval shasum_command := $(shell if hash shasum 2>/dev/null; then echo "shasum -a 256 "; elif hash sha256sum 2>/dev/null; then echo "sha256sum "; fi))
820 @if [ "x$(shasum_command)" != "x" ]; then \
821 if [ "$(nnuenet)" != "nn-"`$(shasum_command) $(nnuenet) | cut -c1-12`".nnue" ]; then \
822 echo "Failed download or $(nnuenet) corrupted, please delete!"; exit 1; \
825 echo "shasum / sha256sum not found, skipping net validation"; \
828 # clean binaries and objects
830 @rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o
832 # clean auxiliary profiling files
835 @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda *.s
836 @rm -f stockfish.profdata *.profraw
837 @rm -f stockfish.exe.lto_wrapper_args
838 @rm -f stockfish.exe.ltrans.out
839 @rm -f ./-lstdc++.res
844 ### ==========================================================================
845 ### Section 5. Private Targets
846 ### ==========================================================================
853 @echo "debug: '$(debug)'"
854 @echo "sanitize: '$(sanitize)'"
855 @echo "optimize: '$(optimize)'"
856 @echo "arch: '$(arch)'"
857 @echo "bits: '$(bits)'"
858 @echo "kernel: '$(KERNEL)'"
860 @echo "prefetch: '$(prefetch)'"
861 @echo "popcnt: '$(popcnt)'"
862 @echo "pext: '$(pext)'"
863 @echo "sse: '$(sse)'"
864 @echo "mmx: '$(mmx)'"
865 @echo "sse2: '$(sse2)'"
866 @echo "ssse3: '$(ssse3)'"
867 @echo "sse41: '$(sse41)'"
868 @echo "avx2: '$(avx2)'"
869 @echo "avxvnni: '$(avxvnni)'"
870 @echo "avx512: '$(avx512)'"
871 @echo "vnni256: '$(vnni256)'"
872 @echo "vnni512: '$(vnni512)'"
873 @echo "neon: '$(neon)'"
874 @echo "arm_version: '$(arm_version)'"
878 @echo "CXXFLAGS: $(CXXFLAGS)"
879 @echo "LDFLAGS: $(LDFLAGS)"
881 @echo "Testing config sanity. If this fails, try 'make help' ..."
883 @test "$(debug)" = "yes" || test "$(debug)" = "no"
884 @test "$(optimize)" = "yes" || test "$(optimize)" = "no"
885 @test "$(SUPPORTED_ARCH)" = "true"
886 @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
887 test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "e2k" || \
888 test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
889 @test "$(bits)" = "32" || test "$(bits)" = "64"
890 @test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
891 @test "$(popcnt)" = "yes" || test "$(popcnt)" = "no"
892 @test "$(pext)" = "yes" || test "$(pext)" = "no"
893 @test "$(sse)" = "yes" || test "$(sse)" = "no"
894 @test "$(mmx)" = "yes" || test "$(mmx)" = "no"
895 @test "$(sse2)" = "yes" || test "$(sse2)" = "no"
896 @test "$(ssse3)" = "yes" || test "$(ssse3)" = "no"
897 @test "$(sse41)" = "yes" || test "$(sse41)" = "no"
898 @test "$(avx2)" = "yes" || test "$(avx2)" = "no"
899 @test "$(avx512)" = "yes" || test "$(avx512)" = "no"
900 @test "$(vnni256)" = "yes" || test "$(vnni256)" = "no"
901 @test "$(vnni512)" = "yes" || test "$(vnni512)" = "no"
902 @test "$(neon)" = "yes" || test "$(neon)" = "no"
903 @test "$(comp)" = "gcc" || test "$(comp)" = "icc" || test "$(comp)" = "mingw" || test "$(comp)" = "clang" \
904 || test "$(comp)" = "armv7a-linux-androideabi16-clang" || test "$(comp)" = "aarch64-linux-android21-clang"
907 +$(CXX) -o $@ $(OBJS) $(LDFLAGS)
910 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
911 EXTRACXXFLAGS='-fprofile-instr-generate ' \
912 EXTRALDFLAGS=' -fprofile-instr-generate' \
916 $(XCRUN) llvm-profdata merge -output=stockfish.profdata *.profraw
917 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
918 EXTRACXXFLAGS='-fprofile-instr-use=stockfish.profdata' \
919 EXTRALDFLAGS='-fprofile-use ' \
924 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
925 EXTRACXXFLAGS='-fprofile-generate=profdir' \
926 EXTRACXXFLAGS+=$(EXTRAPROFILEFLAGS) \
927 EXTRALDFLAGS='-lgcov' \
931 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
932 EXTRACXXFLAGS='-fprofile-use=profdir -fno-peel-loops -fno-tracer' \
933 EXTRACXXFLAGS+=$(EXTRAPROFILEFLAGS) \
934 EXTRALDFLAGS='-lgcov' \
939 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
940 EXTRACXXFLAGS='-prof-gen=srcpos -prof_dir ./profdir' \
944 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
945 EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \
949 -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null