1#
2# TFLM Makefile
3#
4# This file is automatically included by default.
5# Please add USE_TFLM=true and TFLM=path_to_tflm to enable TFLM.
6
7ifeq ($(USE_TFLM),true)
8
9# Environment Checks ###########################################################
10
11ifeq ($(TFLM_PATH),)
12$(error "TFLM_PATH is empty. You must supply a TFLM_PATH environment \
13         variable containing a path to the TFLM library. Example: \
14         export TFLM_PATH=$$(CHRE_PREFIX)/external/tflm/latest")
15endif
16
17ifeq ($(HEXAGON_SDK_PREFIX),)
18$(error "You must set HEXAGON_SDK_PREFIX, e.g. export \
19         HEXAGON_SDK_PREFIX=~/chre-sdk/vendor/qcom/tools/Qualcomm/Hexagon_SDK/latest")
20endif
21
22# TFLM Source Files ############################################################
23
24TFLM_SRCS = $(shell find $(TFLM_PATH) \( -name '*.cc' -o -name '*.c' \))
25
26ifeq ($(TFLM_SRCS),)
27$(error "Your $$TFLM_PATH is empty. Please download the latest TFLM using \
28         external/tflm/tflm_sync_srcs.sh")
29endif
30
31COMMON_SRCS += TFLM_SRCS
32
33# TFLM Required flags ##########################################################
34
35COMMON_CFLAGS += -I$(TFLM_PATH)
36COMMON_CFLAGS += -I$(TFLM_PATH)/third_party
37COMMON_CFLAGS += -I$(TFLM_PATH)/third_party/flatbuffers/include
38COMMON_CFLAGS += -I$(TFLM_PATH)/third_party/gemmlowp
39
40# TFLM uses <complex> which requires including several SDK headers
41COMMON_CFLAGS += -I$(HEXAGON_SDK_PREFIX)/libs/common/qurt/latest/include/posix
42COMMON_CFLAGS += -I$(HEXAGON_SDK_PREFIX)/libs/common/qurt/latest/include/qurt
43
44COMMON_CFLAGS += -DTF_LITE_STATIC_MEMORY
45
46endif