Skip to content

Instantly share code, notes, and snippets.

@Grommish
Created February 18, 2022 19:11
Show Gist options
  • Save Grommish/48bf3c45d519f7454919f3109823d45c to your computer and use it in GitHub Desktop.
Save Grommish/48bf3c45d519f7454919f3109823d45c to your computer and use it in GitHub Desktop.
ifeq ($(CONFIG_ARCH), "arm")
ifeq ($(CONFIG_arm_v7), y)
ARCH=armv7
endif
# Default to musleabi
RUST_TARGET_SUFFIX:="musleabi"
ifneq ($(filter fpu, $(FEATURES)),)
RUST_TARGET_SUFFIX:="musleabihf"
endif
# If the CPU_TYPE contains neon/vfp flags, set hf
ifeq ($(CONFIG_CPU_TYPE), $(filter vfp%, $(CONFIG_CPU_TYPE)))
RUST_TARGET_SUFFIX:="musleabihf"
endif
ifeq ($(CONFIG_CPU_TYPE), $(filter neon%, $(CONFIG_CPU_TYPE)))
RUST_TARGET_SUFFIX:="musleabihf"
endif
# Figure out if CPU_SUBTYPE is a thing, then filter by hf
ifneq ($(CONFIG_CPU_SUBTYPE),)
ifeq ($(CONFIG_CPU_SUBTYPE), $(filter vfp%, $(CONFIG_CPU_SUBTYPE)))
RUST_TARGET_SUFFIX:="musleabihf"
endif
ifeq ($(CONFIG_CPU_SUBTYPE), $(filter neon%, $(CONFIG_CPU_SUBTYPE)))
RUST_TARGET_SUFFIX:="musleabihf"
endif
endif
endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment