To compile stockfish, type: 

make -j target [ARCH=arch] [COMP=compiler] [COMPCXX=cxx]

Supported targets:

help                    > Display architecture details
profile-build           > standard build with profile-guided optimization
build                   > skip profile-guided optimization
net                     > Download the default nnue nets
strip                   > Strip executable
install                 > Install executable
clean                   > Clean up

Supported archs:

native                  > select the best architecture for the host processor (default)
x86-64-vnni512          > x86 64-bit with vnni 512bit support
x86-64-vnni256          > x86 64-bit with vnni 512bit support, limit operands to 256bit wide
x86-64-avx512           > x86 64-bit with avx512 support
x86-64-avxvnni          > x86 64-bit with vnni 256bit support
x86-64-bmi2             > x86 64-bit with bmi2 support
x86-64-avx2             > x86 64-bit with avx2 support
x86-64-sse41-popcnt     > x86 64-bit with sse41 and popcnt support
x86-64-modern           > deprecated, currently x86-64-sse41-popcnt
x86-64-ssse3            > x86 64-bit with ssse3 support
x86-64-sse3-popcnt      > x86 64-bit with sse3 compile and popcnt support
x86-64                  > x86 64-bit generic (with sse2 support)
x86-32-sse41-popcnt     > x86 32-bit with sse41 and popcnt support
x86-32-sse2             > x86 32-bit with sse2 support
x86-32                  > x86 32-bit generic (with mmx compile support)
ppc-64                  > PPC 64-bit
ppc-32                  > PPC 32-bit
armv7                   > ARMv7 32-bit
armv7-neon              > ARMv7 32-bit with popcnt and neon
armv8                   > ARMv8 64-bit with popcnt and neon
armv8-dotprod           > ARMv8 64-bit with popcnt, neon and dot product support
e2k                     > Elbrus 2000
apple-silicon           > Apple silicon ARM64
general-64              > unspecified 64-bit
general-32              > unspecified 32-bit
riscv64                 > RISC-V 64-bit
loongarch64             > LoongArch 64-bit

Supported compilers:

gcc                     > GNU compiler (default)
mingw                   > GNU compiler with MinGW under Windows
clang                   > LLVM Clang compiler
icx                     > Intel oneAPI DPC++/C++ Compiler
ndk                     > Google NDK to cross-compile for Android

Simple examples. If you don't know what to do, you likely want to run one of: 

make -j profile-build ARCH=x86-64-avx2    # typically a fast compile for common systems 
make -j profile-build ARCH=x86-64-sse41-popcnt  # A more portable compile for 64-bit systems 
make -j profile-build ARCH=x86-64         # A portable compile for 64-bit systems 

Advanced examples, for experienced users: 

make -j profile-build ARCH=x86-64-avxvnni
make -j profile-build ARCH=x86-64-avxvnni COMP=gcc COMPCXX=g++-12.0
make -j build ARCH=x86-64-ssse3 COMP=clang