forked from Nuclei-Software/npk-tflm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.mk
executable file
·76 lines (65 loc) · 2.05 KB
/
build.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
MIDDLEWARE_TFLM := $(NUCLEI_SDK_MIDDLEWARE)/tflm
TFLM_THIRD_PARTY := $(MIDDLEWARE_TFLM)/third_party
INCDIRS += $(MIDDLEWARE_TFLM) \
$(TFLM_THIRD_PARTY)/gemmlowp \
$(TFLM_THIRD_PARTY)/flatbuffers/include \
$(TFLM_THIRD_PARTY)/ruy \
$(TFLM_THIRD_PARTY)/kissfft
CXX_SRCDIRS += $(MIDDLEWARE_TFLM)/tensorflow/lite/core/api \
$(MIDDLEWARE_TFLM)/tensorflow/lite/core/c \
$(MIDDLEWARE_TFLM)/tensorflow/lite/experimental/microfrontend/lib \
$(MIDDLEWARE_TFLM)/tensorflow/lite/schema \
$(MIDDLEWARE_TFLM)/tensorflow/lite/kernels \
$(MIDDLEWARE_TFLM)/tensorflow/lite/kernels/internal \
$(MIDDLEWARE_TFLM)/tensorflow/lite/kernels/internal/reference \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro/models \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro/arena_allocator \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro/tflite_bridge \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro/kernels \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro/kernels/nmsis_nn \
$(MIDDLEWARE_TFLM)/tensorflow/lite/micro/memory_planner
C_SRCDIRS += $(MIDDLEWARE_TFLM)/tensorflow/lite/experimental/microfrontend/lib \
$(TFLM_THIRD_PARTY)/kissfft \
$(wildcard $(TFLM_THIRD_PARTY)/kissfft/*/)
ADDITIONAL_DEFINES := \
-DNMSIS_NN \
-DTF_LITE_USE_GLOBAL_MIN \
-DTF_LITE_USE_GLOBAL_MAX \
-DTF_LITE_MCU_DEBUG_LOG \
-DTF_LITE_USE_GLOBAL_CMATH_FUNCTIONS \
-D_DEFAULT_SOURCE
CC_WARNINGS := \
-Wsign-compare \
-Wdouble-promotion \
-Wshadow \
-Wunused-variable \
-Wunused-function \
-Wswitch \
-Wvla \
-Wall \
-Wextra \
-Wmissing-field-initializers \
-Wstrict-aliasing \
-Wno-unused-parameter
TFLM_COMMON_FLAGS = \
-mexplicit-relocs \
-fno-builtin-printf \
-fno-exceptions \
-fno-unwind-tables \
-funsigned-char \
-Wno-write-strings \
-fno-delete-null-pointer-checks \
-fomit-frame-pointer \
$(ADDITIONAL_DEFINES) \
$(CC_WARNINGS)
CXXFLAGS += $(TFLM_COMMON_FLAGS) \
-std=gnu++11 \
-fno-rtti \
-fno-threadsafe-statics \
-fno-use-cxa-atexit \
-fpermissive
CFLAGS += $(TFLM_COMMON_FLAGS)
LDFLAGS += \
-lstdc++ \
-lm