blob: e69514c23405672a9e19136c0a8a357ebb90c322 [file] [log] [blame]
telsoa015307bc12018-03-09 13:51:08 +00001#
2# Copyright © 2017 ARM Ltd. All rights reserved.
3# See LICENSE file in the project root for full license information.
4#
5
6ANDROID_NN_DRIVER_LOCAL_PATH := $(call my-dir)
7LOCAL_PATH := $(ANDROID_NN_DRIVER_LOCAL_PATH)
8
9# Configure these paths if you move the source or Khronos headers
surmeh01deb3bdb2018-07-05 12:06:04 +010010ARMNN_HEADER_PATH := $(LOCAL_PATH)/armnn/include
11ARMNN_UTILS_HEADER_PATH := $(LOCAL_PATH)/armnn/src/armnnUtils
surmeh0149b9e102018-05-17 14:11:25 +010012OPENCL_HEADER_PATH := $(LOCAL_PATH)/clframework/include
telsoa015307bc12018-03-09 13:51:08 +000013NN_HEADER_PATH := $(LOCAL_PATH)/../../../frameworks/ml/nn/runtime/include
14
15###################
16# libarmnn-driver #
17###################
18include $(CLEAR_VARS)
19
20LOCAL_MODULE := libarmnn-driver
21LOCAL_MODULE_TAGS := eng optional
22LOCAL_ARM_MODE := arm
surmeh0149b9e102018-05-17 14:11:25 +010023LOCAL_PROPRIETARY_MODULE := true
telsoa015307bc12018-03-09 13:51:08 +000024# Mark source files as dependent on Android.mk
25LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
26
surmeh01deb3bdb2018-07-05 12:06:04 +010027LOCAL_C_INCLUDES := \
28 $(ARMNN_HEADER_PATH) \
29 $(ARMNN_UTILS_HEADER_PATH) \
telsoa015307bc12018-03-09 13:51:08 +000030 $(OPENCL_HEADER_PATH) \
31 $(NN_HEADER_PATH)
32
33LOCAL_CFLAGS := \
34 -std=c++14 \
35 -fexceptions \
36 -Werror \
37 -Wno-format-security
surmeh01deb3bdb2018-07-05 12:06:04 +010038ifeq ($(PLATFORM_VERSION),9)
39# Required to build with the changes made to the Android ML framework starting from Android P,
40# regardless of the HAL version used for the build.
41LOCAL_CFLAGS+= \
42 -DARMNN_ANDROID_P
43endif
telsoa015307bc12018-03-09 13:51:08 +000044ifeq ($(ARMNN_DRIVER_DEBUG),1)
45 LOCAL_CFLAGS+= -UNDEBUG
46endif
47
surmeh01deb3bdb2018-07-05 12:06:04 +010048LOCAL_SRC_FILES := \
telsoa015307bc12018-03-09 13:51:08 +000049 ArmnnDriver.cpp \
50 ArmnnPreparedModel.cpp \
51 ModelToINetworkConverter.cpp \
52 RequestThread.cpp \
53 Utils.cpp
54
55LOCAL_STATIC_LIBRARIES := \
56 libneuralnetworks_common \
57 libarmnn \
58 libboost_log \
59 libboost_program_options \
60 libboost_system \
61 libboost_thread \
surmeh01deb3bdb2018-07-05 12:06:04 +010062 armnn-arm_compute
telsoa015307bc12018-03-09 13:51:08 +000063
surmeh01deb3bdb2018-07-05 12:06:04 +010064LOCAL_SHARED_LIBRARIES := \
telsoa015307bc12018-03-09 13:51:08 +000065 libbase \
66 libhidlbase \
67 libhidltransport \
68 libhidlmemory \
69 liblog \
70 libutils \
71 android.hardware.neuralnetworks@1.0 \
72 android.hidl.allocator@1.0 \
73 android.hidl.memory@1.0 \
74 libOpenCL
surmeh01deb3bdb2018-07-05 12:06:04 +010075ifeq ($(PLATFORM_VERSION),9)
76# Required to build the 1.0 version of the NN Driver on Android P and later versions,
77# as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless.
78LOCAL_SHARED_LIBRARIES+= \
79 android.hardware.neuralnetworks@1.1
80endif
telsoa015307bc12018-03-09 13:51:08 +000081
82include $(BUILD_STATIC_LIBRARY)
83
84#####################################################
85# android.hardware.neuralnetworks@1.0-service-armnn #
86#####################################################
87include $(CLEAR_VARS)
88
89LOCAL_MODULE := android.hardware.neuralnetworks@1.0-service-armnn
90LOCAL_INIT_RC := android.hardware.neuralnetworks@1.0-service-armnn.rc
91LOCAL_MODULE_TAGS := eng optional
92LOCAL_ARM_MODE := arm
93LOCAL_MODULE_RELATIVE_PATH := hw
94LOCAL_PROPRIETARY_MODULE := true
95# Mark source files as dependent on Android.mk
96LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
97
98LOCAL_C_INCLUDES := \
surmeh01deb3bdb2018-07-05 12:06:04 +010099 $(ARMNN_HEADER_PATH) \
telsoa015307bc12018-03-09 13:51:08 +0000100 $(NN_HEADER_PATH)
101
102LOCAL_CFLAGS := \
103 -std=c++14 \
104 -fexceptions
105ifeq ($(ARMNN_DRIVER_DEBUG),1)
106 LOCAL_CFLAGS+= -UNDEBUG
107endif
108
surmeh01deb3bdb2018-07-05 12:06:04 +0100109LOCAL_SRC_FILES := \
telsoa015307bc12018-03-09 13:51:08 +0000110 service.cpp
111
112LOCAL_STATIC_LIBRARIES := \
113 libarmnn-driver \
114 libneuralnetworks_common \
115 libarmnn \
116 libboost_log \
117 libboost_program_options \
118 libboost_system \
119 libboost_thread \
120 armnn-arm_compute
surmeh01deb3bdb2018-07-05 12:06:04 +0100121ifeq ($(PLATFORM_VERSION),9)
122# Required to build the 1.0 version of the NN Driver on Android P and later versions.
123LOCAL_STATIC_LIBRARIES+= \
124 libomp
125endif
telsoa015307bc12018-03-09 13:51:08 +0000126
surmeh01deb3bdb2018-07-05 12:06:04 +0100127LOCAL_SHARED_LIBRARIES := \
telsoa015307bc12018-03-09 13:51:08 +0000128 libbase \
129 libhidlbase \
130 libhidltransport \
131 libhidlmemory \
132 libdl \
133 libhardware \
telsoa015307bc12018-03-09 13:51:08 +0000134 liblog \
surmeh0149b9e102018-05-17 14:11:25 +0100135 libtextclassifier_hash \
telsoa015307bc12018-03-09 13:51:08 +0000136 libutils \
137 android.hardware.neuralnetworks@1.0 \
138 android.hidl.allocator@1.0 \
139 android.hidl.memory@1.0 \
140 libOpenCL
surmeh01deb3bdb2018-07-05 12:06:04 +0100141ifeq ($(PLATFORM_VERSION),9)
142# Required to build the 1.0 version of the NN Driver on Android P and later versions,
143# as the 1.0 version of the NN API needs the 1.1 HAL headers to be included regardless.
144LOCAL_SHARED_LIBRARIES+= \
145 android.hardware.neuralnetworks@1.1
146endif
telsoa015307bc12018-03-09 13:51:08 +0000147
148include $(BUILD_EXECUTABLE)
149
150##########################
151# armnn module and tests #
152##########################
153# Note we use ANDROID_NN_DRIVER_LOCAL_PATH rather than LOCAL_PATH because LOCAL_PATH will be overwritten
154# when including other .mk files that set it.
155include $(ANDROID_NN_DRIVER_LOCAL_PATH)/armnn/Android.mk
surmeh0149b9e102018-05-17 14:11:25 +0100156include $(ANDROID_NN_DRIVER_LOCAL_PATH)/test/Android.mk