OSDN Git Service

GD: Fix DeviceTest
[android-x86/system-bt.git] / gd / Android.mk
1 LOCAL_PATH := $(call my-dir)
2
3 #LINT.IfChange
4 LOCAL_cert_test_sources := \
5         $(call all-named-files-under,*.py,.) \
6         cert/all_cert_testcases
7 LOCAL_cert_test_sources := \
8         $(filter-out gd_cert_venv% venv%, $(LOCAL_cert_test_sources))
9 LOCAL_cert_test_sources := \
10         $(addprefix $(LOCAL_PATH)/, $(LOCAL_cert_test_sources))
11
12 LOCAL_host_executables := \
13         $(HOST_OUT_EXECUTABLES)/bluetooth_stack_with_facade \
14         $(HOST_OUT_EXECUTABLES)/bluetooth_with_facades \
15         $(HOST_OUT_EXECUTABLES)/root-canal
16
17 LOCAL_host_python_extension_libraries := \
18         $(HOST_OUT_SHARED_LIBRARIES)/bluetooth_packets_python3.so
19
20 LOCAL_host_libraries := \
21         $(HOST_OUT_SHARED_LIBRARIES)/libbase.so \
22         $(HOST_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \
23         $(HOST_OUT_SHARED_LIBRARIES)/libc++.so \
24         $(HOST_OUT_SHARED_LIBRARIES)/libchrome.so \
25         $(HOST_OUT_SHARED_LIBRARIES)/libcrypto-host.so \
26         $(HOST_OUT_SHARED_LIBRARIES)/libevent-host.so \
27         $(HOST_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so \
28         $(HOST_OUT_SHARED_LIBRARIES)/libgrpc++.so \
29         $(HOST_OUT_SHARED_LIBRARIES)/libgrpc_wrap.so \
30         $(HOST_OUT_SHARED_LIBRARIES)/liblog.so \
31         $(HOST_OUT_SHARED_LIBRARIES)/libssl-host.so \
32         $(HOST_OUT_SHARED_LIBRARIES)/libz-host.so \
33         $(HOST_OUT_SHARED_LIBRARIES)/libprotobuf-cpp-full.so \
34         $(HOST_OUT_SHARED_LIBRARIES)/libunwindstack.so \
35         $(HOST_OUT_SHARED_LIBRARIES)/libdexfile_support.so \
36         $(HOST_OUT_SHARED_LIBRARIES)/liblzma.so \
37         $(HOST_OUT_SHARED_LIBRARIES)/libbacktrace.so
38
39 LOCAL_target_executables := \
40         $(TARGET_OUT_EXECUTABLES)/bluetooth_stack_with_facade
41
42 LOCAL_target_libraries := \
43         $(TARGET_OUT_SHARED_LIBRARIES)/libcrypto.so \
44         $(TARGET_OUT_SHARED_LIBRARIES)/libbluetooth_gd.so \
45         $(TARGET_OUT_SHARED_LIBRARIES)/libgrpc++_unsecure.so
46 #LINT.ThenChange(cert/run)
47
48 bluetooth_cert_src_and_bin_zip := \
49         $(call intermediates-dir-for,PACKAGING,bluetooth_cert_src_and_bin,HOST)/bluetooth_cert_src_and_bin.zip
50
51 # Assume 64-bit OS
52 $(bluetooth_cert_src_and_bin_zip): PRIVATE_cert_test_sources := $(LOCAL_cert_test_sources)
53 $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_executables := $(LOCAL_host_executables)
54 $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_python_extension_libraries := $(LOCAL_host_python_extension_libraries)
55 $(bluetooth_cert_src_and_bin_zip): PRIVATE_host_libraries := $(LOCAL_host_libraries)
56 $(bluetooth_cert_src_and_bin_zip): PRIVATE_target_executables := $(LOCAL_target_executables)
57 $(bluetooth_cert_src_and_bin_zip): PRIVATE_target_libraries := $(LOCAL_target_libraries)
58 $(bluetooth_cert_src_and_bin_zip): $(SOONG_ZIP) $(LOCAL_cert_test_sources) \
59                 $(LOCAL_host_executables) $(LOCAL_host_libraries) $(LOCAL_host_python_extension_libraries) \
60                 $(LOCAL_target_executables) $(LOCAL_target_libraries)
61         $(hide) $(SOONG_ZIP) -d -o $@ \
62                 -C system/bt/gd $(addprefix -f ,$(PRIVATE_cert_test_sources)) \
63                 -C $(HOST_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_host_executables)) \
64                 -C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_python_extension_libraries)) \
65                 -P lib64 \
66                 -C $(HOST_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_host_libraries)) \
67                 -P target \
68                 -C $(TARGET_OUT_EXECUTABLES) $(addprefix -f ,$(PRIVATE_target_executables)) \
69                 -C $(TARGET_OUT_SHARED_LIBRARIES) $(addprefix -f ,$(PRIVATE_target_libraries))
70
71 # TODO: Find a better way to locate output from SOONG genrule()
72 LOCAL_cert_generated_py_zip := \
73         $(SOONG_OUT_DIR)/.intermediates/system/bt/gd/BluetoothFacadeAndCertGeneratedStub_py/gen/bluetooth_cert_generated_py.zip
74
75 LOCAL_acts_zip := $(HOST_OUT)/acts-dist/acts.zip
76
77 bluetooth_cert_tests_py_package_zip := \
78         $(call intermediates-dir-for,PACKAGING,bluetooth_cert_tests_py_package,HOST)/bluetooth_cert_tests.zip
79
80 $(bluetooth_cert_tests_py_package_zip): PRIVATE_cert_src_and_bin_zip := $(bluetooth_cert_src_and_bin_zip)
81 $(bluetooth_cert_tests_py_package_zip): PRIVATE_acts_zip := $(LOCAL_acts_zip)
82 $(bluetooth_cert_tests_py_package_zip): PRIVATE_cert_generated_py_zip := $(LOCAL_cert_generated_py_zip)
83 $(bluetooth_cert_tests_py_package_zip): $(SOONG_ZIP) $(LOCAL_acts_zip) \
84                 $(bluetooth_cert_src_and_bin_zip) $(bluetooth_cert_generated_py_zip)
85         @echo "Packaging Bluetooth Cert Tests into $@"
86         @rm -rf $(dir $@)bluetooth_cert_tests
87         @rm -rf $(dir $@)acts
88         @mkdir -p $(dir $@)bluetooth_cert_tests
89         @mkdir -p $(dir $@)acts
90         $(hide) unzip -o -q $(PRIVATE_acts_zip) "tools/test/connectivity/acts/framework/*" -d $(dir $@)acts
91         $(hide) unzip -o -q $(PRIVATE_cert_src_and_bin_zip) -d $(dir $@)bluetooth_cert_tests
92         $(hide) unzip -o -q $(PRIVATE_cert_generated_py_zip) -d $(dir $@)bluetooth_cert_tests
93         # Make all subdirectory of gd Python pacakages except lib64 and target
94         $(hide) for f in `find $(dir $@)bluetooth_cert_tests -type d -name "*" \
95                                         -not -path "$(dir $@)bluetooth_cert_tests/target*" \
96                                         -not -path "$(dir $@)bluetooth_cert_tests/lib64*"` \
97                         ; do (touch -a $$f/__init__.py) ; done
98         $(hide) $(SOONG_ZIP) -d -o $@ -C $(dir $@)bluetooth_cert_tests -D $(dir $@)bluetooth_cert_tests \
99                 -P acts_framework \
100                 -C $(dir $@)acts/tools/test/connectivity/acts/framework -D $(dir $@)acts/tools/test/connectivity/acts/framework \
101                 -P llvm_binutils -C $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION) \
102                 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-cov \
103                 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-profdata \
104                 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/bin/llvm-symbolizer \
105                 -f $(LLVM_PREBUILTS_BASE)/linux-x86/$(LLVM_PREBUILTS_VERSION)/lib64/libc++.so.1
106
107 $(call dist-for-goals,bluetooth_stack_with_facade,$(bluetooth_cert_tests_py_package_zip):bluetooth_cert_tests.zip)