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
34 PGOBENCH = ./$(EXE) bench
36 ### Source and object files
37 SRCS = benchmark.cpp bitbase.cpp bitboard.cpp endgame.cpp evaluate.cpp main.cpp \
38 material.cpp misc.cpp movegen.cpp movepick.cpp pawns.cpp position.cpp psqt.cpp \
39 search.cpp thread.cpp timeman.cpp tt.cpp uci.cpp ucioption.cpp tune.cpp syzygy/tbprobe.cpp \
40 nnue/evaluate_nnue.cpp nnue/features/half_kp.cpp
42 OBJS = $(notdir $(SRCS:.cpp=.o))
44 VPATH = syzygy:nnue:nnue/features
46 ### Establish the operating system name
47 KERNEL = $(shell uname -s)
48 ifeq ($(KERNEL),Linux)
49 OS = $(shell uname -o)
52 ### ==========================================================================
53 ### Section 2. High-level Configuration
54 ### ==========================================================================
56 # flag --- Comp switch --- Description
57 # ----------------------------------------------------------------------------
59 # debug = yes/no --- -DNDEBUG --- Enable/Disable debug mode
60 # sanitize = undefined/thread/no (-fsanitize )
61 # --- ( undefined ) --- enable undefined behavior checks
62 # --- ( thread ) --- enable threading error checks
63 # optimize = yes/no --- (-O3/-fast etc.) --- Enable/Disable optimizations
64 # arch = (name) --- (-arch) --- Target architecture
65 # bits = 64/32 --- -DIS_64BIT --- 64-/32-bit operating system
66 # prefetch = yes/no --- -DUSE_PREFETCH --- Use prefetch asm-instruction
67 # popcnt = yes/no --- -DUSE_POPCNT --- Use popcnt asm-instruction
68 # pext = yes/no --- -DUSE_PEXT --- Use pext x86_64 asm-instruction
69 # sse = yes/no --- -msse --- Use Intel Streaming SIMD Extensions
70 # mmx = yes/no --- -mmmx --- Use Intel MMX instructions
71 # sse2 = yes/no --- -msse2 --- Use Intel Streaming SIMD Extensions 2
72 # ssse3 = yes/no --- -mssse3 --- Use Intel Supplemental Streaming SIMD Extensions 3
73 # sse41 = yes/no --- -msse4.1 --- Use Intel Streaming SIMD Extensions 4.1
74 # avx2 = yes/no --- -mavx2 --- Use Intel Advanced Vector Extensions 2
75 # avx512 = yes/no --- -mavx512bw --- Use Intel Advanced Vector Extensions 512
76 # vnni256 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 256
77 # vnni512 = yes/no --- -mavx512vnni --- Use Intel Vector Neural Network Instructions 512
78 # neon = yes/no --- -DUSE_NEON --- Use ARM SIMD architecture
80 # Note that Makefile is space sensitive, so when adding new architectures
81 # or modifying existing flags, you have to make sure there are no extra spaces
82 # at the end of the line for flag values.
84 ### 2.1. General and architecture defaults
88 help_skip_sanity = yes
90 # explicitly check for the list of supported architectures (as listed with make help),
91 # the user can override with `make ARCH=x86-32-vnni256 SUPPORTED_ARCH=true`
92 ifeq ($(ARCH), $(filter $(ARCH), \
93 x86-64-vnni512 x86-64-vnni256 x86-64-avx512 x86-64-bmi2 x86-64-avx2 \
94 x86-64-sse41-popcnt x86-64-modern x86-64-ssse3 x86-64-sse3-popcnt \
95 x86-64 x86-32-sse41-popcnt x86-32-sse2 x86-32 ppc-64 ppc-32 \
96 armv7 armv7-neon armv8 apple-silicon general-64 general-32))
121 ### 2.2 Architecture specific
123 ifeq ($(findstring x86,$(ARCH)),x86)
127 ifeq ($(findstring x86-32,$(ARCH)),x86-32)
138 ifeq ($(findstring -sse,$(ARCH)),-sse)
142 ifeq ($(findstring -popcnt,$(ARCH)),-popcnt)
146 ifeq ($(findstring -mmx,$(ARCH)),-mmx)
150 ifeq ($(findstring -sse2,$(ARCH)),-sse2)
155 ifeq ($(findstring -ssse3,$(ARCH)),-ssse3)
161 ifeq ($(findstring -sse41,$(ARCH)),-sse41)
168 ifeq ($(findstring -modern,$(ARCH)),-modern)
176 ifeq ($(findstring -avx2,$(ARCH)),-avx2)
185 ifeq ($(findstring -bmi2,$(ARCH)),-bmi2)
195 ifeq ($(findstring -avx512,$(ARCH)),-avx512)
206 ifeq ($(findstring -vnni256,$(ARCH)),-vnni256)
217 ifeq ($(findstring -vnni512,$(ARCH)),-vnni512)
233 # 64-bit pext is not available on x86-32
240 # all other architectures
242 ifeq ($(ARCH),general-32)
247 ifeq ($(ARCH),general-64)
257 ifeq ($(ARCH),armv7-neon)
272 ifeq ($(ARCH),apple-silicon)
279 ifeq ($(ARCH),ppc-32)
284 ifeq ($(ARCH),ppc-64)
292 ### ==========================================================================
293 ### Section 3. Low-level Configuration
294 ### ==========================================================================
296 ### 3.1 Selecting compiler (default = gcc)
297 CXXFLAGS += -Wall -Wcast-qual -fno-exceptions -std=c++17 $(EXTRACXXFLAGS)
298 DEPENDFLAGS += -std=c++17
299 LDFLAGS += $(EXTRALDFLAGS)
308 CXXFLAGS += -pedantic -Wextra -Wshadow
310 ifeq ($(arch),$(filter $(arch),armv7 armv8))
312 CXXFLAGS += -m$(bits)
316 CXXFLAGS += -m$(bits)
320 ifeq ($(arch),$(filter $(arch),armv7))
324 ifneq ($(KERNEL),Darwin)
325 LDFLAGS += -Wl,--no-as-needed
332 ifeq ($(KERNEL),Linux)
334 ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
335 CXX=x86_64-w64-mingw32-c++
337 CXX=x86_64-w64-mingw32-c++-posix
340 ifeq ($(shell which i686-w64-mingw32-c++-posix),)
341 CXX=i686-w64-mingw32-c++
343 CXX=i686-w64-mingw32-c++-posix
350 CXXFLAGS += -Wextra -Wshadow
357 CXXFLAGS += -diag-disable 1476,10120 -Wcheck -Wabi -Wdeprecated -strict-ansi
363 CXXFLAGS += -pedantic -Wextra -Wshadow
365 ifneq ($(KERNEL),Darwin)
366 ifneq ($(KERNEL),OpenBSD)
367 ifneq ($(KERNEL),FreeBSD)
373 ifeq ($(arch),$(filter $(arch),armv7 armv8))
375 CXXFLAGS += -m$(bits)
379 CXXFLAGS += -m$(bits)
384 ifeq ($(KERNEL),Darwin)
385 CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.14
386 LDFLAGS += -arch $(arch) -mmacosx-version-min=10.14
390 # To cross-compile for Android, NDK version r21 or later is recommended.
391 # In earlier NDK versions, you'll need to pass -fno-addrsig if using GNU binutils.
392 # Currently we don't know how to make PGO builds with the NDK yet.
394 CXXFLAGS += -stdlib=libc++ -fPIE
397 CXX=armv7a-linux-androideabi16-clang++
398 CXXFLAGS += -mthumb -march=armv7-a -mfloat-abi=softfp -mfpu=neon
399 STRIP=arm-linux-androideabi-strip
402 CXX=aarch64-linux-android21-clang++
403 STRIP=aarch64-linux-android-strip
405 LDFLAGS += -static-libstdc++ -pie -lm -latomic
409 profile_make = icc-profile-make
410 profile_use = icc-profile-use
411 else ifeq ($(comp),clang)
412 profile_make = clang-profile-make
413 profile_use = clang-profile-use
415 profile_make = gcc-profile-make
416 profile_use = gcc-profile-use
419 ### Travis CI script uses COMPILER to overwrite CXX
424 ### Allow overwriting CXX from command line
429 ### Sometimes gcc is really clang
431 gccversion = $(shell $(CXX) --version)
432 gccisclang = $(findstring clang,$(gccversion))
433 ifneq ($(gccisclang),)
434 profile_make = clang-profile-make
435 profile_use = clang-profile-use
439 ### On mingw use Windows threads, otherwise POSIX
440 ifneq ($(comp),mingw)
441 CXXFLAGS += -DUSE_PTHREADS
442 # On Android Bionic's C library comes with its own pthread implementation bundled in
443 ifneq ($(OS),Android)
444 # Haiku has pthreads in its libroot, so only link it in on other platforms
445 ifneq ($(KERNEL),Haiku)
460 ### 3.2.2 Debugging with undefined behavior sanitizers
461 ifneq ($(sanitize),no)
462 CXXFLAGS += -g3 -fsanitize=$(sanitize)
463 LDFLAGS += -fsanitize=$(sanitize)
467 ifeq ($(optimize),yes)
472 ifeq ($(OS), Android)
473 CXXFLAGS += -fno-gcse -mthumb -march=armv7-a -mfloat-abi=softfp
477 ifeq ($(comp),$(filter $(comp),gcc clang icc))
478 ifeq ($(KERNEL),Darwin)
479 CXXFLAGS += -mdynamic-no-pic
484 CXXFLAGS += -fexperimental-new-pass-manager
490 CXXFLAGS += -DIS_64BIT
494 ifeq ($(prefetch),yes)
499 CXXFLAGS += -DNO_PREFETCH
504 ifeq ($(arch),$(filter $(arch),ppc64 armv7 armv8 arm64))
505 CXXFLAGS += -DUSE_POPCNT
506 else ifeq ($(comp),icc)
507 CXXFLAGS += -msse3 -DUSE_POPCNT
509 CXXFLAGS += -msse3 -mpopcnt -DUSE_POPCNT
515 CXXFLAGS += -DUSE_AVX2
516 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
522 CXXFLAGS += -DUSE_AVX512
523 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
524 CXXFLAGS += -mavx512f -mavx512bw
528 ifeq ($(vnni256),yes)
529 CXXFLAGS += -DUSE_VNNI
530 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
531 CXXFLAGS += -mavx512f -mavx512bw -mavx512vnni -mavx512dq -mavx512vl -mprefer-vector-width=256
535 ifeq ($(vnni512),yes)
536 CXXFLAGS += -DUSE_VNNI
537 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
538 CXXFLAGS += -mavx512vnni -mavx512dq -mavx512vl
543 CXXFLAGS += -DUSE_SSE41
544 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
550 CXXFLAGS += -DUSE_SSSE3
551 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
557 CXXFLAGS += -DUSE_SSE2
558 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
564 CXXFLAGS += -DUSE_MMX
565 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
571 CXXFLAGS += -DUSE_NEON
572 ifeq ($(KERNEL),Linux)
574 ifneq ($(arch),armv8)
575 CXXFLAGS += -mfpu=neon
583 CXXFLAGS += -DUSE_PEXT
584 ifeq ($(comp),$(filter $(comp),gcc clang mingw))
589 ### 3.8 Link Time Optimization
590 ### This is a mix of compile and link time options because the lto link phase
591 ### needs access to the optimization flags.
592 ifeq ($(optimize),yes)
596 ifneq ($(findstring MINGW,$(KERNEL)),)
597 CXXFLAGS += -fuse-ld=lld
598 else ifneq ($(findstring MSYS,$(KERNEL)),)
599 CXXFLAGS += -fuse-ld=lld
601 LDFLAGS += $(CXXFLAGS)
603 # GCC and CLANG use different methods for parallelizing LTO and CLANG pretends to be
604 # GCC on some systems.
605 else ifeq ($(comp),gcc)
606 ifeq ($(gccisclang),)
608 LDFLAGS += $(CXXFLAGS) -flto=jobserver
609 ifneq ($(findstring MINGW,$(KERNEL)),)
610 LDFLAGS += -save-temps
611 else ifneq ($(findstring MSYS,$(KERNEL)),)
612 LDFLAGS += -save-temps
616 LDFLAGS += $(CXXFLAGS)
619 # To use LTO and static linking on windows, the tool chain requires a recent gcc:
620 # gcc version 10.1 in msys2 or TDM-GCC version 9.2 are known to work, older might not.
621 # So, only enable it for a cross from Linux by default.
622 else ifeq ($(comp),mingw)
623 ifeq ($(KERNEL),Linux)
626 LDFLAGS += $(CXXFLAGS) -flto=jobserver
633 ### 3.9 Android 5 can only run position independent executables. Note that this
634 ### breaks Android 4.0 and earlier.
635 ifeq ($(OS), Android)
637 LDFLAGS += -fPIE -pie
640 ### ==========================================================================
641 ### Section 4. Public Targets
642 ### ==========================================================================
647 @echo "To compile stockfish, type: "
649 @echo "make target ARCH=arch [COMP=compiler] [COMPCXX=cxx]"
651 @echo "Supported targets:"
653 @echo "help > Display architecture details"
654 @echo "build > Standard build"
655 @echo "net > Download the default nnue net"
656 @echo "profile-build > Faster build (with profile-guided optimization)"
657 @echo "strip > Strip executable"
658 @echo "install > Install executable"
659 @echo "clean > Clean up"
661 @echo "Supported archs:"
663 @echo "x86-64-vnni512 > x86 64-bit with vnni support 512bit wide"
664 @echo "x86-64-vnni256 > x86 64-bit with vnni support 256bit wide"
665 @echo "x86-64-avx512 > x86 64-bit with avx512 support"
666 @echo "x86-64-bmi2 > x86 64-bit with bmi2 support"
667 @echo "x86-64-avx2 > x86 64-bit with avx2 support"
668 @echo "x86-64-sse41-popcnt > x86 64-bit with sse41 and popcnt support"
669 @echo "x86-64-modern > common modern CPU, currently x86-64-sse41-popcnt"
670 @echo "x86-64-ssse3 > x86 64-bit with ssse3 support"
671 @echo "x86-64-sse3-popcnt > x86 64-bit with sse3 and popcnt support"
672 @echo "x86-64 > x86 64-bit generic (with sse2 support)"
673 @echo "x86-32-sse41-popcnt > x86 32-bit with sse41 and popcnt support"
674 @echo "x86-32-sse2 > x86 32-bit with sse2 support"
675 @echo "x86-32 > x86 32-bit generic (with mmx and sse support)"
676 @echo "ppc-64 > PPC 64-bit"
677 @echo "ppc-32 > PPC 32-bit"
678 @echo "armv7 > ARMv7 32-bit"
679 @echo "armv7-neon > ARMv7 32-bit with popcnt and neon"
680 @echo "armv8 > ARMv8 64-bit with popcnt and neon"
681 @echo "apple-silicon > Apple silicon ARM64"
682 @echo "general-64 > unspecified 64-bit"
683 @echo "general-32 > unspecified 32-bit"
685 @echo "Supported compilers:"
687 @echo "gcc > Gnu compiler (default)"
688 @echo "mingw > Gnu compiler with MinGW under Windows"
689 @echo "clang > LLVM Clang compiler"
690 @echo "icc > Intel compiler"
691 @echo "ndk > Google NDK to cross-compile for Android"
693 @echo "Simple examples. If you don't know what to do, you likely want to run: "
695 @echo "make -j build ARCH=x86-64 (A portable, slow compile for 64-bit systems)"
696 @echo "make -j build ARCH=x86-32 (A portable, slow compile for 32-bit systems)"
698 @echo "Advanced examples, for experienced users looking for performance: "
700 @echo "make help ARCH=x86-64-bmi2"
701 @echo "make -j profile-build ARCH=x86-64-bmi2 COMP=gcc COMPCXX=g++-9.0"
702 @echo "make -j build ARCH=x86-64-ssse3 COMP=clang"
704 @echo "-------------------------------"
705 ifeq ($(SUPPORTED_ARCH)$(help_skip_sanity), true)
706 @echo "The selected architecture $(ARCH) will enable the following configuration: "
707 @$(MAKE) ARCH=$(ARCH) COMP=$(COMP) config-sanity
709 @echo "Specify a supported architecture with the ARCH option for more details"
714 .PHONY: help build profile-build strip install clean net objclean profileclean \
715 config-sanity icc-profile-use icc-profile-make gcc-profile-use gcc-profile-make \
716 clang-profile-use clang-profile-make
718 build: net config-sanity
719 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) all
721 profile-build: net config-sanity objclean profileclean
723 @echo "Step 1/4. Building instrumented executable ..."
724 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_make)
726 @echo "Step 2/4. Running benchmark for pgo-build ..."
727 $(PGOBENCH) > /dev/null
729 @echo "Step 3/4. Building optimized executable ..."
730 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) objclean
731 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) $(profile_use)
733 @echo "Step 4/4. Deleting profile data ..."
734 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) profileclean
740 -mkdir -p -m 755 $(BINDIR)
742 -strip $(BINDIR)/$(EXE)
745 clean: objclean profileclean
746 @rm -f .depend *~ core
748 # evaluation network (nnue)
750 $(eval nnuenet := $(shell grep EvalFileDefaultName evaluate.h | grep define | sed 's/.*\(nn-[a-z0-9]\{12\}.nnue\).*/\1/'))
751 @echo "Default net: $(nnuenet)"
752 $(eval nnuedownloadurl := https://tests.stockfishchess.org/api/nn/$(nnuenet))
753 $(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))
754 @if test -f "$(nnuenet)"; then \
755 echo "Already available."; \
757 if [ "x$(curl_or_wget)" = "x" ]; then \
758 echo "Automatic download failed: neither curl nor wget is installed. Install one of these tools or download the net manually"; exit 1; \
760 echo "Downloading $(nnuedownloadurl)"; $(curl_or_wget) $(nnuedownloadurl) > $(nnuenet);\
763 $(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))
764 @if [ "x$(shasum_command)" != "x" ]; then \
765 if [ "$(nnuenet)" != "nn-"`$(shasum_command) $(nnuenet) | cut -c1-12`".nnue" ]; then \
766 echo "Failed download or $(nnuenet) corrupted, please delete!"; exit 1; \
769 echo "shasum / sha256sum not found, skipping net validation"; \
772 # clean binaries and objects
774 @rm -f $(EXE) *.o ./syzygy/*.o ./nnue/*.o ./nnue/features/*.o
776 # clean auxiliary profiling files
779 @rm -f bench.txt *.gcda *.gcno ./syzygy/*.gcda ./nnue/*.gcda ./nnue/features/*.gcda *.s
780 @rm -f stockfish.profdata *.profraw
785 ### ==========================================================================
786 ### Section 5. Private Targets
787 ### ==========================================================================
794 @echo "debug: '$(debug)'"
795 @echo "sanitize: '$(sanitize)'"
796 @echo "optimize: '$(optimize)'"
797 @echo "arch: '$(arch)'"
798 @echo "bits: '$(bits)'"
799 @echo "kernel: '$(KERNEL)'"
801 @echo "prefetch: '$(prefetch)'"
802 @echo "popcnt: '$(popcnt)'"
803 @echo "pext: '$(pext)'"
804 @echo "sse: '$(sse)'"
805 @echo "mmx: '$(mmx)'"
806 @echo "sse2: '$(sse2)'"
807 @echo "ssse3: '$(ssse3)'"
808 @echo "sse41: '$(sse41)'"
809 @echo "avx2: '$(avx2)'"
810 @echo "avx512: '$(avx512)'"
811 @echo "vnni256: '$(vnni256)'"
812 @echo "vnni512: '$(vnni512)'"
813 @echo "neon: '$(neon)'"
817 @echo "CXXFLAGS: $(CXXFLAGS)"
818 @echo "LDFLAGS: $(LDFLAGS)"
820 @echo "Testing config sanity. If this fails, try 'make help' ..."
822 @test "$(debug)" = "yes" || test "$(debug)" = "no"
823 @test "$(sanitize)" = "undefined" || test "$(sanitize)" = "thread" || test "$(sanitize)" = "address" || test "$(sanitize)" = "no"
824 @test "$(optimize)" = "yes" || test "$(optimize)" = "no"
825 @test "$(SUPPORTED_ARCH)" = "true"
826 @test "$(arch)" = "any" || test "$(arch)" = "x86_64" || test "$(arch)" = "i386" || \
827 test "$(arch)" = "ppc64" || test "$(arch)" = "ppc" || \
828 test "$(arch)" = "armv7" || test "$(arch)" = "armv8" || test "$(arch)" = "arm64"
829 @test "$(bits)" = "32" || test "$(bits)" = "64"
830 @test "$(prefetch)" = "yes" || test "$(prefetch)" = "no"
831 @test "$(popcnt)" = "yes" || test "$(popcnt)" = "no"
832 @test "$(pext)" = "yes" || test "$(pext)" = "no"
833 @test "$(sse)" = "yes" || test "$(sse)" = "no"
834 @test "$(mmx)" = "yes" || test "$(mmx)" = "no"
835 @test "$(sse2)" = "yes" || test "$(sse2)" = "no"
836 @test "$(ssse3)" = "yes" || test "$(ssse3)" = "no"
837 @test "$(sse41)" = "yes" || test "$(sse41)" = "no"
838 @test "$(avx2)" = "yes" || test "$(avx2)" = "no"
839 @test "$(avx512)" = "yes" || test "$(avx512)" = "no"
840 @test "$(vnni256)" = "yes" || test "$(vnni256)" = "no"
841 @test "$(vnni512)" = "yes" || test "$(vnni512)" = "no"
842 @test "$(neon)" = "yes" || test "$(neon)" = "no"
843 @test "$(comp)" = "gcc" || test "$(comp)" = "icc" || test "$(comp)" = "mingw" || test "$(comp)" = "clang" \
844 || test "$(comp)" = "armv7a-linux-androideabi16-clang" || test "$(comp)" = "aarch64-linux-android21-clang"
847 +$(CXX) -o $@ $(OBJS) $(LDFLAGS)
850 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
851 EXTRACXXFLAGS='-fprofile-instr-generate ' \
852 EXTRALDFLAGS=' -fprofile-instr-generate' \
856 $(XCRUN) llvm-profdata merge -output=stockfish.profdata *.profraw
857 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
858 EXTRACXXFLAGS='-fprofile-instr-use=stockfish.profdata' \
859 EXTRALDFLAGS='-fprofile-use ' \
863 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
864 EXTRACXXFLAGS='-fprofile-generate' \
865 EXTRALDFLAGS='-lgcov' \
869 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
870 EXTRACXXFLAGS='-fprofile-use -fno-peel-loops -fno-tracer' \
871 EXTRALDFLAGS='-lgcov' \
876 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
877 EXTRACXXFLAGS='-prof-gen=srcpos -prof_dir ./profdir' \
881 $(MAKE) ARCH=$(ARCH) COMP=$(COMP) \
882 EXTRACXXFLAGS='-prof_use -prof_dir ./profdir' \
886 -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null