Hansong Zhang | 40e22a3 | 2020-01-13 15:47:22 -0800 | [diff] [blame] | 1 | LOCAL_PATH := $(call my-dir) |
| 2 | |
Zach Johnson | e805201 | 2021-02-03 17:15:57 -0800 | [diff] [blame] | 3 | #LINT.IfChange |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 4 | LOCAL_bluetooth_project_dir := $(LOCAL_PATH) |
| 5 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 6 | LOCAL_cert_test_sources := \ |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 7 | $(call all-named-files-under,*.py,blueberry) \ |
| 8 | $(call all-named-files-under,*.yaml,blueberry) \ |
| 9 | setup.py |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 10 | LOCAL_cert_test_sources := \ |
| 11 | $(filter-out gd_cert_venv% venv%, $(LOCAL_cert_test_sources)) |
| 12 | LOCAL_cert_test_sources := \ |
| 13 | $(addprefix $(LOCAL_PATH)/, $(LOCAL_cert_test_sources)) |
Hansong Zhang | 40e22a3 | 2020-01-13 15:47:22 -0800 | [diff] [blame] | 14 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 15 | LOCAL_host_executables := \ |
Jack He | 41846c5 | 2020-04-02 15:32:03 -0700 | [diff] [blame] | 16 | $(HOST_OUT_EXECUTABLES)/bluetooth_stack_with_facade \ |
Zach Johnson | 7796be1 | 2020-11-04 15:24:55 -0800 | [diff] [blame] | 17 | $(HOST_OUT_EXECUTABLES)/bluetooth_with_facades \ |
Hansong Zhang | 088294c | 2021-07-26 21:58:10 -0700 | [diff] [blame] | 18 | $(HOST_OUT_EXECUTABLES)/bt_topshim_facade \ |
Jack He | 41846c5 | 2020-04-02 15:32:03 -0700 | [diff] [blame] | 19 | $(HOST_OUT_EXECUTABLES)/root-canal |
Hansong Zhang | c3f964b | 2020-01-23 13:44:33 -0800 | [diff] [blame] | 20 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 21 | LOCAL_host_python_extension_libraries := \ |
| 22 | $(HOST_OUT_SHARED_LIBRARIES)/bluetooth_packets_python3.so |
Jack He | 01a100f | 2020-03-03 15:39:37 -0800 | [diff] [blame] | 23 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 24 | LOCAL_host_libraries := \ |
| 25 | $(HOST_OUT_SHARED_LIBRARIES)/libbase.so \ |
Hansong Zhang | 088294c | 2021-07-26 21:58:10 -0700 | [diff] [blame] | 26 | $(HOST_OUT_SHARED_LIBRARIES)/libbluetooth.so \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 27 | $(HOST_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \ |
| 28 | $(HOST_OUT_SHARED_LIBRARIES)/libc++.so \ |
| 29 | $(HOST_OUT_SHARED_LIBRARIES)/libchrome.so \ |
Jakub Pawlowski | 7d7adde | 2020-04-07 02:27:06 +0200 | [diff] [blame] | 30 | $(HOST_OUT_SHARED_LIBRARIES)/libcrypto-host.so \ |
Hansong Zhang | 13515a7 | 2021-11-11 04:46:10 -0800 | [diff] [blame] | 31 | $(HOST_OUT_SHARED_LIBRARIES)/libcutils.so \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 32 | $(HOST_OUT_SHARED_LIBRARIES)/libevent-host.so \ |
Hansong Zhang | 088294c | 2021-07-26 21:58:10 -0700 | [diff] [blame] | 33 | $(HOST_OUT_SHARED_LIBRARIES)/libflatbuffers-cpp.so \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 34 | $(HOST_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \ |
Zach Johnson | 7796be1 | 2020-11-04 15:24:55 -0800 | [diff] [blame] | 35 | $(HOST_OUT_SHARED_LIBRARIES)/libgrpc++.so \ |
| 36 | $(HOST_OUT_SHARED_LIBRARIES)/libgrpc_wrap.so \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 37 | $(HOST_OUT_SHARED_LIBRARIES)/liblog.so \ |
Zach Johnson | 7796be1 | 2020-11-04 15:24:55 -0800 | [diff] [blame] | 38 | $(HOST_OUT_SHARED_LIBRARIES)/libssl-host.so \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 39 | $(HOST_OUT_SHARED_LIBRARIES)/libz-host.so \ |
Jack He | 2678664 | 2020-04-20 02:34:10 -0700 | [diff] [blame] | 40 | $(HOST_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so \ |
| 41 | $(HOST_OUT_SHARED_LIBRARIES)/libunwindstack.so \ |
Jack He | 2678664 | 2020-04-20 02:34:10 -0700 | [diff] [blame] | 42 | $(HOST_OUT_SHARED_LIBRARIES)/liblzma.so \ |
| 43 | $(HOST_OUT_SHARED_LIBRARIES)/libbacktrace.so |
Jack He | 01a100f | 2020-03-03 15:39:37 -0800 | [diff] [blame] | 44 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 45 | LOCAL_target_executables := \ |
| 46 | $(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade |
Hansong Zhang | 40e22a3 | 2020-01-13 15:47:22 -0800 | [diff] [blame] | 47 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 48 | LOCAL_target_libraries := \ |
Jack He | 2d7ead8 | 2022-06-13 15:31:01 -0700 | [diff] [blame] | 49 | $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.bluetooth@1.0.so \ |
| 50 | $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.bluetooth@1.1.so \ |
| 51 | $(TARGET_OUT_SHARED_LIBRARIES)/libandroid_runtime_lazy.so \ |
| 52 | $(TARGET_OUT_SHARED_LIBRARIES)/libbacktrace.so \ |
| 53 | $(TARGET_OUT_SHARED_LIBRARIES)/libbase.so \ |
| 54 | $(TARGET_OUT_SHARED_LIBRARIES)/libbinder_ndk.so \ |
| 55 | $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so \ |
| 56 | $(TARGET_OUT_SHARED_LIBRARIES)/libc++.so \ |
Jakub Pawlowski | 7d7adde | 2020-04-07 02:27:06 +0200 | [diff] [blame] | 57 | $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \ |
Jack He | 2d7ead8 | 2022-06-13 15:31:01 -0700 | [diff] [blame] | 58 | $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so \ |
| 59 | $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc_wrap.so \ |
Jizheng Chu | 02eddd8 | 2021-06-10 17:41:58 -0700 | [diff] [blame] | 60 | $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \ |
| 61 | $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++.so \ |
Jack He | 2d7ead8 | 2022-06-13 15:31:01 -0700 | [diff] [blame] | 62 | $(TARGET_OUT_SHARED_LIBRARIES)/libhidlbase.so \ |
| 63 | $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so \ |
| 64 | $(TARGET_OUT_SHARED_LIBRARIES)/liblzma.so \ |
| 65 | $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so \ |
| 66 | $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so \ |
| 67 | $(TARGET_OUT_SHARED_LIBRARIES)/libstatslog_bt.so \ |
| 68 | $(TARGET_OUT_SHARED_LIBRARIES)/libunwindstack.so \ |
| 69 | $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so \ |
| 70 | $(TARGET_OUT_SHARED_LIBRARIES)/libz.so |
| 71 | # libclang_rt.asan-aarch64-android.so is only generated for ASAN build and included automatically |
| 72 | # on devices |
| 73 | # $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.asan-aarch64-android.so \ |
| 74 | # libc.so, libdl_android.so, libdl.so, and libm.so are provided by com.android.runtime APEX |
| 75 | # Hence we cannot manually add them here |
| 76 | # $(TARGET_OUT_SHARED_LIBRARIES)/libc.so \ |
| 77 | # $(TARGET_OUT_SHARED_LIBRARIES)/libdl_android.so \ |
| 78 | # $(TARGET_OUT_SHARED_LIBRARIES)/libdl.so \ |
| 79 | # $(TARGET_OUT_SHARED_LIBRARIES)/libm.so \ |
| 80 | # libstatssocket.so is provided by co.android.os.statsd APEX |
| 81 | # $(TARGET_OUT_SHARED_LIBRARIES)/libstatssocket.so |
| 82 | # linux-vdso.so.1 is always provided by OS |
| 83 | # $(TARGET_OUT_SHARED_LIBRARIES)/linux-vdso.so.1 |
| 84 | #LINT.ThenChange(blueberry/tests/gd/cert/gd_device.py) |
Hansong Zhang | 40e22a3 | 2020-01-13 15:47:22 -0800 | [diff] [blame] | 85 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 86 | bluetooth_cert_src_and_bin_zip := \ |
| 87 | $(call intermediates-dir-for,PACKAGING,bluetooth_cert_src_and_bin,HOST)/bluetooth_cert_src_and_bin.zip |
Jack He | 01a100f | 2020-03-03 15:39:37 -0800 | [diff] [blame] | 88 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 89 | # Assume 64-bit OS |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 90 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_bluetooth_project_dir := $(LOCAL_bluetooth_project_dir) |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 91 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_cert_test_sources := $(LOCAL_cert_test_sources) |
| 92 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_executables := $(LOCAL_host_executables) |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 93 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_extension_libraries := $(LOCAL_host_python_extension_libraries) |
| 94 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_libraries := $(LOCAL_host_libraries) |
| 95 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_target_executables := $(LOCAL_target_executables) |
| 96 | $(bluetooth_cert_src_and_bin_zip): PRIVATE_target_libraries := $(LOCAL_target_libraries) |
| 97 | $(bluetooth_cert_src_and_bin_zip): $(SOONG_ZIP) $(LOCAL_cert_test_sources) \ |
Jack He | 41846c5 | 2020-04-02 15:32:03 -0700 | [diff] [blame] | 98 | $(LOCAL_host_executables) $(LOCAL_host_libraries) $(LOCAL_host_python_extension_libraries) \ |
| 99 | $(LOCAL_target_executables) $(LOCAL_target_libraries) |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 100 | $(hide) $(SOONG_ZIP) -d -o $@ \ |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 101 | -C $(PRIVATE_bluetooth_project_dir) $(addprefix -f ,$(PRIVATE_cert_test_sources)) \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 102 | -C $(HOST_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_host_executables)) \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 103 | -C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_python_extension_libraries)) \ |
| 104 | -P lib64 \ |
| 105 | -C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_libraries)) \ |
| 106 | -P target \ |
| 107 | -C $(TARGET_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_target_executables)) \ |
| 108 | -C $(TARGET_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_target_libraries)) |
Hansong Zhang | c3f964b | 2020-01-23 13:44:33 -0800 | [diff] [blame] | 109 | |
Bob Badour | 4dd103f | 2022-03-30 17:11:24 -0700 | [diff] [blame] | 110 | $(call declare-container-license-metadata,$(bluetooth_cert_src_and_bin_zip),\ |
| 111 | SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_unencumbered,\ |
| 112 | notice, $(LOCAL_PATH)/../NOTICE,,packages/modules/Bluetooth) |
| 113 | $(call declare-container-license-deps,$(bluetooth_cert_src_and_bin_zip),\ |
| 114 | $(LOCAL_host_python_extension_libraries) $(LOCAL_target_executables) $(LOCAL_target_libraries),$(bluetooth_cert_src_and_bin_zip):) |
| 115 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 116 | # TODO: Find a better way to locate output from SOONG genrule() |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 117 | LOCAL_facade_generated_py_zip := \ |
| 118 | $(SOONG_OUT_DIR)/.intermediates/packages/modules/Bluetooth/system/BlueberryFacadeAndCertGeneratedStub_py/gen/blueberry_facade_generated_py.zip |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 119 | |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 120 | bluetooth_cert_tests_py_package_zip := \ |
| 121 | $(call intermediates-dir-for,PACKAGING,bluetooth_cert_tests_py_package,HOST)/bluetooth_cert_tests.zip |
| 122 | |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 123 | $(bluetooth_cert_tests_py_package_zip): PRIVATE_bluetooth_project_dir := $(LOCAL_bluetooth_project_dir) |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 124 | $(bluetooth_cert_tests_py_package_zip): PRIVATE_cert_src_and_bin_zip := $(bluetooth_cert_src_and_bin_zip) |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 125 | $(bluetooth_cert_tests_py_package_zip): PRIVATE_facade_generated_py_zip := $(LOCAL_facade_generated_py_zip) |
Jizheng Chu | 534cb1d | 2021-11-18 13:32:48 -0800 | [diff] [blame] | 126 | $(bluetooth_cert_tests_py_package_zip): $(SOONG_ZIP) \ |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 127 | $(bluetooth_cert_src_and_bin_zip) $(bluetooth_cert_generated_py_zip) |
| 128 | @echo "Packaging Bluetooth Cert Tests into $@" |
| 129 | @rm -rf $(dir $@)bluetooth_cert_tests |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 130 | @mkdir -p $(dir $@)bluetooth_cert_tests |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 131 | $(hide) unzip -o -q $(PRIVATE_cert_src_and_bin_zip) -d $(dir $@)bluetooth_cert_tests |
Jack He | e9bb55a | 2022-01-10 09:20:33 -0800 | [diff] [blame] | 132 | $(hide) unzip -o -q $(PRIVATE_facade_generated_py_zip) -d $(dir $@)bluetooth_cert_tests |
| 133 | # Make all subdirectory Python packages except lib64 and target |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 134 | $(hide) for f in `find $(dir $@)bluetooth_cert_tests -type d -name "*" \ |
| 135 | -not -path "$(dir $@)bluetooth_cert_tests/target*" \ |
| 136 | -not -path "$(dir $@)bluetooth_cert_tests/lib64*"` \ |
| 137 | ; do (touch -a $$f/__init__.py) ; done |
| 138 | $(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@)bluetooth_cert_tests -D $(dir $@)bluetooth_cert_tests \ |
Jack He | a094e97 | 2020-04-13 02:48:23 -0700 | [diff] [blame] | 139 | -P llvm_binutils -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) \ |
| 140 | -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-cov \ |
| 141 | -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata \ |
Jack He | 73d3951 | 2020-12-13 23:33:40 -0800 | [diff] [blame] | 142 | -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-symbolizer \ |
Jack He | a094e97 | 2020-04-13 02:48:23 -0700 | [diff] [blame] | 143 | -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/libc++.so.1 |
Jack He | 1817a2a | 2020-03-18 02:52:54 -0700 | [diff] [blame] | 144 | |
Bob Badour | 4dd103f | 2022-03-30 17:11:24 -0700 | [diff] [blame] | 145 | $(call declare-container-license-metadata,$(bluetooth_cert_tests_py_package_zip),\ |
| 146 | SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_unencumbered,\ |
| 147 | notice, $(LOCAL_PATH)/../NOTICE,,packages/modules/Bluetooth) |
| 148 | $(call declare-container-license-deps,$(bluetooth_cert_tests_py_package_zip),\ |
| 149 | $(bluetooth_cert_src_and_bin_zip) $(bluetooth_cert_generated_py_zip),$(bluetooth_cert_tests_py_package_zip):) |
| 150 | |
Zach Johnson | 7796be1 | 2020-11-04 15:24:55 -0800 | [diff] [blame] | 151 | $(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_tests_py_package_zip):bluetooth_cert_tests.zip) |