Chris Manton | 3a2ee93 | 2014-06-03 11:02:38 -0700 | [diff] [blame] | 1 | ############################################################################## |
| 2 | # |
| 3 | # Copyright (C) 2014 Google, Inc. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at: |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | # |
| 17 | ############################################################################## |
| 18 | |
Sharvil Nanavati | cef7695 | 2014-04-24 16:22:45 -0700 | [diff] [blame] | 19 | LOCAL_PATH := $(call my-dir) |
| 20 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 21 | # Common variables |
| 22 | # ======================================================== |
Sharvil Nanavati | cef7695 | 2014-04-24 16:22:45 -0700 | [diff] [blame] | 23 | |
Miao Chou | 1096912 | 2015-06-09 17:39:46 -0700 | [diff] [blame] | 24 | # TODO(mcchou): Remove socket_utils sources after platform specific |
| 25 | # dependencies are abstracted. |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 26 | btosiCommonSrc := \ |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 27 | ./src/alarm.cc \ |
Jakub Pawlowski | 0d55d66 | 2016-05-25 10:37:17 -0700 | [diff] [blame] | 28 | ./src/allocation_tracker.cc \ |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 29 | ./src/allocator.cc \ |
| 30 | ./src/array.cc \ |
| 31 | ./src/buffer.cc \ |
| 32 | ./src/compat.cc \ |
| 33 | ./src/config.cc \ |
Jakub Pawlowski | 2b56e01 | 2016-05-26 10:13:40 -0700 | [diff] [blame] | 34 | ./src/data_dispatcher.cc \ |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 35 | ./src/eager_reader.cc \ |
| 36 | ./src/fixed_queue.cc \ |
| 37 | ./src/future.cc \ |
Jakub Pawlowski | 6a05951 | 2016-05-25 17:49:32 -0700 | [diff] [blame] | 38 | ./src/hash_map_utils.cc \ |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 39 | ./src/list.cc \ |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 40 | ./src/metrics.cc \ |
Pavlin Radoslavov | b2a292b | 2016-10-14 19:34:48 -0700 | [diff] [blame] | 41 | ./src/mutex.cc \ |
| 42 | ./src/osi.cc \ |
| 43 | ./src/properties.cc \ |
| 44 | ./src/reactor.cc \ |
| 45 | ./src/ringbuffer.cc \ |
| 46 | ./src/semaphore.cc \ |
| 47 | ./src/socket.cc \ |
| 48 | ./src/socket_utils/socket_local_client.cc \ |
| 49 | ./src/socket_utils/socket_local_server.cc \ |
| 50 | ./src/thread.cc \ |
| 51 | ./src/time.cc \ |
| 52 | ./src/wakelock.cc |
Sharvil Nanavati | cef7695 | 2014-04-24 16:22:45 -0700 | [diff] [blame] | 53 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 54 | btosiCommonTestSrc := \ |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 55 | ./test/AlarmTestHarness.cc \ |
| 56 | ./test/AllocationTestHarness.cc \ |
| 57 | ./test/alarm_test.cc \ |
| 58 | ./test/allocation_tracker_test.cc \ |
| 59 | ./test/allocator_test.cc \ |
| 60 | ./test/array_test.cc \ |
| 61 | ./test/config_test.cc \ |
| 62 | ./test/data_dispatcher_test.cc \ |
| 63 | ./test/eager_reader_test.cc \ |
| 64 | ./test/fixed_queue_test.cc \ |
| 65 | ./test/future_test.cc \ |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 66 | ./test/hash_map_utils_test.cc \ |
| 67 | ./test/list_test.cc \ |
| 68 | ./test/properties_test.cc \ |
| 69 | ./test/rand_test.cc \ |
| 70 | ./test/reactor_test.cc \ |
| 71 | ./test/ringbuffer_test.cc \ |
| 72 | ./test/semaphore_test.cc \ |
| 73 | ./test/thread_test.cc \ |
Pavlin Radoslavov | 223cecf | 2016-08-08 11:18:47 -0700 | [diff] [blame] | 74 | ./test/time_test.cc \ |
| 75 | ./test/wakelock_test.cc |
Sharvil Nanavati | cef7695 | 2014-04-24 16:22:45 -0700 | [diff] [blame] | 76 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 77 | btosiCommonIncludes := \ |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 78 | $(LOCAL_PATH)/.. \ |
Pavlin Radoslavov | 1097801 | 2016-01-21 18:04:36 -0800 | [diff] [blame] | 79 | $(LOCAL_PATH)/../utils/include \ |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 80 | $(LOCAL_PATH)/../stack/include \ |
| 81 | $(bluetooth_C_INCLUDES) |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 82 | |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 83 | # Bluetooth Protobuf static library for target |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 84 | # ======================================================== |
| 85 | include $(CLEAR_VARS) |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 86 | LOCAL_CPP_EXTENSION := .cc |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 87 | LOCAL_MODULE := libbt-protos |
| 88 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 89 | generated_sources_dir := $(call local-generated-sources-dir) |
Pavlin Radoslavov | 7aaf7c6 | 2016-08-23 12:24:03 -0700 | [diff] [blame] | 90 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 91 | $(generated_sources_dir)/proto/system/bt |
| 92 | LOCAL_SRC_FILES := $(call all-proto-files-under,src/protos/) |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 93 | |
| 94 | LOCAL_CFLAGS += $(bluetooth_CFLAGS) |
| 95 | LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) |
| 96 | LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) |
| 97 | |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 98 | include $(BUILD_STATIC_LIBRARY) |
| 99 | |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 100 | # Bluetooth Protobuf static library for host |
| 101 | # ======================================================== |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 102 | include $(CLEAR_VARS) |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 103 | LOCAL_CPP_EXTENSION := .cc |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 104 | LOCAL_MODULE := libbt-protos |
| 105 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Ying Wang | df515a4 | 2016-03-23 11:41:15 -0700 | [diff] [blame] | 106 | LOCAL_IS_HOST_MODULE := true |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 107 | generated_sources_dir := $(call local-generated-sources-dir) |
Pavlin Radoslavov | 7aaf7c6 | 2016-08-23 12:24:03 -0700 | [diff] [blame] | 108 | LOCAL_EXPORT_C_INCLUDE_DIRS := \ |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 109 | $(generated_sources_dir)/proto/system/bt |
| 110 | LOCAL_SRC_FILES := $(call all-proto-files-under,src/protos/) |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 111 | |
| 112 | LOCAL_CFLAGS += $(bluetooth_CFLAGS) |
| 113 | LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) |
| 114 | LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) |
| 115 | |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 116 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 117 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 118 | # libosi static library for target |
| 119 | # ======================================================== |
| 120 | include $(CLEAR_VARS) |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 121 | LOCAL_CPP_EXTENSION := .cc |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 122 | LOCAL_C_INCLUDES := $(btosiCommonIncludes) |
| 123 | LOCAL_SRC_FILES := $(btosiCommonSrc) |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 124 | LOCAL_MODULE := libosi |
| 125 | LOCAL_MODULE_TAGS := optional |
Ajay Panicker | 1d00dd2 | 2016-02-17 18:18:00 -0800 | [diff] [blame] | 126 | LOCAL_SHARED_LIBRARIES := libc liblog libchrome |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 127 | LOCAL_STATIC_LIBRARIES := libbt-protos |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 128 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 129 | |
| 130 | LOCAL_CFLAGS += $(bluetooth_CFLAGS) |
| 131 | LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) |
| 132 | LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) |
| 133 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 134 | include $(BUILD_STATIC_LIBRARY) |
| 135 | |
| 136 | # libosi static library for host |
| 137 | # ======================================================== |
| 138 | ifeq ($(HOST_OS),linux) |
| 139 | include $(CLEAR_VARS) |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 140 | LOCAL_CPP_EXTENSION := .cc |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 141 | LOCAL_C_INCLUDES := $(btosiCommonIncludes) |
| 142 | LOCAL_SRC_FILES := $(btosiCommonSrc) |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 143 | LOCAL_MODULE := libosi-host |
| 144 | LOCAL_MODULE_TAGS := optional |
Ajay Panicker | 1d00dd2 | 2016-02-17 18:18:00 -0800 | [diff] [blame] | 145 | LOCAL_SHARED_LIBRARIES := liblog libchrome |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 146 | LOCAL_STATIC_LIBRARIES := libbt-protos |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 147 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 148 | |
| 149 | # TODO(armansito): Setting _GNU_SOURCE isn't very platform-independent but |
| 150 | # should be compatible for a Linux host OS. We should figure out what to do for |
| 151 | # a non-Linux host OS. |
Jakub Pawlowski | 3eb4a48 | 2016-02-24 10:39:46 -0800 | [diff] [blame] | 152 | LOCAL_CFLAGS += $(bluetooth_CFLAGS) -D_GNU_SOURCE -DOS_GENERIC |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 153 | LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) |
| 154 | LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) |
| 155 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 156 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 157 | endif |
| 158 | |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 159 | # |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 160 | # Note: It's good to get the tests compiled both for the host and the target so |
| 161 | # we get to test with both Bionic libc and glibc |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 162 | # |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 163 | # libosi unit tests for target |
| 164 | # ======================================================== |
| 165 | include $(CLEAR_VARS) |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 166 | LOCAL_CPP_EXTENSION := .cc |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 167 | LOCAL_C_INCLUDES := $(btosiCommonIncludes) |
| 168 | LOCAL_SRC_FILES := $(btosiCommonTestSrc) |
Sharvil Nanavati | 6168357 | 2014-12-29 00:56:46 -0800 | [diff] [blame] | 169 | LOCAL_MODULE := net_test_osi |
Sharvil Nanavati | cef7695 | 2014-04-24 16:22:45 -0700 | [diff] [blame] | 170 | LOCAL_MODULE_TAGS := tests |
Colin Cross | 9a24711 | 2016-10-26 14:25:28 -0700 | [diff] [blame] | 171 | LOCAL_SHARED_LIBRARIES := libc liblog libprotobuf-cpp-lite libchrome libcutils |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 172 | LOCAL_STATIC_LIBRARIES := libosi libbt-protos |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 173 | |
| 174 | LOCAL_CFLAGS += $(bluetooth_CFLAGS) |
| 175 | LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) |
| 176 | LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) |
| 177 | |
Sharvil Nanavati | cef7695 | 2014-04-24 16:22:45 -0700 | [diff] [blame] | 178 | include $(BUILD_NATIVE_TEST) |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 179 | |
| 180 | # libosi unit tests for host |
| 181 | # ======================================================== |
| 182 | ifeq ($(HOST_OS),linux) |
| 183 | include $(CLEAR_VARS) |
Jakub Pawlowski | e6d1202 | 2016-05-12 11:16:46 -0700 | [diff] [blame] | 184 | LOCAL_CPP_EXTENSION := .cc |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 185 | LOCAL_C_INCLUDES := $(btosiCommonIncludes) |
| 186 | LOCAL_SRC_FILES := $(btosiCommonTestSrc) |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 187 | LOCAL_LDLIBS := -lrt -lpthread |
| 188 | LOCAL_MODULE := net_test_osi |
| 189 | LOCAL_MODULE_TAGS := tests |
Colin Cross | 9a24711 | 2016-10-26 14:25:28 -0700 | [diff] [blame] | 190 | LOCAL_SHARED_LIBRARIES := liblog libprotobuf-cpp-lite libchrome |
Marie Janssen | 77f579f | 2016-01-15 16:14:14 -0800 | [diff] [blame] | 191 | LOCAL_STATIC_LIBRARIES := libosi-host libbt-protos |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 192 | |
Jakub Pawlowski | 3eb4a48 | 2016-02-24 10:39:46 -0800 | [diff] [blame] | 193 | LOCAL_CFLAGS += $(bluetooth_CFLAGS) -DOS_GENERIC |
Pavlin Radoslavov | 1377f93 | 2016-02-11 19:44:47 -0800 | [diff] [blame] | 194 | LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS) |
| 195 | LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS) |
| 196 | |
Arman Uguray | 145cf57 | 2015-07-31 19:14:39 -0700 | [diff] [blame] | 197 | include $(BUILD_HOST_NATIVE_TEST) |
| 198 | endif |