1# Settings for apollo3 evb platforms.
2ifeq ($(TARGET), apollo3evb)
3
4  PUSHBUTTON_MICRO_SPEECH_TEST_SRCS := \
5    $(AP3_MICRO_DIR)/../preprocessor.cc \
6    $(AP3_MICRO_DIR)/pushbutton_main.c \
7    $(AP3_MICRO_DIR)/pushbutton_test.cc \
8    $(AP3_MICRO_DIR)/../simple_features/tiny_conv_simple_features_model_data.cc \
9    $(APOLLO3_SDK)/devices/am_devices_led.c
10  ALL_SRCS += $(PUSHBUTTON_MICRO_SPEECH_TEST_SRCS)
11  PUSHBUTTON_MICRO_SPEECH_TEST_OBJS := $(addprefix $(CORE_OBJDIR), \
12    $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(PUSHBUTTON_MICRO_SPEECH_TEST_SRCS))))
13  PUSHBUTTON_MICRO_SPEECH_TEST_BINARY := $(BINDIR)pushbutton_micro_speech_test
14  $(PUSHBUTTON_MICRO_SPEECH_TEST_BINARY): $(PUSHBUTTON_MICRO_SPEECH_TEST_OBJS) $(MICROLITE_LIB_PATH)
15	@mkdir -p $(dir $@)
16	$(CXX) $(CXXFLAGS) $(INCLUDES) \
17	-o $(PUSHBUTTON_MICRO_SPEECH_TEST_BINARY) $(PUSHBUTTON_MICRO_SPEECH_TEST_OBJS) \
18	$(MICROLITE_LIB_PATH) $(LDFLAGS) $(MICROLITE_LIBS)
19  pushbutton_micro_speech_test: $(PUSHBUTTON_MICRO_SPEECH_TEST_BINARY)
20  pushbutton_micro_speech_test_bin: $(PUSHBUTTON_MICRO_SPEECH_TEST_BINARY).bin
21  test_pushbutton_micro_speech: $(PUSHBUTTON_MICRO_SPEECH_TEST_BINARY)
22	$(TEST_SCRIPT) $(PUSHBUTTON_MICRO_SPEECH_TEST_BINARY) '~~~ALL TESTS PASSED~~~'
23
24  PUSHBUTTON_CMSIS_SPEECH_TEST_SRCS := \
25    $(AP3_MICRO_DIR)/pushbutton_main.c \
26    $(AP3_MICRO_DIR)/pushbutton_test.cc \
27    $(AP3_MICRO_DIR)/../simple_features/tiny_conv_simple_features_model_data.cc \
28    $(CMSIS_DIR)/simple_features_generator.cc \
29    $(CMSIS_EXT_DIR)/arm_cmplx_mag_squared_q10p6.c \
30    $(CMSIS_DIR)/hanning.c \
31    $(APOLLO3_SDK)/devices/am_devices_led.c \
32    $(CMSIS_SRCS)
33  ALL_SRCS += $(PUSHBUTTON_CMSIS_SPEECH_TEST_SRCS)
34  PUSHBUTTON_CMSIS_SPEECH_TEST_OBJS := $(addprefix $(CORE_OBJDIR), \
35    $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(PUSHBUTTON_CMSIS_SPEECH_TEST_SRCS))) \
36    arm_bitreversal2.o)
37  PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY := $(BINDIR)pushbutton_cmsis_speech_test
38  $(PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY): $(PUSHBUTTON_CMSIS_SPEECH_TEST_OBJS) $(MICROLITE_LIB_PATH)
39	@mkdir -p $(dir $@)
40	$(CXX) $(CXXFLAGS) $(INCLUDES) \
41	-o $(PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY) $(PUSHBUTTON_CMSIS_SPEECH_TEST_OBJS) \
42	$(MICROLITE_LIB_PATH) $(LDFLAGS) $(MICROLITE_LIBS)
43  pushbutton_cmsis_speech_test: $(PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY)
44  pushbutton_cmsis_speech_test_bin: $(PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY).bin
45  test_pushbutton_cmsis_speech: $(PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY)
46	$(TEST_SCRIPT) $(PUSHBUTTON_CMSIS_SPEECH_TEST_BINARY) '~~~ALL TESTS PASSED~~~'
47
48  PREPROCESSOR_1K_SRCS := \
49    tensorflow/lite/micro/examples/micro_speech/apollo3/preprocessor_1k.cc \
50    tensorflow/lite/micro/examples/micro_speech/CMSIS/sin_1k.cc
51
52  PREPROCESSOR_1K_MICRO_TEST_SRCS := \
53    $(PREPROCESSOR_1K_SRCS) \
54    $(AP3_MICRO_DIR)/../fixed_point/preprocessor.cc \
55    $(AP3_EXT_MICRO_DIR)/system_apollo3.c \
56    $(AP3_MICRO_DIR)/_main.c
57  ALL_SRCS += $(PREPROCESSOR_1K_MICRO_TEST_SRCS)
58  PREPROCESSOR_1K_MICRO_TEST_OBJS := $(addprefix $(CORE_OBJDIR), \
59    $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(PREPROCESSOR_1K_MICRO_TEST_SRCS))))
60  PREPROCESSOR_1K_MICRO_TEST_BINARY := $(BINDIR)preprocessor_1k_micro_test
61  $(PREPROCESSOR_1K_MICRO_TEST_BINARY): $(PREPROCESSOR_1K_MICRO_TEST_OBJS) $(MICROLITE_LIB_PATH)
62	@mkdir -p $(dir $@)
63	$(CXX) $(CXXFLAGS) $(INCLUDES) \
64	-o $(PREPROCESSOR_1K_MICRO_TEST_BINARY) $(PREPROCESSOR_1K_MICRO_TEST_OBJS) \
65	$(MICROLITE_LIB_PATH) $(LDFLAGS) $(MICROLITE_LIBS)
66  preprocessor_1k_micro_test: $(PREPROCESSOR_1K_MICRO_TEST_BINARY)
67  preprocessor_1k_micro_test_bin: $(PREPROCESSOR_1K_MICRO_TEST_BINARY).bin
68  test_preprocessor_1k_micro: $(PREPROCESSOR_1K_MICRO_TEST_BINARY)
69	$(TEST_SCRIPT) $(PREPROCESSOR_1K_MICRO_TEST_BINARY) '~~~ALL TESTS PASSED~~~'
70
71  PREPROCESSOR_1K_CMSIS_TEST_SRCS := \
72    $(PREPROCESSOR_1K_SRCS) \
73    $(CMSIS_DIR)/preprocessor.cc \
74    $(CMSIS_EXT_DIR)/arm_cmplx_mag_squared_q10p6.c \
75    $(CMSIS_DIR)/hanning.c \
76    $(AP3_EXT_MICRO_DIR)/system_apollo3.c \
77    $(AP3_MICRO_DIR)/_main.c \
78    $(CMSIS_SRCS)
79  ALL_SRCS += $(PREPROCESSOR_1K_CMSIS_TEST_SRCS)
80  PREPROCESSOR_1K_CMSIS_TEST_BINARY := $(BINDIR)preprocessor_1k_cmsis_test
81  PREPROCESSOR_1K_CMSIS_TEST_OBJS := $(addprefix $(CORE_OBJDIR), \
82    $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(PREPROCESSOR_1K_CMSIS_TEST_SRCS)))\
83    arm_bitreversal2.o)
84  $(PREPROCESSOR_1K_CMSIS_TEST_BINARY): $(PREPROCESSOR_1K_CMSIS_TEST_OBJS) $(MICROLITE_LIB_PATH)
85	@mkdir -p $(dir $@)
86	$(CXX) $(CXXFLAGS) $(INCLUDES) \
87	-o $(PREPROCESSOR_1K_CMSIS_TEST_BINARY) $(PREPROCESSOR_1K_CMSIS_TEST_OBJS) \
88	$(MICROLITE_LIB_PATH) $(LDFLAGS) $(MICROLITE_LIBS)
89  preprocessor_1k_cmsis_test: $(PREPROCESSOR_1K_CMSIS_TEST_BINARY)
90  preprocessor_1k_cmsis_test_bin: $(PREPROCESSOR_1K_CMSIS_TEST_BINARY).bin
91  test_preprocessor_1k_cmsis: $(PREPROCESSOR_1K_CMSIS_TEST_BINARY)
92	$(TEST_SCRIPT) $(PREPROCESSOR_1K_CMSIS_TEST_BINARY) '~~~ALL TESTS PASSED~~~'
93
94  PREPROCESSOR_TEST_SRCS += \
95    $(AP3_MICRO_DIR)/_main.c
96
97  $(CORE_OBJDIR)arm_bitreversal2.o:
98	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $(CMSIS_SRC_DIR)/TransformFunctions/arm_bitreversal2.S -o $(CORE_OBJDIR)arm_bitreversal2.o
99
100endif
101