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
17# TFLM Source Files ############################################################
18
19TFLM_SRCS = $(shell find $(TFLM_PATH) \( -name '*.cc' -o -name '*.c' \))
20
21ifeq ($(TFLM_SRCS),)
22$(error "Your $$TFLM_PATH is empty. Please download the latest TFLM using \
23         external/tflm/tflm_sync_srcs.sh")
24endif
25
26COMMON_SRCS += TFLM_SRCS
27
28# TFLM Required flags ##########################################################
29
30COMMON_CFLAGS += -I$(TFLM_PATH)
31COMMON_CFLAGS += -I$(TFLM_PATH)/third_party
32COMMON_CFLAGS += -I$(TFLM_PATH)/third_party/flatbuffers/include
33COMMON_CFLAGS += -I$(TFLM_PATH)/third_party/gemmlowp
34
35# TFLM uses <complex> which requires including several SDK headers
36ifneq ($(HEXAGON_SDK_PREFIX),)
37HEXAGON_CFLAGS += -I$(HEXAGON_SDK_PREFIX)/libs/qurt/latest/include/posix
38HEXAGON_CFLAGS += -I$(HEXAGON_SDK_PREFIX)/libs/qurt/latest/include/qurt
39endif
40
41COMMON_CFLAGS += -DTF_LITE_STATIC_MEMORY
42
43endif
44