1ifndef NANOAPP_NAME
2$(error NANOAPP_NAME unset)
3endif
4
5ifndef NANOAPP_SRC_FILES
6$(error NANOAPP_SRC_FILES unset)
7endif
8
9ifndef ANDROID_BUILD_TOP
10$(error Must set Android build environment first)
11endif
12
13NANOAPP_DIR_NAME ?= $(NANOAPP_NAME)
14
15# This path is actually relative to one level deeper as this file
16# gets included from Makefile of each test subdirectory
17NANOAPP_SRC_PATH = ../../src
18CHRE_ROOT_PATH = ../../../..
19
20SHARED_LIB_FILES = abort.cc \
21  chunk_allocator.cc \
22  nano_endian.cc \
23  nano_string.cc \
24  send_message.cc \
25  test_success_marker.cc
26
27COMMON_SRCS += \
28  $(addprefix $(NANOAPP_SRC_PATH)/$(NANOAPP_DIR_NAME)/, $(NANOAPP_SRC_FILES)) \
29  $(addprefix $(NANOAPP_SRC_PATH)/shared/, $(SHARED_LIB_FILES))
30
31# Add util srcs since they may be included by the tests
32COMMON_SRCS += $(CHRE_PREFIX)/util/buffer_base.cc
33COMMON_SRCS += $(CHRE_PREFIX)/util/dynamic_vector_base.cc
34
35COMMON_CFLAGS += -DCHRE_NO_ENDIAN_H \
36  -D__LITTLE_ENDIAN=1 \
37  -D__BYTE_ORDER=1 \
38  -D__BIG_ENDIAN=2
39
40COMMON_CFLAGS += -I$(NANOAPP_SRC_PATH)
41COMMON_CFLAGS += -I$(CHRE_ROOT_PATH)/util/include
42
43OPT_LEVEL=2
44
45# Permission declarations ######################################################
46
47CHRE_NANOAPP_USES_AUDIO = true
48CHRE_NANOAPP_USES_GNSS = true
49CHRE_NANOAPP_USES_WIFI = true
50CHRE_NANOAPP_USES_WWAN = true
51
52include ${ANDROID_BUILD_TOP}/system/chre/build/nanoapp/app.mk
53