1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2014 Intel Corporation
7 # - can define ARCH variable (overridden by cmdline value)
8 # - can define CROSS variable (overridden by cmdline value)
9 # - define MACHINE_CFLAGS variable (overridden by cmdline value)
10 # - define MACHINE_LDFLAGS variable (overridden by cmdline value)
11 # - define MACHINE_ASFLAGS variable (overridden by cmdline value)
12 # - can define CPU_CFLAGS variable (overridden by cmdline value) that
13 # overrides the one defined in arch.
14 # - can define CPU_LDFLAGS variable (overridden by cmdline value) that
15 # overrides the one defined in arch.
16 # - can define CPU_ASFLAGS variable (overridden by cmdline value) that
17 # overrides the one defined in arch.
18 # - may override any previously defined variable
30 MACHINE_CFLAGS = -march=native
32 # On FreeBSD systems, sometimes the correct CPU type is not picked up.
33 # To get everything to compile, we need SSE4.2 support, so check if that is
34 # reported by compiler. If not, check if the CPU actually supports it, and if
35 # so, set the compilation target to be a corei7, minimum target with SSE4.2.
36 SSE42_SUPPORT=$(shell $(CC) -march=native -dM -E - </dev/null | grep SSE4_2)
37 ifeq ($(SSE42_SUPPORT),)
38 MACHINE_CFLAGS = -march=corei7