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.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 = undefined/thread/no (-fsanitize )
65 # --- ( undefined ) --- enable undefined behavior checks
66 # --- ( thread ) --- enable threading error checks
67 # optimize = yes/no --- (-O3/-fast etc.) --- Enable/Disable optimizations
68 # arch = (name) --- (-arch) --- Target architecture
69 # bits = 64/32 --- -DIS_64BIT --- 64-/32-bit operating system
70 # prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction
71 # popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction
72 # pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction
73 # sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions
74 # mmx = yes/no --- -mmmx --- Use Intel MMX instructions
75 # sse2 = yes/no --- -msse2 --- Use Intel Streaming SIMD Extensions 2
76 # ssse3 = yes/no --- -mssse3 --- Use Intel Supplemental Streaming SIMD Extensions 3
77 # sse41 = yes/no --- -msse4.1 --- Use Intel Streaming SIMD Extensions 4.1
78 # avx2 = yes/no --- -mavx2 --- Use Intel Advanced Vector Extensions 2
79 # avx512 = yes/no --- -mavx512bw --- Use Intel Advanced Vector Extensions 512
80 # vnni256 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 256
81 # vnni512 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 512
82 # neon = yes/no --- -DUSE_NEON --- Use ARM SIMD architecture
84 # Note that Makefile is space sensitive, so when adding new architectures
85 # or modifying existing flags, you have to make sure there are no extra spaces
86 # at the end of the line for flag values.
88 ### 2.1. General and architecture defaults
92 help_skip_sanity = yes
94 # explicitly check for the list of supported architectures (as listed with make help),
95 # the user can override with `make ARCH=x86-32-vnni256 SUPPORTED_ARCH=true`
96 ifeq ($(ARCH), $(filter $(ARCH), \
97 x86-64-vnni512 x86-64-vnni256 x86-64-avx512 x86-64-bmi2 x86-64-avx2 \
98 x86-64-sse41-popcnt x86-64-modern x86-64-ssse3 x86-64-sse3-popcnt \
99 x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 e2k \
100 armv7 armv7-neon armv8 apple-silicon general-64 general-32))
125 ### 2.2 Architecture specific
127 ifeq ($(findstring x86,$(ARCH)),x86)
131 ifeq ($(findstring x86-32,$(ARCH)),x86-32)
142 ifeq ($(findstring -sse,$(ARCH)),-sse)
146 ifeq ($(findstring -popcnt,$(ARCH)),-popcnt)
150 ifeq ($(findstring -mmx,$(ARCH)),-mmx)
154 ifeq ($(findstring -sse2,$(ARCH)),-sse2)
159 ifeq ($(findstring -ssse3,$(ARCH)),-ssse3)
165 ifeq ($(findstring -sse41,$(ARCH)),-sse41)
172 ifeq ($(findstring -modern,$(ARCH)),-modern)
180 ifeq ($(findstring -avx2,$(ARCH)),-avx2)
189 ifeq ($(findstring -bmi2,$(ARCH)),-bmi2)
199 ifeq ($(findstring -avx512,$(ARCH)),-avx512)
210 ifeq ($(findstring -vnni256,$(ARCH)),-vnni256)
221 ifeq ($(findstring -vnni512,$(ARCH)),-vnni512)
237 # 64-bit pext is not available on x86-32
244 # all other architectures
246 ifeq ($(ARCH),general-32)
251 ifeq ($(ARCH),general-64)
261 ifeq ($(ARCH),armv7-neon)
276 ifeq ($(ARCH),apple-silicon)
283 ifeq ($(ARCH),ppc-32)
288 ifeq ($(ARCH),ppc-64)
294 ifeq ($(findstring e2k,$(ARCH)),e2k)
307 ### ==========================================================================
308 ### Section 3. Low-level Configuration
309 ### ==========================================================================
311 ### 3.1 Selecting compiler (default = gcc)
312 CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS)
313 DEPENDFLAGS += -std=c++17
314 LDFLAGS += $(EXTRALDFLAGS)
323 CXXFLAGS += -pedantic -Wextra -Wshadow
325 ifeq ($(arch),$(filter $(arch),armv7 armv8))
327 CXXFLAGS += -m$(bits)
331 CXXFLAGS += -m$(bits)
335 ifeq ($(arch),$(filter $(arch),armv7))
339 ifneq ($(KERNEL),Darwin)
340 LDFLAGS += -Wl,--no-as-needed
347 ifeq ($(KERNEL),Linux)
349 ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
350 CXX=x86_64-w64-mingw32-c++
352 CXX=x86_64-w64-mingw32-c++-posix
355 ifeq ($(shell which i686-w64-mingw32-c++-posix),)
356 CXX=i686-w64-mingw32-c++
358 CXX=i686-w64-mingw32-c++-posix
365 CXXFLAGS += -Wextra -Wshadow
372 CXXFLAGS += -diag-disable 1476,10120 -Wcheck -Wabi -Wdeprecated -strict-ansi
378 CXXFLAGS += -pedantic -Wextra -Wshadow
380 ifneq ($(KERNEL),Darwin)
381 ifneq ($(KERNEL),OpenBSD)
382 ifneq ($(KERNEL),FreeBSD)
388 ifeq ($(arch),$(filter $(arch),armv7 armv8))
390 CXXFLAGS += -m$(bits)
394 CXXFLAGS += -m$(bits)
399 ifeq ($(KERNEL),Darwin)
400 CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.14
401 LDFLAGS += -arch $(arch) -mmacosx-version-min=10.14
405 # To cross-compile for Android, NDK version r21 or later is recommended.
406 # In earlier NDK versions, you'll need to pass -fno-addrsig if using GNU binutils.
407 # Currently we don't know how to make PGO builds with the NDK yet.
409 CXXFLAGS += -stdlib=libc++ -fPIE
412 CXX=armv7a-linux-androideabi16-clang++
413 CXXFLAGS += -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon
414 STRIP=arm-linux-androideabi-strip
417 CXX=aarch64-linux-android21-clang++
418 STRIP=aarch64-linux-android-strip
420 LDFLAGS += -static-libstdc++ -pie -lm -latomic
424 profile_make = icc-profile-make
425 profile_use = icc-profile-use
426 else ifeq ($(comp),clang)
427 profile_make = clang-profile-make
428 profile_use = clang-profile-use
430 profile_make = gcc-profile-make
431 profile_use = gcc-profile-use
434 ### Travis CI script uses COMPILER to overwrite CXX
439 ### Allow overwriting CXX from command line
444 ### Sometimes gcc is really clang
446 gccversion = $(shell $(CXX) --version)
447 gccisclang = $(findstring clang,$(gccversion))
448 ifneq ($(gccisclang),)
449 profile_make = clang-profile-make
450 profile_use = clang-profile-use
454 ### On mingw use Windows threads, otherwise POSIX
455 ifneq ($(comp),mingw)
456 CXXFLAGS += -DUSE_PTHREADS
457 # On Android Bionic's C library comes with its own pthread implementation bundled in
458 ifneq ($(OS),Android)
459 # Haiku has pthreads in its libroot, so only link it in on other platforms
460 ifneq ($(KERNEL),Haiku)
475 ### 3.2.2 Debugging with undefined behavior sanitizers
476 ifneq ($(sanitize),no)
477 CXXFLAGS += -g3 -fsanitize=$(sanitize)
478 LDFLAGS += -fsanitize=$(sanitize)
482 ifeq ($(optimize),yes)
487 ifeq ($(OS), Android)
488 CXXFLAGS += -fno-gcse -mthumb -march=armv7-a -mfloat-abi=softfp
492 ifeq ($(comp),$(filter $(comp),gcc clang icc))
493 ifeq ($(KERNEL),Darwin)
494 CXXFLAGS += -mdynamic-no-pic
499 CXXFLAGS += -fexperimental-new-pass-manager
505 CXXFLAGS += -DIS_64BIT
509 ifeq ($(prefetch),yes)
514 CXXFLAGS += -DNO_PREFETCH
519 ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64))
520 CXXFLAGS += -DUSE_POPCNT
521 else ifeq ($(comp),icc)
522 CXXFLAGS += -msse3 -DUSE_POPCNT
524 CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT
529 CXXFLAGS += -DUSE_AVX2
530 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
536 CXXFLAGS += -DUSE_AVX512
537 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
538 CXXFLAGS += -mavx512f -mavx512bw
542 ifeq ($(vnni256),yes)
543 CXXFLAGS += -DUSE_VNNI
544 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
545 CXXFLAGS += -mavx512f -mavx512bw -mavx512vnni -mavx512dq -mavx512vl -mprefer-vector-width=256
549 ifeq ($(vnni512),yes)
550 CXXFLAGS += -DUSE_VNNI
551 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
552 CXXFLAGS += -mavx512vnni -mavx512dq -mavx512vl
557 CXXFLAGS += -DUSE_SSE41
558 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
564 CXXFLAGS += -DUSE_SSSE3
565 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
571 CXXFLAGS += -DUSE_SSE2
572 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
578 CXXFLAGS += -DUSE_MMX
579 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
585 CXXFLAGS += -DUSE_NEON
586 ifeq ($(KERNEL),Linux)
588 ifneq ($(arch),armv8)
589 CXXFLAGS += -mfpu=neon
597 CXXFLAGS += -DUSE_PEXT
598 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
603 ### 3.8 Link Time Optimization
604 ### This is a mix of compile and link time options because the lto link phase
605 ### needs access to the optimization flags.
606 ifeq ($(optimize),yes)
610 ifneq ($(findstring MINGW,$(KERNEL)),)
611 CXXFLAGS += -fuse-ld=lld
612 else ifneq ($(findstring MSYS,$(KERNEL)),)
613 CXXFLAGS += -fuse-ld=lld
615 LDFLAGS += $(CXXFLAGS)
617 # GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
618 # GCC on some systems.
619 else ifeq ($(comp),gcc)
620 ifeq ($(gccisclang),)
622 LDFLAGS += $(CXXFLAGS) -flto=jobserver
623 ifneq ($(findstring MINGW,$(KERNEL)),)
624 LDFLAGS += -save-temps
625 else ifneq ($(findstring MSYS,$(KERNEL)),)
626 LDFLAGS += -save-temps
630 LDFLAGS += $(CXXFLAGS)
633 # To use LTO and static linking on windows, the tool chain requires a recent gcc:
634 # gcc version 10.1 in msys2 or TDM-GCC version 9.2 are known to work, older might not.
635 # So, only enable it for a cross from Linux by default.
636 else ifeq ($(comp),mingw)
637 ifeq ($(KERNEL),Linux)
640 LDFLAGS += $(CXXFLAGS) -flto=jobserver
647 ### 3.9 Android 5 can only run position independent executables. Note that this
648 ### breaks Android 4.0 and earlier.
649 ifeq ($(OS), Android)
651 LDFLAGS += -fPIE -pie
654 ### ==========================================================================
655 ### Section 4. Public Targets
656 ### ==========================================================================
661 @echo "To compile stockfish, type: "
663 @echo "make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]"
665 @echo "Supported targets:"
667 @echo "help > Display architecture details"
668 @echo "build > Standard build"
669 @echo "net > Download the default nnue net"
670 @echo "profile-build > Faster build (with profile-guided optimization)"
671 @echo "strip > Strip executable"
672 @echo "install > Install executable"
673 @echo "clean > Clean up"
675 @echo "Supported archs:"
677 @echo "x86-64-vnni512 > x86 64-bit with vnni support 512bit wide"
678 @echo "x86-64-vnni256 > x86 64-bit with vnni support 256bit wide"
679 @echo "x86-64-avx512 > x86 64-bit with avx512 support"
680 @echo "x86-64-bmi2 > x86 64-bit with bmi2 support"
681 @echo "x86-64-avx2 > x86 64-bit with avx2 support"
682 @echo "x86-64-sse41-popcnt > x86 64-bit with sse41 and popcnt support"
683 @echo "x86-64-modern > common modern CPU, currently x86-64-sse41-popcnt"
684 @echo "x86-64-ssse3 > x86 64-bit with ssse3 support"
685 @echo "x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support"
686 @echo "x86-64 > x86 64-bit generic (with sse2 support)"
687 @echo "x86-32-sse41-popcnt > x86 32-bit with sse41 and popcnt support"
688 @echo "x86-32-sse2 > x86 32-bit with sse2 support"
689 @echo "x86-32 > x86 32-bit generic (with mmx and sse support)"
690 @echo "ppc-64 > PPC 64-bit"
691 @echo "ppc-32 > PPC 32-bit"
692 @echo "armv7 > ARMv7 32-bit"
693 @echo "armv7-neon > ARMv7 32-bit with popcnt and neon"
694 @echo "armv8 > ARMv8 64-bit with popcnt and neon"
695 @echo "e2k > Elbrus 2000"
696 @echo "apple-silicon > Apple silicon ARM64"
697 @echo "general-64 > unspecified 64-bit"
698 @echo "general-32 > unspecified 32-bit"
700 @echo "Supported compilers:"
702 @echo "gcc > Gnu compiler (default)"
703 @echo "mingw > Gnu compiler with MinGW under Windows"
704 @echo "clang > LLVM Clang compiler"
705 @echo "icc > Intel compiler"
706 @echo "ndk > Google NDK to cross-compile for Android"
708 @echo "Simple examples. If you don't know what to do, you likely want to run: "
710 @echo "make -j build ARCH=x86-64 (A portable, slow compile for 64-bit systems)"
711 @echo "make -j build ARCH=x86-32 (A portable, slow compile for 32-bit systems)"
713 @echo "Advanced examples, for experienced users looking for performance: "
715 @echo "make help ARCH=x86-64-bmi2"
716 @echo "make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0"
717 @echo "make -j build ARCH=x86-64-ssse3 COMP=clang"
719 @echo "-------------------------------"
720 ifeq ($(SUPPORTED_ARCH)$(help_skip_sanity), true)
721 @echo "The selected architecture $(ARCH) will enable the following configuration: "
722 @$(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
724 @echo "Specify a supported architecture with the ARCH option for more details"
729 .PHONY: help build profile-build strip install clean net objclean profileclean \
730 config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
731 clang-profile-use clang-profile-make
733 build: net config-sanity
734 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
736 profile-build: net config-sanity objclean profileclean
738 @echo "Step 1/4. Building instrumented executable ..."
739 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make)
741 @echo "Step 2/4. Running benchmark for pgo-build ..."
742 $(PGOBENCH) > /dev/null
744 @echo "Step 3/4. Building optimized executable ..."
745 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
746 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use)
748 @echo "Step 4/4. Deleting profile data ..."
749 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) profileclean
755 -mkdir -p -m 755 $(BINDIR)
757 -strip $(BINDIR)/$(EXE)
760 clean: objclean profileclean
761 @rm -f .depend *~ core
763 # evaluation network (nnue)
765 $(eval nnuenet := $(shell grep EvalFileDefaultName evaluate.h | grep define | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
766 @echo "Default net: $(nnuenet)"
767 $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
768 $(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))
769 @if test -f "$(nnuenet)"; then \
770 echo "Already available."; \
772 if [ "x$(curl_or_wget)" = "x" ]; then \
773 echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \
775 echo "Downloading $(nnuedownloadurl)"; $(curl_or_wget) $(nnuedownloadurl) > $(nnuenet);\
778 $(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))
779 @if [ "x$(shasum_command)" != "x" ]; then \
780 if [ "$(nnuenet)" != "nn-"`$(shasum_command) $(nnuenet) | cut -c1-12`".nnue" ]; then \
781 echo "Failed download or $(nnuenet) corrupted, please delete!"; exit 1; \
784 echo "shasum / sha256sum not found, skipping net validation"; \
787 # clean binaries and objects
789 @rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o
791 # clean auxiliary profiling files
794 @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda *.s
795 @rm -f stockfish.profdata *.profraw
800 ### ==========================================================================
801 ### Section 5. Private Targets
802 ### ==========================================================================
809 @echo "debug: '$(debug)'"
810 @echo "sanitize: '$(sanitize)'"
811 @echo "optimize: '$(optimize)'"
812 @echo "arch: '$(arch)'"
813 @echo "bits: '$(bits)'"
814 @echo "kernel: '$(KERNEL)'"
816 @echo "prefetch: '$(prefetch)'"
817 @echo "popcnt: '$(popcnt)'"
818 @echo "pext: '$(pext)'"
819 @echo "sse: '$(sse)'"
820 @echo "mmx: '$(mmx)'"
821 @echo "sse2: '$(sse2)'"
822 @echo "ssse3: '$(ssse3)'"
823 @echo "sse41: '$(sse41)'"
824 @echo "avx2: '$(avx2)'"
825 @echo "avx512: '$(avx512)'"
826 @echo "vnni256: '$(vnni256)'"
827 @echo "vnni512: '$(vnni512)'"
828 @echo "neon: '$(neon)'"
832 @echo "CXXFLAGS: $(CXXFLAGS)"
833 @echo "LDFLAGS: $(LDFLAGS)"
835 @echo "Testing config sanity. If this fails, try 'make help' ..."
837 @test "$(debug)" = "yes" || test "$(debug)" = "no"
838 @test "$(sanitize)" = "undefined" || test "$(sanitize)" = "thread" || test "$(sanitize)" = "address" || test "$(sanitize)" = "no"
839 @test "$(optimize)" = "yes" || test "$(optimize)" = "no"
840 @test "$(SUPPORTED_ARCH)" = "true"
841 @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
842 test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || test "$(arch)" = "e2k" || \
843 test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
844 @test "$(bits)" = "32" || test "$(bits)" = "64"
845 @test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
846 @test "$(popcnt)" = "yes" || test "$(popcnt)" = "no"
847 @test "$(pext)" = "yes" || test "$(pext)" = "no"
848 @test "$(sse)" = "yes" || test "$(sse)" = "no"
849 @test "$(mmx)" = "yes" || test "$(mmx)" = "no"
850 @test "$(sse2)" = "yes" || test "$(sse2)" = "no"
851 @test "$(ssse3)" = "yes" || test "$(ssse3)" = "no"
852 @test "$(sse41)" = "yes" || test "$(sse41)" = "no"
853 @test "$(avx2)" = "yes" || test "$(avx2)" = "no"
854 @test "$(avx512)" = "yes" || test "$(avx512)" = "no"
855 @test "$(vnni256)" = "yes" || test "$(vnni256)" = "no"
856 @test "$(vnni512)" = "yes" || test "$(vnni512)" = "no"
857 @test "$(neon)" = "yes" || test "$(neon)" = "no"
858 @test "$(comp)" = "gcc" || test "$(comp)" = "icc" || test "$(comp)" = "mingw" || test "$(comp)" = "clang" \
859 || test "$(comp)" = "armv7a-linux-androideabi16-clang" || test "$(comp)" = "aarch64-linux-android21-clang"
862 +$(CXX) -o $@ $(OBJS) $(LDFLAGS)
865 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
866 EXTRACXXFLAGS='-fprofile-instr-generate ' \
867 EXTRALDFLAGS=' -fprofile-instr-generate' \
871 $(XCRUN) llvm-profdata merge -output=stockfish.profdata *.profraw
872 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
873 EXTRACXXFLAGS='-fprofile-instr-use=stockfish.profdata' \
874 EXTRALDFLAGS='-fprofile-use ' \
878 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
879 EXTRACXXFLAGS='-fprofile-generate' \
880 EXTRALDFLAGS='-lgcov' \
884 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
885 EXTRACXXFLAGS='-fprofile-use -fno-peel-loops -fno-tracer' \
886 EXTRALDFLAGS='-lgcov' \
891 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
892 EXTRACXXFLAGS='-prof-gen=srcpos -prof_dir ./profdir' \
896 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
897 EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \
901 -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null