# Get or detect compilation architecture. # clang on MACOS does not support -print-multiarch ifeq ($(shell uname),Darwin) PRINT_MULTIARCH = else PRINT_MULTIARCH = -print-multiarch endif # Detect target architecture ifeq '$(CCARCH)' '' CCARCH:=$(shell $(CLEAN_ENV) $(CC) $(CFLAGS_ARCHITECTURE_VARIANT) $(FLAGS_ARCHITECTURE_VARIANT) $(PRINT_MULTIARCH)) ifeq '$(CCARCH)' '' CCARCH:=$(shell $(CLEAN_ENV) $(CC) -v 2>&1 | sed -n '/Target: / s/// p') ifeq '$(CCARCH)' '' # Could not obtain target triplet: Try still -dumpmachine (supported by # some versions of GCC) CCARCH:=$(shell $(CLEAN_ENV) $(CC) -dumpmachine) ARM_ARCH ?= armv7-a ifeq '$(CCARCH)' '' $(error Unable to determine compiler architecture.) $(CC) $(CFLAGS_ARCHITECTURE_VARIANT) $(FLAGS_ARCHITECTURE_VARIANT) $(PRINT_MULTIARCH) or $(CC) -v or $(CC) -dumpmachine does not work. Please, provide CCARCH manually via an environment variable.) endif endif endif ifeq '$(CCARCH_PRINTED)' '' ifeq ($(origin CCARCH),file) ifneq ($(MAKECMDGOALS),clean) ifneq ($(MAKECMDGOALS),clobber) ifneq ($(MAKECMDGOALS),get-CCARCH) ifneq ($(MAKECMDGOALS),print-CCARCH) $(info Compiling target architecture: $(CCARCH)) $(info If this is incorrect, provide the CCARCH variable manually to make.) CCARCH_PRINTED=1 export CCARCH_PRINTED endif endif endif endif endif endif endif CPU_GUESS=1 CPU_BITS=32 ifneq (,$(findstring x86_64-,$(CCARCH))) CPU_ARCHITECTURE_FAMILY=x86 CPU_BITS=64 CPU_GUESS= endif ifneq (,$(findstring i686-,$(CCARCH))) CPU_ARCHITECTURE_FAMILY=x86 CPU_GUESS= endif ifneq (,$(findstring i586-,$(CCARCH))) CPU_ARCHITECTURE_FAMILY=x86 CPU_GUESS= endif ifneq (,$(findstring i486-,$(CCARCH))) CPU_ARCHITECTURE_FAMILY=x86 CPU_GUESS= endif ifneq (,$(findstring i386-,$(CCARCH))) CPU_ARCHITECTURE_FAMILY=x86 CPU_GUESS= endif ifneq (,$(findstring arm,$(CCARCH))) CPPFLAGS_EXTRACT_MACROS=-dM NEON=$(shell $(CC) $(CPPFLAGS_EXTRACT_MACROS) -E -