blob: c4d9180da9182ba3541ef24bb8f6867dd21cc7bf [file] [log] [blame]
Hansong Zhang40e22a32020-01-13 15:47:22 -08001LOCAL_PATH := $(call my-dir)
2
Zach Johnsone8052012021-02-03 17:15:57 -08003#LINT.IfChange
Jack Hee9bb55a2022-01-10 09:20:33 -08004LOCAL_bluetooth_project_dir := $(LOCAL_PATH)
5
Jack He1817a2a2020-03-18 02:52:54 -07006LOCAL_cert_test_sources := \
Henri Chataing4b51ee32022-11-14 23:46:43 +00007 $(call all-named-files-under,*.py,blueberry) \
8 $(call all-named-files-under,*.yaml,blueberry) \
9 setup.py
Jack He1817a2a2020-03-18 02:52:54 -070010LOCAL_cert_test_sources := \
11 $(filter-out gd_cert_venv% venv%, $(LOCAL_cert_test_sources))
12LOCAL_cert_test_sources := \
13 $(addprefix $(LOCAL_PATH)/, $(LOCAL_cert_test_sources))
Hansong Zhang40e22a32020-01-13 15:47:22 -080014
Jack He1817a2a2020-03-18 02:52:54 -070015LOCAL_host_executables := \
Jack He41846c52020-04-02 15:32:03 -070016 $(HOST_OUT_EXECUTABLES)/bluetooth_stack_with_facade \
Zach Johnson7796be12020-11-04 15:24:55 -080017 $(HOST_OUT_EXECUTABLES)/bluetooth_with_facades \
Hansong Zhang088294c2021-07-26 21:58:10 -070018 $(HOST_OUT_EXECUTABLES)/bt_topshim_facade \
Jack He41846c52020-04-02 15:32:03 -070019 $(HOST_OUT_EXECUTABLES)/root-canal
Hansong Zhangc3f964b2020-01-23 13:44:33 -080020
Henri Chataing4b51ee32022-11-14 23:46:43 +000021LOCAL_host_python_hci_packets_library := \
William Escande4e304b92023-07-25 10:02:41 -070022 $(SOONG_OUT_DIR)/.intermediates/packages/modules/Bluetooth/system/pdl/hci/gd_hci_packets_python3_gen/gen/hci_packets.py
Henri Chataing4b51ee32022-11-14 23:46:43 +000023
Myles Watson67acf282023-07-25 14:36:09 -070024LOCAL_host_python_smp_packets_library := \
William Escande4e304b92023-07-25 10:02:41 -070025 $(SOONG_OUT_DIR)/.intermediates/packages/modules/Bluetooth/system/pdl/security/gd_smp_packets_python3_gen/gen/smp_packets.py
Myles Watson67acf282023-07-25 14:36:09 -070026
Jack He1817a2a2020-03-18 02:52:54 -070027LOCAL_host_python_extension_libraries := \
28 $(HOST_OUT_SHARED_LIBRARIES)/bluetooth_packets_python3.so
Jack He01a100f2020-03-03 15:39:37 -080029
Jack He1817a2a2020-03-18 02:52:54 -070030LOCAL_host_libraries := \
31 $(HOST_OUT_SHARED_LIBRARIES)/libbase.so \
Jack Heed7d49b2023-10-30 11:05:06 -070032 $(HOST_OUT_SHARED_LIBRARIES)/libbinder.so \
33 $(HOST_OUT_SHARED_LIBRARIES)/libbinder_ndk.so \
Hansong Zhang088294c2021-07-26 21:58:10 -070034 $(HOST_OUT_SHARED_LIBRARIES)/libbluetooth.so \
Jack He1817a2a2020-03-18 02:52:54 -070035 $(HOST_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \
36 $(HOST_OUT_SHARED_LIBRARIES)/libc++.so \
37 $(HOST_OUT_SHARED_LIBRARIES)/libchrome.so \
Jakub Pawlowski7d7adde2020-04-07 02:27:06 +020038 $(HOST_OUT_SHARED_LIBRARIES)/libcrypto-host.so \
Hansong Zhang13515a72021-11-11 04:46:10 -080039 $(HOST_OUT_SHARED_LIBRARIES)/libcutils.so \
Jack He1817a2a2020-03-18 02:52:54 -070040 $(HOST_OUT_SHARED_LIBRARIES)/libevent-host.so \
Hansong Zhang088294c2021-07-26 21:58:10 -070041 $(HOST_OUT_SHARED_LIBRARIES)/libflatbuffers-cpp.so \
Zach Johnson7796be12020-11-04 15:24:55 -080042 $(HOST_OUT_SHARED_LIBRARIES)/libgrpc++.so \
43 $(HOST_OUT_SHARED_LIBRARIES)/libgrpc_wrap.so \
Jack He1817a2a2020-03-18 02:52:54 -070044 $(HOST_OUT_SHARED_LIBRARIES)/liblog.so \
Zach Johnson7796be12020-11-04 15:24:55 -080045 $(HOST_OUT_SHARED_LIBRARIES)/libssl-host.so \
Jack He1817a2a2020-03-18 02:52:54 -070046 $(HOST_OUT_SHARED_LIBRARIES)/libz-host.so \
Jack He26786642020-04-20 02:34:10 -070047 $(HOST_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so \
48 $(HOST_OUT_SHARED_LIBRARIES)/libunwindstack.so \
Jack Heed7d49b2023-10-30 11:05:06 -070049 $(HOST_OUT_SHARED_LIBRARIES)/libutils.so \
Rongxuan Liu7072fda2023-11-10 18:04:08 +000050 $(HOST_OUT_SHARED_LIBRARIES)/liblzma.so \
51 $(HOST_OUT_SHARED_LIBRARIES)/server_configurable_flags.so
Jack He01a100f2020-03-03 15:39:37 -080052
Jack He1817a2a2020-03-18 02:52:54 -070053LOCAL_target_executables := \
54 $(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade
Hansong Zhang40e22a32020-01-13 15:47:22 -080055
Jack He1817a2a2020-03-18 02:52:54 -070056LOCAL_target_libraries := \
Jack Hed500fed2022-06-13 15:31:01 -070057 $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.bluetooth@1.0.so \
58 $(TARGET_OUT_SHARED_LIBRARIES)/android.hardware.bluetooth@1.1.so \
59 $(TARGET_OUT_SHARED_LIBRARIES)/libandroid_runtime_lazy.so \
Jack Hed500fed2022-06-13 15:31:01 -070060 $(TARGET_OUT_SHARED_LIBRARIES)/libbase.so \
61 $(TARGET_OUT_SHARED_LIBRARIES)/libbinder_ndk.so \
62 $(TARGET_OUT_SHARED_LIBRARIES)/libbinder.so \
63 $(TARGET_OUT_SHARED_LIBRARIES)/libc++.so \
Jakub Pawlowski7d7adde2020-04-07 02:27:06 +020064 $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
Jack Hed500fed2022-06-13 15:31:01 -070065 $(TARGET_OUT_SHARED_LIBRARIES)/libcutils.so \
66 $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc_wrap.so \
Jizheng Chu02eddd82021-06-10 17:41:58 -070067 $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++.so \
Jack Hed500fed2022-06-13 15:31:01 -070068 $(TARGET_OUT_SHARED_LIBRARIES)/libhidlbase.so \
69 $(TARGET_OUT_SHARED_LIBRARIES)/liblog.so \
70 $(TARGET_OUT_SHARED_LIBRARIES)/liblzma.so \
71 $(TARGET_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so \
72 $(TARGET_OUT_SHARED_LIBRARIES)/libssl.so \
73 $(TARGET_OUT_SHARED_LIBRARIES)/libstatslog_bt.so \
74 $(TARGET_OUT_SHARED_LIBRARIES)/libunwindstack.so \
75 $(TARGET_OUT_SHARED_LIBRARIES)/libutils.so \
Rongxuan Liu7072fda2023-11-10 18:04:08 +000076 $(TARGET_OUT_SHARED_LIBRARIES)/libz.so \
77 $(TARGET_OUT_SHARED_LIBRARIES)/server_configurable_flags.so
Jack Hed500fed2022-06-13 15:31:01 -070078 # libclang_rt.asan-aarch64-android.so is only generated for ASAN build and included automatically
79 # on devices
80 # $(TARGET_OUT_SHARED_LIBRARIES)/libclang_rt.asan-aarch64-android.so \
81 # libc.so, libdl_android.so, libdl.so, and libm.so are provided by com.android.runtime APEX
82 # Hence we cannot manually add them here
83 # $(TARGET_OUT_SHARED_LIBRARIES)/libc.so \
84 # $(TARGET_OUT_SHARED_LIBRARIES)/libdl_android.so \
85 # $(TARGET_OUT_SHARED_LIBRARIES)/libdl.so \
86 # $(TARGET_OUT_SHARED_LIBRARIES)/libm.so \
87 # libstatssocket.so is provided by co.android.os.statsd APEX
88 # $(TARGET_OUT_SHARED_LIBRARIES)/libstatssocket.so
89 # linux-vdso.so.1 is always provided by OS
90 # $(TARGET_OUT_SHARED_LIBRARIES)/linux-vdso.so.1
91#LINT.ThenChange(blueberry/tests/gd/cert/gd_device.py)
Hansong Zhang40e22a32020-01-13 15:47:22 -080092
Jack He1817a2a2020-03-18 02:52:54 -070093bluetooth_cert_src_and_bin_zip := \
94 $(call intermediates-dir-for,PACKAGING,bluetooth_cert_src_and_bin,HOST)/bluetooth_cert_src_and_bin.zip
Jack He01a100f2020-03-03 15:39:37 -080095
Jack He1817a2a2020-03-18 02:52:54 -070096# Assume 64-bit OS
Jack Hee9bb55a2022-01-10 09:20:33 -080097$(bluetooth_cert_src_and_bin_zip): PRIVATE_bluetooth_project_dir := $(LOCAL_bluetooth_project_dir)
Jack He1817a2a2020-03-18 02:52:54 -070098$(bluetooth_cert_src_and_bin_zip): PRIVATE_cert_test_sources := $(LOCAL_cert_test_sources)
99$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_executables := $(LOCAL_host_executables)
Jack He1817a2a2020-03-18 02:52:54 -0700100$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_libraries := $(LOCAL_host_libraries)
Henri Chataing4b51ee32022-11-14 23:46:43 +0000101$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_extension_libraries := $(LOCAL_host_python_extension_libraries)
102$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_hci_packets_library := $(LOCAL_host_python_hci_packets_library)
Myles Watson67acf282023-07-25 14:36:09 -0700103$(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_smp_packets_library := $(LOCAL_host_python_smp_packets_library)
Jack He1817a2a2020-03-18 02:52:54 -0700104$(bluetooth_cert_src_and_bin_zip): PRIVATE_target_executables := $(LOCAL_target_executables)
105$(bluetooth_cert_src_and_bin_zip): PRIVATE_target_libraries := $(LOCAL_target_libraries)
106$(bluetooth_cert_src_and_bin_zip): $(SOONG_ZIP) $(LOCAL_cert_test_sources) \
Henri Chataing4b51ee32022-11-14 23:46:43 +0000107 $(LOCAL_host_executables) $(LOCAL_host_libraries) $(LOCAL_host_python_libraries) \
108 $(LOCAL_host_python_extension_libraries) \
109 $(LOCAL_host_python_hci_packets_library) \
Myles Watson67acf282023-07-25 14:36:09 -0700110 $(LOCAL_host_python_smp_packets_library) \
Jack He41846c52020-04-02 15:32:03 -0700111 $(LOCAL_target_executables) $(LOCAL_target_libraries)
Jack He1817a2a2020-03-18 02:52:54 -0700112 $(hide) $(SOONG_ZIP) -d -o $@ \
Jack Hee9bb55a2022-01-10 09:20:33 -0800113 -C $(PRIVATE_bluetooth_project_dir) $(addprefix -f ,$(PRIVATE_cert_test_sources)) \
Henri Chataing4b51ee32022-11-14 23:46:43 +0000114 -C $(dir $(PRIVATE_host_python_hci_packets_library)) -f $(PRIVATE_host_python_hci_packets_library) \
Myles Watson67acf282023-07-25 14:36:09 -0700115 -C $(dir $(PRIVATE_host_python_smp_packets_library)) -f $(PRIVATE_host_python_smp_packets_library) \
Jack He1817a2a2020-03-18 02:52:54 -0700116 -C $(HOST_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_host_executables)) \
Jack He1817a2a2020-03-18 02:52:54 -0700117 -C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_python_extension_libraries)) \
118 -P lib64 \
119 -C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_libraries)) \
120 -P target \
121 -C $(TARGET_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_target_executables)) \
122 -C $(TARGET_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_target_libraries))
Hansong Zhangc3f964b2020-01-23 13:44:33 -0800123
Bob Badour4dd103f2022-03-30 17:11:24 -0700124$(call declare-container-license-metadata,$(bluetooth_cert_src_and_bin_zip),\
125 SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_unencumbered,\
126 notice, $(LOCAL_PATH)/../NOTICE,,packages/modules/Bluetooth)
127$(call declare-container-license-deps,$(bluetooth_cert_src_and_bin_zip),\
128 $(LOCAL_host_python_extension_libraries) $(LOCAL_target_executables) $(LOCAL_target_libraries),$(bluetooth_cert_src_and_bin_zip):)
129
Jack He1817a2a2020-03-18 02:52:54 -0700130# TODO: Find a better way to locate output from SOONG genrule()
Jack Hee9bb55a2022-01-10 09:20:33 -0800131LOCAL_facade_generated_py_zip := \
132 $(SOONG_OUT_DIR)/.intermediates/packages/modules/Bluetooth/system/BlueberryFacadeAndCertGeneratedStub_py/gen/blueberry_facade_generated_py.zip
Jack He1817a2a2020-03-18 02:52:54 -0700133
Jack He1817a2a2020-03-18 02:52:54 -0700134bluetooth_cert_tests_py_package_zip := \
135 $(call intermediates-dir-for,PACKAGING,bluetooth_cert_tests_py_package,HOST)/bluetooth_cert_tests.zip
136
Jack Hee9bb55a2022-01-10 09:20:33 -0800137$(bluetooth_cert_tests_py_package_zip): PRIVATE_bluetooth_project_dir := $(LOCAL_bluetooth_project_dir)
Jack He1817a2a2020-03-18 02:52:54 -0700138$(bluetooth_cert_tests_py_package_zip): PRIVATE_cert_src_and_bin_zip := $(bluetooth_cert_src_and_bin_zip)
Jack Hee9bb55a2022-01-10 09:20:33 -0800139$(bluetooth_cert_tests_py_package_zip): PRIVATE_facade_generated_py_zip := $(LOCAL_facade_generated_py_zip)
Jizheng Chu534cb1d2021-11-18 13:32:48 -0800140$(bluetooth_cert_tests_py_package_zip): $(SOONG_ZIP) \
Jack He1817a2a2020-03-18 02:52:54 -0700141 $(bluetooth_cert_src_and_bin_zip) $(bluetooth_cert_generated_py_zip)
142 @echo "Packaging Bluetooth Cert Tests into $@"
143 @rm -rf $(dir $@)bluetooth_cert_tests
Jack He1817a2a2020-03-18 02:52:54 -0700144 @mkdir -p $(dir $@)bluetooth_cert_tests
Jack He1817a2a2020-03-18 02:52:54 -0700145 $(hide) unzip -o -q $(PRIVATE_cert_src_and_bin_zip) -d $(dir $@)bluetooth_cert_tests
Jack Hee9bb55a2022-01-10 09:20:33 -0800146 $(hide) unzip -o -q $(PRIVATE_facade_generated_py_zip) -d $(dir $@)bluetooth_cert_tests
147 # Make all subdirectory Python packages except lib64 and target
Jack He1817a2a2020-03-18 02:52:54 -0700148 $(hide) for f in `find $(dir $@)bluetooth_cert_tests -type d -name "*" \
149 -not -path "$(dir $@)bluetooth_cert_tests/target*" \
150 -not -path "$(dir $@)bluetooth_cert_tests/lib64*"` \
151 ; do (touch -a $$f/__init__.py) ; done
152 $(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@)bluetooth_cert_tests -D $(dir $@)bluetooth_cert_tests \
Jack Hea094e972020-04-13 02:48:23 -0700153 -P llvm_binutils -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) \
154 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-cov \
155 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata \
Jack He73d39512020-12-13 23:33:40 -0800156 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-symbolizer \
Yabin Cui52784992023-06-13 21:58:04 +0000157 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib/x86_64-unknown-linux-gnu/libc++.so
Jack He1817a2a2020-03-18 02:52:54 -0700158
Bob Badour4dd103f2022-03-30 17:11:24 -0700159$(call declare-container-license-metadata,$(bluetooth_cert_tests_py_package_zip),\
160 SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD SPDX-license-identifier-MIT legacy_unencumbered,\
161 notice, $(LOCAL_PATH)/../NOTICE,,packages/modules/Bluetooth)
162$(call declare-container-license-deps,$(bluetooth_cert_tests_py_package_zip),\
163 $(bluetooth_cert_src_and_bin_zip) $(bluetooth_cert_generated_py_zip),$(bluetooth_cert_tests_py_package_zip):)
164
Zach Johnson7796be12020-11-04 15:24:55 -0800165$(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_tests_py_package_zip):bluetooth_cert_tests.zip)