1 # Stockfish, a UCI chess playing engine derived from Glaurung 2.1
2 # Copyright (C) 2004-2022 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 ### ==========================================================================
22 ### Establish the operating system name
23 KERNEL = $(shell uname -s)
24 ifeq ($(KERNEL),Linux)
25 OS = $(shell uname -o)
29 ifeq ($(OS),Windows_NT)
31 else ifeq ($(COMP),mingw)
34 WINE_PATH = $(shell which wine)
39 ifeq ($(target_windows),yes)
45 ### Installation dir definitions
47 BINDIR = $(PREFIX)/bin
49 ### Built-in benchmark for pgo-builds
51 PGOBENCH = $(WINE_PATH) ./$(EXE) bench
53 PGOBENCH = $(SDE_PATH) -- $(WINE_PATH) ./$(EXE) bench
56 ### Source and object files
57 SRCS = benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp main.cpp \
58 material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp \
59 search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp \
60 nnue/evaluate_nnue.cpp nnue/features/half_ka_v2_hm.cpp
62 OBJS = $(notdir $(SRCS:.cpp=.o))
64 VPATH = syzygy:nnue:nnue/features
66 ### ==========================================================================
67 ### Section 2. High-level Configuration
68 ### ==========================================================================
70 # flag --- Comp switch --- Description
71 # ----------------------------------------------------------------------------
73 # debug = yes/no --- -DNDEBUG --- Enable/Disable debug mode
74 # sanitize = none/<sanitizer> ... (-fsanitize )
75 # --- ( undefined ) --- enable undefined behavior checks
76 # --- ( thread ) --- enable threading error checks
77 # --- ( address ) --- enable memory access checks
78 # --- ...etc... --- see compiler documentation for supported sanitizers
79 # optimize = yes/no --- (-O3/-fast etc.) --- Enable/Disable optimizations
80 # arch = (name) --- (-arch) --- Target architecture
81 # bits = 64/32 --- -DIS_64BIT --- 64-/32-bit operating system
82 # prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction
83 # popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction
84 # pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction
85 # sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions
86 # mmx = yes/no --- -mmmx --- Use Intel MMX instructions
87 # sse2 = yes/no --- -msse2 --- Use Intel Streaming SIMD Extensions 2
88 # ssse3 = yes/no --- -mssse3 --- Use Intel Supplemental Streaming SIMD Extensions 3
89 # sse41 = yes/no --- -msse4.1 --- Use Intel Streaming SIMD Extensions 4.1
90 # avx2 = yes/no --- -mavx2 --- Use Intel Advanced Vector Extensions 2
91 # avxvnni = yes/no --- -mavxvnni --- Use Intel Vector Neural Network Instructions AVX
92 # avx512 = yes/no --- -mavx512bw --- Use Intel Advanced Vector Extensions 512
93 # vnni256 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 256
94 # vnni512 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 512
95 # neon = yes/no --- -DUSE_NEON --- Use ARM SIMD architecture
97 # Note that Makefile is space sensitive, so when adding new architectures
98 # or modifying existing flags, you have to make sure there are no extra spaces
99 # at the end of the line for flag values.
101 # Example of use for these flags:
102 # make build ARCH=x86-64-avx512 debug=yes sanitize="address undefined"
105 ### 2.1. General and architecture defaults
109 help_skip_sanity = yes
111 # explicitly check for the list of supported architectures (as listed with make help),
112 # the user can override with `make ARCH=x86-32-vnni256 SUPPORTED_ARCH=true`
113 ifeq ($(ARCH), $(filter $(ARCH), \
114 x86-64-vnni512 x86-64-vnni256 x86-64-avx512 x86-64-avxvnni x86-64-bmi2 \
115 x86-64-avx2 x86-64-sse41-popcnt x86-64-modern x86-64-ssse3 x86-64-sse3-popcnt \
116 x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 e2k \
117 armv7 armv7-neon armv8 apple-silicon general-64 general-32))
144 ### 2.2 Architecture specific
146 ifeq ($(findstring x86,$(ARCH)),x86)
150 ifeq ($(findstring x86-32,$(ARCH)),x86-32)
161 ifeq ($(findstring -sse,$(ARCH)),-sse)
165 ifeq ($(findstring -popcnt,$(ARCH)),-popcnt)
169 ifeq ($(findstring -mmx,$(ARCH)),-mmx)
173 ifeq ($(findstring -sse2,$(ARCH)),-sse2)
178 ifeq ($(findstring -ssse3,$(ARCH)),-ssse3)
184 ifeq ($(findstring -sse41,$(ARCH)),-sse41)
191 ifeq ($(findstring -modern,$(ARCH)),-modern)
199 ifeq ($(findstring -avx2,$(ARCH)),-avx2)
208 ifeq ($(findstring -avxvnni,$(ARCH)),-avxvnni)
219 ifeq ($(findstring -bmi2,$(ARCH)),-bmi2)
229 ifeq ($(findstring -avx512,$(ARCH)),-avx512)
240 ifeq ($(findstring -vnni256,$(ARCH)),-vnni256)
251 ifeq ($(findstring -vnni512,$(ARCH)),-vnni512)
267 # 64-bit pext is not available on x86-32
274 # all other architectures
276 ifeq ($(ARCH),general-32)
281 ifeq ($(ARCH),general-64)
292 ifeq ($(ARCH),armv7-neon)
309 ifeq ($(ARCH),apple-silicon)
317 ifeq ($(ARCH),ppc-32)
322 ifeq ($(ARCH),ppc-64)
328 ifeq ($(findstring e2k,$(ARCH)),e2k)
341 ### ==========================================================================
342 ### Section 3. Low-level Configuration
343 ### ==========================================================================
345 ### 3.1 Selecting compiler (default = gcc)
346 CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS)
347 DEPENDFLAGS += -std=c++17
348 LDFLAGS += $(EXTRALDFLAGS)
357 CXXFLAGS += -pedantic -Wextra -Wshadow
359 ifeq ($(arch),$(filter $(arch),armv7 armv8))
361 CXXFLAGS += -m$(bits)
365 CXXFLAGS += -m$(bits)
369 ifeq ($(arch),$(filter $(arch),armv7))
373 ifneq ($(KERNEL),Darwin)
374 LDFLAGS += -Wl,--no-as-needed
378 ifeq ($(target_windows),yes)
386 ifeq ($(shell which x86_64-w64-mingw32-c++-posix 2> /dev/null),)
387 CXX=x86_64-w64-mingw32-c++
389 CXX=x86_64-w64-mingw32-c++-posix
392 ifeq ($(shell which i686-w64-mingw32-c++-posix 2> /dev/null),)
393 CXX=i686-w64-mingw32-c++
395 CXX=i686-w64-mingw32-c++-posix
398 CXXFLAGS += -pedantic -Wextra -Wshadow
404 CXXFLAGS += -diag-disable 1476,10120 -Wcheck -Wabi -Wdeprecated -strict-ansi
410 ifeq ($(target_windows),yes)
411 CXX=x86_64-w64-mingw32-clang++
414 CXXFLAGS += -pedantic -Wextra -Wshadow
416 ifeq ($(filter $(KERNEL),Darwin OpenBSD FreeBSD),)
417 ifeq ($(target_windows),)
418 ifneq ($(RTLIB),compiler-rt)
424 ifeq ($(arch),$(filter $(arch),armv7 armv8))
426 CXXFLAGS += -m$(bits)
430 CXXFLAGS += -m$(bits)
435 ifeq ($(KERNEL),Darwin)
436 CXXFLAGS += -mmacosx-version-min=10.14
437 LDFLAGS += -mmacosx-version-min=10.14
439 CXXFLAGS += -arch $(arch)
440 LDFLAGS += -arch $(arch)
445 # To cross-compile for Android, NDK version r21 or later is recommended.
446 # In earlier NDK versions, you'll need to pass -fno-addrsig if using GNU binutils.
447 # Currently we don't know how to make PGO builds with the NDK yet.
449 CXXFLAGS += -stdlib=libc++ -fPIE
452 CXX=armv7a-linux-androideabi16-clang++
453 CXXFLAGS += -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon
454 STRIP=arm-linux-androideabi-strip
457 CXX=aarch64-linux-android21-clang++
458 STRIP=aarch64-linux-android-strip
460 LDFLAGS += -static-libstdc++ -pie -lm -latomic
464 profile_make = icc-profile-make
465 profile_use = icc-profile-use
466 else ifeq ($(comp),clang)
467 profile_make = clang-profile-make
468 profile_use = clang-profile-use
470 profile_make = gcc-profile-make
471 profile_use = gcc-profile-use
472 ifeq ($(KERNEL),Darwin)
473 EXTRAPROFILEFLAGS = -fvisibility=hidden
477 ### Travis CI script uses COMPILER to overwrite CXX
482 ### Allow overwriting CXX from command line
487 ### Sometimes gcc is really clang
489 gccversion = $(shell $(CXX) --version)
490 gccisclang = $(findstring clang,$(gccversion))
491 ifneq ($(gccisclang),)
492 profile_make = clang-profile-make
493 profile_use = clang-profile-use
497 ### On mingw use Windows threads, otherwise POSIX
498 ifneq ($(comp),mingw)
499 CXXFLAGS += -DUSE_PTHREADS
500 # On Android Bionic's C library comes with its own pthread implementation bundled in
501 ifneq ($(OS),Android)
502 # Haiku has pthreads in its libroot, so only link it in on other platforms
503 ifneq ($(KERNEL),Haiku)
518 ### 3.2.2 Debugging with undefined behavior sanitizers
519 ifneq ($(sanitize),none)
520 CXXFLAGS += -g3 $(addprefix -fsanitize=,$(sanitize))
521 LDFLAGS += $(addprefix -fsanitize=,$(sanitize))
525 ifeq ($(optimize),yes)
530 ifeq ($(OS), Android)
531 CXXFLAGS += -fno-gcse -mthumb -march=armv7-a -mfloat-abi=softfp
535 ifeq ($(KERNEL),Darwin)
536 ifeq ($(comp),$(filter $(comp),clang icc))
537 CXXFLAGS += -mdynamic-no-pic
541 ifneq ($(arch),arm64)
542 CXXFLAGS += -mdynamic-no-pic
548 CXXFLAGS += -fexperimental-new-pass-manager
554 CXXFLAGS += -DIS_64BIT
557 ### 3.5 prefetch and popcount
558 ifeq ($(prefetch),yes)
563 CXXFLAGS += -DNO_PREFETCH
567 ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64))
568 CXXFLAGS += -DUSE_POPCNT
569 else ifeq ($(comp),icc)
570 CXXFLAGS += -msse3 -DUSE_POPCNT
572 CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT
576 ### 3.6 SIMD architectures
578 CXXFLAGS += -DUSE_AVX2
579 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
584 ifeq ($(avxvnni),yes)
585 CXXFLAGS += -DUSE_VNNI -DUSE_AVXVNNI
586 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
587 CXXFLAGS += -mavxvnni
592 CXXFLAGS += -DUSE_AVX512
593 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
594 CXXFLAGS += -mavx512f -mavx512bw
598 ifeq ($(vnni256),yes)
599 CXXFLAGS += -DUSE_VNNI
600 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
601 CXXFLAGS += -mavx512f -mavx512bw -mavx512vnni -mavx512dq -mavx512vl -mprefer-vector-width=256
605 ifeq ($(vnni512),yes)
606 CXXFLAGS += -DUSE_VNNI
607 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
608 CXXFLAGS += -mavx512vnni -mavx512dq -mavx512vl
613 CXXFLAGS += -DUSE_SSE41
614 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
620 CXXFLAGS += -DUSE_SSSE3
621 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
627 CXXFLAGS += -DUSE_SSE2
628 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
634 CXXFLAGS += -DUSE_MMX
635 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
641 CXXFLAGS += -DUSE_NEON=$(arm_version)
642 ifeq ($(KERNEL),Linux)
644 ifneq ($(arch),armv8)
645 CXXFLAGS += -mfpu=neon
653 CXXFLAGS += -DUSE_PEXT
654 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
659 ### 3.8 Link Time Optimization
660 ### This is a mix of compile and link time options because the lto link phase
661 ### needs access to the optimization flags.
662 ifeq ($(optimize),yes)
666 ifeq ($(target_windows),yes)
667 CXXFLAGS += -fuse-ld=lld
669 LDFLAGS += $(CXXFLAGS)
671 # GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
672 # GCC on some systems.
673 else ifeq ($(comp),gcc)
674 ifeq ($(gccisclang),)
676 LDFLAGS += $(CXXFLAGS) -flto=jobserver
679 LDFLAGS += $(CXXFLAGS)
682 # To use LTO and static linking on Windows,
683 # the tool chain requires gcc version 10.1 or later.
684 else ifeq ($(comp),mingw)
686 CXXFLAGS += -flto=auto
687 LDFLAGS += $(CXXFLAGS) -save-temps
693 ### 3.9 Android 5 can only run position independent executables. Note that this
694 ### breaks Android 4.0 and earlier.
695 ifeq ($(OS), Android)
697 LDFLAGS += -fPIE -pie
700 ### ==========================================================================
701 ### Section 4. Public Targets
702 ### ==========================================================================
707 @echo "To compile stockfish, type: "
709 @echo "make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]"
711 @echo "Supported targets:"
713 @echo "help > Display architecture details"
714 @echo "build > Standard build"
715 @echo "net > Download the default nnue net"
716 @echo "profile-build > Faster build (with profile-guided optimization)"
717 @echo "strip > Strip executable"
718 @echo "install > Install executable"
719 @echo "clean > Clean up"
721 @echo "Supported archs:"
723 @echo "x86-64-vnni512 > x86 64-bit with vnni support 512bit wide"
724 @echo "x86-64-vnni256 > x86 64-bit with vnni support 256bit wide"
725 @echo "x86-64-avx512 > x86 64-bit with avx512 support"
726 @echo "x86-64-avxvnni > x86 64-bit with avxvnni support"
727 @echo "x86-64-bmi2 > x86 64-bit with bmi2 support"
728 @echo "x86-64-avx2 > x86 64-bit with avx2 support"
729 @echo "x86-64-sse41-popcnt > x86 64-bit with sse41 and popcnt support"
730 @echo "x86-64-modern > common modern CPU, currently x86-64-sse41-popcnt"
731 @echo "x86-64-ssse3 > x86 64-bit with ssse3 support"
732 @echo "x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support"
733 @echo "x86-64 > x86 64-bit generic (with sse2 support)"
734 @echo "x86-32-sse41-popcnt > x86 32-bit with sse41 and popcnt support"
735 @echo "x86-32-sse2 > x86 32-bit with sse2 support"
736 @echo "x86-32 > x86 32-bit generic (with mmx and sse support)"
737 @echo "ppc-64 > PPC 64-bit"
738 @echo "ppc-32 > PPC 32-bit"
739 @echo "armv7 > ARMv7 32-bit"
740 @echo "armv7-neon > ARMv7 32-bit with popcnt and neon"
741 @echo "armv8 > ARMv8 64-bit with popcnt and neon"
742 @echo "e2k > Elbrus 2000"
743 @echo "apple-silicon > Apple silicon ARM64"
744 @echo "general-64 > unspecified 64-bit"
745 @echo "general-32 > unspecified 32-bit"
747 @echo "Supported compilers:"
749 @echo "gcc > Gnu compiler (default)"
750 @echo "mingw > Gnu compiler with MinGW under Windows"
751 @echo "clang > LLVM Clang compiler"
752 @echo "icc > Intel compiler"
753 @echo "ndk > Google NDK to cross-compile for Android"
755 @echo "Simple examples. If you don't know what to do, you likely want to run: "
757 @echo "make -j build ARCH=x86-64 (A portable, slow compile for 64-bit systems)"
758 @echo "make -j build ARCH=x86-32 (A portable, slow compile for 32-bit systems)"
760 @echo "Advanced examples, for experienced users looking for performance: "
762 @echo "make help ARCH=x86-64-bmi2"
763 @echo "make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0"
764 @echo "make -j build ARCH=x86-64-ssse3 COMP=clang"
766 @echo "-------------------------------"
767 ifeq ($(SUPPORTED_ARCH)$(help_skip_sanity), true)
768 @echo "The selected architecture $(ARCH) will enable the following configuration: "
769 @$(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
771 @echo "Specify a supported architecture with the ARCH option for more details"
776 .PHONY: help build profile-build strip install clean net objclean profileclean \
777 config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
778 clang-profile-use clang-profile-make
780 build: net config-sanity
781 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
783 profile-build: net config-sanity objclean profileclean
785 @echo "Step 1/4. Building instrumented executable ..."
786 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make)
788 @echo "Step 2/4. Running benchmark for pgo-build ..."
789 $(PGOBENCH) 2>&1 | tail -n 4
791 @echo "Step 3/4. Building optimized executable ..."
792 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
793 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use)
795 @echo "Step 4/4. Deleting profile data ..."
796 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) profileclean
802 -mkdir -p -m 755 $(BINDIR)
804 -strip $(BINDIR)/$(EXE)
807 clean: objclean profileclean
808 @rm -f .depend *~ core
810 # evaluation network (nnue)
812 $(eval nnuenet := $(shell grep EvalFileDefaultName evaluate.h | grep define | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
813 @echo "Default net: $(nnuenet)"
814 $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
815 $(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))
816 @if test -f "$(nnuenet)"; then \
817 echo "Already available."; \
819 if [ "x$(curl_or_wget)" = "x" ]; then \
820 echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \
822 echo "Downloading $(nnuedownloadurl)"; $(curl_or_wget) $(nnuedownloadurl) > $(nnuenet);\
825 $(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))
826 @if [ "x$(shasum_command)" != "x" ]; then \
827 if [ "$(nnuenet)" != "nn-"`$(shasum_command) $(nnuenet) | cut -c1-12`".nnue" ]; then \
828 echo "Failed download or $(nnuenet) corrupted, please delete!"; exit 1; \
831 echo "shasum / sha256sum not found, skipping net validation"; \
834 # clean binaries and objects
836 @rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o
838 # clean auxiliary profiling files
841 @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda *.s
842 @rm -f stockfish.profdata *.profraw
843 @rm -f stockfish.*args*
844 @rm -f stockfish.*lt*
846 @rm -f ./-lstdc++.res
851 ### ==========================================================================
852 ### Section 5. Private Targets
853 ### ==========================================================================
860 @echo "debug: '$(debug)'"
861 @echo "sanitize: '$(sanitize)'"
862 @echo "optimize: '$(optimize)'"
863 @echo "arch: '$(arch)'"
864 @echo "bits: '$(bits)'"
865 @echo "kernel: '$(KERNEL)'"
867 @echo "prefetch: '$(prefetch)'"
868 @echo "popcnt: '$(popcnt)'"
869 @echo "pext: '$(pext)'"
870 @echo "sse: '$(sse)'"
871 @echo "mmx: '$(mmx)'"
872 @echo "sse2: '$(sse2)'"
873 @echo "ssse3: '$(ssse3)'"
874 @echo "sse41: '$(sse41)'"
875 @echo "avx2: '$(avx2)'"
876 @echo "avxvnni: '$(avxvnni)'"
877 @echo "avx512: '$(avx512)'"
878 @echo "vnni256: '$(vnni256)'"
879 @echo "vnni512: '$(vnni512)'"
880 @echo "neon: '$(neon)'"
881 @echo "arm_version: '$(arm_version)'"
885 @echo "CXXFLAGS: $(CXXFLAGS)"
886 @echo "LDFLAGS: $(LDFLAGS)"
888 @echo "Testing config sanity. If this fails, try 'make help' ..."
890 @test "$(debug)" = "yes" || test "$(debug)" = "no"
891 @test "$(optimize)" = "yes" || test "$(optimize)" = "no"
892 @test "$(SUPPORTED_ARCH)" = "true"
893 @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
894 test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "e2k" || \
895 test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
896 @test "$(bits)" = "32" || test "$(bits)" = "64"
897 @test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
898 @test "$(popcnt)" = "yes" || test "$(popcnt)" = "no"
899 @test "$(pext)" = "yes" || test "$(pext)" = "no"
900 @test "$(sse)" = "yes" || test "$(sse)" = "no"
901 @test "$(mmx)" = "yes" || test "$(mmx)" = "no"
902 @test "$(sse2)" = "yes" || test "$(sse2)" = "no"
903 @test "$(ssse3)" = "yes" || test "$(ssse3)" = "no"
904 @test "$(sse41)" = "yes" || test "$(sse41)" = "no"
905 @test "$(avx2)" = "yes" || test "$(avx2)" = "no"
906 @test "$(avx512)" = "yes" || test "$(avx512)" = "no"
907 @test "$(vnni256)" = "yes" || test "$(vnni256)" = "no"
908 @test "$(vnni512)" = "yes" || test "$(vnni512)" = "no"
909 @test "$(neon)" = "yes" || test "$(neon)" = "no"
910 @test "$(comp)" = "gcc" || test "$(comp)" = "icc" || test "$(comp)" = "mingw" || test "$(comp)" = "clang" \
911 || test "$(comp)" = "armv7a-linux-androideabi16-clang" || test "$(comp)" = "aarch64-linux-android21-clang"
914 +$(CXX) -o $@ $(OBJS) $(LDFLAGS)
917 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
918 EXTRACXXFLAGS='-fprofile-instr-generate ' \
919 EXTRALDFLAGS=' -fprofile-instr-generate' \
923 $(XCRUN) llvm-profdata merge -output=stockfish.profdata *.profraw
924 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
925 EXTRACXXFLAGS='-fprofile-instr-use=stockfish.profdata' \
926 EXTRALDFLAGS='-fprofile-use ' \
931 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
932 EXTRACXXFLAGS='-fprofile-generate=profdir' \
933 EXTRACXXFLAGS+=$(EXTRAPROFILEFLAGS) \
934 EXTRALDFLAGS='-lgcov' \
938 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
939 EXTRACXXFLAGS='-fprofile-use=profdir -fno-peel-loops -fno-tracer' \
940 EXTRACXXFLAGS+=$(EXTRAPROFILEFLAGS) \
941 EXTRALDFLAGS='-lgcov' \
946 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
947 EXTRACXXFLAGS='-prof-gen=srcpos -prof_dir ./profdir' \
951 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
952 EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \
956 -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null