Luca Farsi | a677887 | 2024-02-12 10:28:13 -0800 | [diff] [blame^] | 1 | # Copyright (C) 2024 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | .PHONY: general-tests-shared-libs |
| 16 | |
| 17 | intermediates_dir := $(call intermediates-dir-for,PACKAGING,general-tests-shared-libs) |
| 18 | |
| 19 | general_tests_shared_libs_zip := $(PRODUCT_OUT)/general-tests_host-shared-libs.zip |
| 20 | |
| 21 | # Filter shared entries between general-tests and device-tests's HOST_SHARED_LIBRARY.FILES, |
| 22 | # to avoid warning about overriding commands. |
| 23 | my_host_shared_lib_for_general_tests := \ |
| 24 | $(foreach m,$(filter $(COMPATIBILITY.device-tests.HOST_SHARED_LIBRARY.FILES),\ |
| 25 | $(COMPATIBILITY.general-tests.HOST_SHARED_LIBRARY.FILES)),$(call word-colon,2,$(m))) |
| 26 | my_general_tests_shared_lib_files := \ |
| 27 | $(filter-out $(COMPATIBILITY.device-tests.HOST_SHARED_LIBRARY.FILES),\ |
| 28 | $(COMPATIBILITY.general-tests.HOST_SHARED_LIBRARY.FILES)) |
| 29 | |
| 30 | my_host_shared_lib_for_general_tests += $(call copy-many-files,$(my_general_tests_shared_lib_files)) |
| 31 | |
| 32 | $(general_tests_shared_libs_zip) : PRIVATE_INTERMEDIATES_DIR := $(intermediates_dir) |
| 33 | $(general_tests_shared_libs_zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_general_tests) |
| 34 | $(general_tests_shared_libs_zip) : PRIVATE_general_host_shared_libs_zip := $(general_tests_shared_libs_zip) |
| 35 | $(general_tests_shared_libs_zip) : $(my_host_shared_lib_for_general_tests) $(SOONG_ZIP) |
| 36 | rm -rf $(PRIVATE_INTERMEDIATES_DIR) |
| 37 | mkdir -p $(PRIVATE_INTERMEDIATES_DIR) $(PRIVATE_INTERMEDIATES_DIR)/tools |
| 38 | $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ |
| 39 | echo $$shared_lib >> $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list; \ |
| 40 | done |
| 41 | grep $(HOST_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list > $(PRIVATE_INTERMEDIATES_DIR)/host-shared-libs.list || true |
| 42 | $(SOONG_ZIP) -d -o $(PRIVATE_general_host_shared_libs_zip) \ |
| 43 | -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host-shared-libs.list |
| 44 | |
| 45 | general-tests-shared-libs: $(general_tests_shared_libs_zip) |
| 46 | $(call dist-for-goals, general-tests-shared-libs, $(general_tests_shared_libs_zip)) |
| 47 | |
| 48 | $(call declare-1p-container,$(general_tests_shared_libs_zip),) |
| 49 | $(call declare-container-license-deps,$(general_tests_shared_libs_zip),$(my_host_shared_lib_for_general_tests),$(PRODUCT_OUT)/:/) |
| 50 | |
| 51 | intermediates_dir := |
| 52 | general_tests_shared_libs_zip := |