1# Enable u-arch specfic behaviours 2ifneq (,$(filter $(TARGET_ARCH), x86_64)) 3 # CMSIS-NN optimizations not supported 4endif 5 6ifneq ($(DISABLE_DOWNLOADS), true) 7 # Unless an external path is provided we force a download during the first 8 # phase of make. 9 CMSIS_DEFAULT_DOWNLOAD_PATH := $(MAKEFILE_DIR)/downloads/cmsis 10 CMSIS_PATH := $(CMSIS_DEFAULT_DOWNLOAD_PATH) 11 ifeq ($(CMSIS_PATH), $(CMSIS_DEFAULT_DOWNLOAD_PATH)) 12 DOWNLOAD_RESULT := $(shell $(MAKEFILE_DIR)/ext_libs/cmsis_download.sh ${MAKEFILE_DIR}/downloads) 13 ifneq ($(DOWNLOAD_RESULT), SUCCESS) 14 $(error Something went wrong with the CMSIS download: $(DOWNLOAD_RESULT)) 15 endif 16 endif 17endif 18 19THIRD_PARTY_CC_SRCS += \ 20 $(call recursive_find,$(CMSIS_PATH)/CMSIS/NN/Source,*.c) 21THIRD_PARTY_CC_HDRS += \ 22 $(call recursive_find,$(CMSIS_PATH)/CMSIS/NN/Include,*.h) 23THIRD_PARTY_CC_HDRS += \ 24 $(CMSIS_PATH)/CMSIS/Core/Include/cmsis_compiler.h \ 25 $(CMSIS_PATH)/CMSIS/DSP/Include/arm_common_tables.h \ 26 $(CMSIS_PATH)/CMSIS/DSP/Include/arm_helium_utils.h \ 27 $(CMSIS_PATH)/CMSIS/DSP/Include/arm_math.h \ 28 $(CMSIS_PATH)/CMSIS/DSP/Include/arm_math_memory.h \ 29 $(CMSIS_PATH)/CMSIS/DSP/Include/arm_math_types.h \ 30 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/basic_math_functions.h \ 31 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/bayes_functions.h \ 32 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/complex_math_functions.h \ 33 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/controller_functions.h \ 34 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/distance_functions.h \ 35 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/fast_math_functions.h \ 36 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/filtering_functions.h \ 37 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/interpolation_functions.h \ 38 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/matrix_functions.h \ 39 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/none.h \ 40 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/statistics_functions.h \ 41 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/support_functions.h \ 42 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/svm_defines.h \ 43 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/svm_functions.h \ 44 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/transform_functions.h \ 45 $(CMSIS_PATH)/CMSIS/DSP/Include/dsp/utils.h 46 47# We add -I$(CMSIS_PATH) to enable the code in the TFLM repo (mostly in the 48# tensorflow/lite/micro/kernels/cmsis_nn) to use include paths relative to 49# the CMSIS code-base. 50# 51# The CMSIS code itself uses includes such as #include "arm_math.h" and so 52# we add $(CMSIS_PATH)/CMSIS/Core/Include etc. to be able to build the CMSIS 53# code without any modifications. 54INCLUDES += \ 55 -I$(CMSIS_PATH) \ 56 -I$(CMSIS_PATH)/CMSIS/Core/Include \ 57 -I$(CMSIS_PATH)/CMSIS/DSP/Include \ 58 -I$(CMSIS_PATH)/CMSIS/NN/Include 59