Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 1 | # Copyright (C) 2017 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 | current_makefile := $(lastword $(MAKEFILE_LIST)) |
| 16 | |
| 17 | # BOARD_VNDK_VERSION must be set to 'current' in order to generate a VNDK snapshot. |
| 18 | ifeq ($(BOARD_VNDK_VERSION),current) |
| 19 | |
Jae Shin | 0b1792e | 2017-12-21 19:04:13 +0900 | [diff] [blame] | 20 | # PLATFORM_VNDK_VERSION must be set. |
| 21 | ifneq (,$(PLATFORM_VNDK_VERSION)) |
| 22 | |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 23 | # BOARD_VNDK_RUNTIME_DISABLE must not be set to 'true'. |
| 24 | ifneq ($(BOARD_VNDK_RUNTIME_DISABLE),true) |
| 25 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 26 | # Returns arch-specific libclang_rt.ubsan* library name. |
| 27 | # Because VNDK_CORE_LIBRARIES includes all arch variants for libclang_rt.ubsan* |
| 28 | # libs, the arch-specific libs are selected separately. |
| 29 | # |
| 30 | # Args: |
| 31 | # $(1): if not empty, evaluates for TARGET_2ND_ARCH |
| 32 | define clang-ubsan-vndk-core |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 33 | $(strip \ |
| 34 | $(eval prefix := $(if $(1),2ND_,)) \ |
| 35 | $(addsuffix .vendor,$($(addprefix $(prefix),UBSAN_RUNTIME_LIBRARY))) \ |
| 36 | ) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 37 | endef |
| 38 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 39 | # Returns list of src:dest paths of the intermediate objs |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 40 | # |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 41 | # Args: |
Jae Shin | 77c07dd | 2017-12-22 11:24:00 +0900 | [diff] [blame] | 42 | # $(1): list of module and filename pairs (e.g., ld.config.txt:ld.config.27.txt ...) |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 43 | # $(2): if not empty, evaluates for TARGET_2ND_ARCH |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 44 | define paths-of-intermediates |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 45 | $(strip \ |
Jae Shin | 77c07dd | 2017-12-22 11:24:00 +0900 | [diff] [blame] | 46 | $(foreach pair,$(1), \ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 47 | $(eval module := $(call word-colon,1,$(pair))$(if $(2),$(TARGET_2ND_ARCH_MODULE_SUFFIX))) \ |
| 48 | $(eval built := $(ALL_MODULES.$(module).BUILT_INSTALLED)) \ |
| 49 | $(eval filename := $(call word-colon,2,$(pair))) \ |
| 50 | $(if $(wordlist 2,100,$(built)), \ |
| 51 | $(error Unable to handle multiple built files ($(module)): $(built))) \ |
| 52 | $(if $(built),$(call word-colon,1,$(built)):$(filename)) \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 53 | ) \ |
| 54 | ) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 55 | endef |
| 56 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 57 | # Returns src:dest list of notice files |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 58 | # |
| 59 | # Args: |
| 60 | # $(1): list of lib names (e.g., libfoo.vendor) |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 61 | define paths-of-notice-files |
| 62 | $(strip \ |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 63 | $(foreach lib,$(1), \ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 64 | $(eval notice := $(sort \ |
| 65 | $(ALL_MODULES.$(lib).NOTICES) \ |
| 66 | $(if $(TARGET_2ND_ARCH), |
| 67 | $(ALL_MODULES.$(lib)$(TARGET_2ND_ARCH_MODULE_SUFFIX).NOTICES)))) \ |
| 68 | $(if $(wordlist 2,100,$(notice)), \ |
| 69 | $(error Unable to handle multiple notice files ($(lib)): $(notice))) \ |
| 70 | $(if $(notice),$(notice):$(subst .vendor,,$(lib)).so.txt))) |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 71 | endef |
| 72 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 73 | # If in the future libclang_rt.ubsan* is removed from the VNDK-core list, |
| 74 | # need to update the related logic in this file. |
| 75 | ifeq (,$(filter libclang_rt.ubsan%,$(VNDK_CORE_LIBRARIES))) |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 76 | $(warning libclang_rt.ubsan* is no longer a VNDK-core library. Please update this file.) |
| 77 | vndk_core_libs := $(addsuffix .vendor,$(VNDK_CORE_LIBRARIES)) |
| 78 | else |
| 79 | vndk_core_libs := $(addsuffix .vendor,$(filter-out libclang_rt.ubsan%,$(VNDK_CORE_LIBRARIES))) |
| 80 | |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 81 | vndk_core_libs += $(call clang-ubsan-vndk-core) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 82 | ifdef TARGET_2ND_ARCH |
| 83 | vndk_core_libs += $(call clang-ubsan-vndk-core,true) |
| 84 | endif |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 85 | endif |
| 86 | |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 87 | vndk_sp_libs := $(addsuffix .vendor,$(VNDK_SAMEPROCESS_LIBRARIES)) |
| 88 | vndk_private_libs := $(addsuffix .vendor,$(VNDK_PRIVATE_LIBRARIES)) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 89 | |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 90 | vndk_snapshot_libs := \ |
| 91 | $(vndk_core_libs) \ |
| 92 | $(vndk_sp_libs) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 93 | |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 94 | vndk_prebuilt_txts := \ |
| 95 | ld.config.txt \ |
| 96 | vndksp.libraries.txt \ |
| 97 | llndk.libraries.txt |
| 98 | |
| 99 | vndk_snapshot_top := $(call intermediates-dir-for,PACKAGING,vndk-snapshot) |
| 100 | vndk_snapshot_out := $(vndk_snapshot_top)/vndk-snapshot |
| 101 | vndk_snapshot_configs_out := $(vndk_snapshot_top)/configs |
| 102 | |
| 103 | ####################################### |
| 104 | # vndkcore.libraries.txt |
| 105 | vndkcore.libraries.txt := $(vndk_snapshot_configs_out)/vndkcore.libraries.txt |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 106 | $(vndkcore.libraries.txt): PRIVATE_LIBS := $(vndk_core_libs) |
| 107 | $(vndkcore.libraries.txt): |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 108 | @echo 'Generating: $@' |
| 109 | @rm -f $@ |
| 110 | @mkdir -p $(dir $@) |
| 111 | $(hide) echo -n > $@ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 112 | $(hide) $(foreach lib,$(PRIVATE_LIBS),echo $(patsubst %.vendor,%,$(lib)).so >> $@;) |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 113 | |
| 114 | |
| 115 | ####################################### |
| 116 | # vndkprivate.libraries.txt |
| 117 | vndkprivate.libraries.txt := $(vndk_snapshot_configs_out)/vndkprivate.libraries.txt |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 118 | $(vndkprivate.libraries.txt): PRIVATE_LIBS := $(vndk_private_libs) |
| 119 | $(vndkprivate.libraries.txt): |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 120 | @echo 'Generating: $@' |
| 121 | @rm -f $@ |
| 122 | @mkdir -p $(dir $@) |
| 123 | $(hide) echo -n > $@ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 124 | $(hide) $(foreach lib,$(PRIVATE_LIBS),echo $(patsubst %.vendor,%,$(lib)).so >> $@;) |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 125 | |
| 126 | |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 127 | ####################################### |
| 128 | # module_paths.txt |
| 129 | module_paths.txt := $(vndk_snapshot_configs_out)/module_paths.txt |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 130 | $(module_paths.txt): PRIVATE_LIBS := $(vndk_snapshot_libs) |
| 131 | $(module_paths.txt): |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 132 | @echo 'Generating: $@' |
| 133 | @rm -f $@ |
| 134 | @mkdir -p $(dir $@) |
| 135 | $(hide) echo -n > $@ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 136 | $(hide) $(foreach lib,$(PRIVATE_LIBS),echo $(patsubst %.vendor,%,$(lib)).so $(ALL_MODULES.$(lib).PATH) >> $@;) |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 137 | |
| 138 | |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 139 | vndk_snapshot_configs := \ |
| 140 | $(vndkcore.libraries.txt) \ |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 141 | $(vndkprivate.libraries.txt) \ |
| 142 | $(module_paths.txt) |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 143 | |
| 144 | ####################################### |
| 145 | # vndk_snapshot_zip |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 146 | vndk_snapshot_variant := $(vndk_snapshot_out)/$(TARGET_ARCH) |
Jae Shin | f20605c | 2018-05-30 21:01:29 +0900 | [diff] [blame] | 147 | binder := |
| 148 | ifneq ($(TARGET_USES_64_BIT_BINDER), true) |
| 149 | binder := binder32 |
| 150 | endif |
| 151 | vndk_lib_dir := $(subst $(space),/,$(strip $(vndk_snapshot_variant) $(binder) arch-$(TARGET_ARCH)-$(TARGET_ARCH_VARIANT))) |
| 152 | vndk_lib_dir_2nd := $(subst $(space),/,$(strip $(vndk_snapshot_variant) $(binder) arch-$(TARGET_2ND_ARCH)-$(TARGET_2ND_ARCH_VARIANT))) |
| 153 | vndk_snapshot_zip := $(PRODUCT_OUT)/android-vndk-$(TARGET_PRODUCT).zip |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 154 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 155 | $(vndk_snapshot_zip): PRIVATE_VNDK_SNAPSHOT_OUT := $(vndk_snapshot_out) |
| 156 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 157 | deps := $(call paths-of-intermediates,$(foreach lib,$(vndk_core_libs),$(lib):$(subst .vendor,,$(lib)).so)) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 158 | $(vndk_snapshot_zip): PRIVATE_VNDK_CORE_OUT := $(vndk_lib_dir)/shared/vndk-core |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 159 | $(vndk_snapshot_zip): PRIVATE_VNDK_CORE_INTERMEDIATES := $(deps) |
| 160 | $(vndk_snapshot_zip): $(foreach d,$(deps),$(call word-colon,1,$(d))) |
| 161 | deps := |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 162 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 163 | deps := $(call paths-of-intermediates,$(foreach lib,$(vndk_sp_libs),$(lib):$(subst .vendor,,$(lib)).so)) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 164 | $(vndk_snapshot_zip): PRIVATE_VNDK_SP_OUT := $(vndk_lib_dir)/shared/vndk-sp |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 165 | $(vndk_snapshot_zip): PRIVATE_VNDK_SP_INTERMEDIATES := $(deps) |
| 166 | $(vndk_snapshot_zip): $(foreach d,$(deps),$(call word-colon,1,$(d))) |
| 167 | deps := |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 168 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 169 | deps := $(call paths-of-intermediates,$(foreach txt,$(vndk_prebuilt_txts), \ |
| 170 | $(txt):$(patsubst %.txt,%.$(PLATFORM_VNDK_VERSION).txt,$(txt)))) \ |
| 171 | $(foreach config,$(vndk_snapshot_configs),$(config):$(notdir $(config))) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 172 | $(vndk_snapshot_zip): PRIVATE_CONFIGS_OUT := $(vndk_snapshot_variant)/configs |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 173 | $(vndk_snapshot_zip): PRIVATE_CONFIGS_INTERMEDIATES := $(deps) |
| 174 | $(vndk_snapshot_zip): $(foreach d,$(deps),$(call word-colon,1,$(d))) |
| 175 | deps := |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 176 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 177 | notices := $(call paths-of-notice-files,$(vndk_core_libs) $(vndk_sp_libs)) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 178 | $(vndk_snapshot_zip): PRIVATE_NOTICE_FILES_OUT := $(vndk_snapshot_variant)/NOTICE_FILES |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 179 | $(vndk_snapshot_zip): PRIVATE_NOTICE_FILES_INTERMEDIATES := $(notices) |
| 180 | $(vndk_snapshot_zip): $(foreach n,$(notices),$(call word-colon,1,$(n))) |
| 181 | notices := |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 182 | |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 183 | ifdef TARGET_2ND_ARCH |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 184 | deps := $(call paths-of-intermediates,$(foreach lib,$(vndk_core_libs),$(lib):$(subst .vendor,,$(lib)).so),true) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 185 | $(vndk_snapshot_zip): PRIVATE_VNDK_CORE_OUT_2ND := $(vndk_lib_dir_2nd)/shared/vndk-core |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 186 | $(vndk_snapshot_zip): PRIVATE_VNDK_CORE_INTERMEDIATES_2ND := $(deps) |
| 187 | $(vndk_snapshot_zip): $(foreach d,$(deps),$(call word-colon,1,$(d))) |
| 188 | deps := |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 189 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 190 | deps := $(call paths-of-intermediates,$(foreach lib,$(vndk_sp_libs),$(lib):$(subst .vendor,,$(lib)).so),true) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 191 | $(vndk_snapshot_zip): PRIVATE_VNDK_SP_OUT_2ND := $(vndk_lib_dir_2nd)/shared/vndk-sp |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 192 | $(vndk_snapshot_zip): PRIVATE_VNDK_SP_INTERMEDIATES_2ND := $(deps) |
| 193 | $(vndk_snapshot_zip): $(foreach d,$(deps),$(call word-colon,1,$(d))) |
| 194 | deps := |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 195 | endif |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 196 | |
| 197 | # Args |
| 198 | # $(1): destination directory |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 199 | # $(2): list of files (src:dest) to copy |
| 200 | $(vndk_snapshot_zip): private-copy-intermediates = \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 201 | $(if $(2),$(strip \ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 202 | @mkdir -p $(1) && \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 203 | $(foreach file,$(2), \ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 204 | cp $(call word-colon,1,$(file)) $(call append-path,$(1),$(call word-colon,2,$(file))) && \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 205 | ) \ |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 206 | true \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 207 | )) |
| 208 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 209 | |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 210 | $(vndk_snapshot_zip): $(SOONG_ZIP) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 211 | @echo 'Generating VNDK snapshot: $@' |
| 212 | @rm -f $@ |
| 213 | @rm -rf $(PRIVATE_VNDK_SNAPSHOT_OUT) |
| 214 | @mkdir -p $(PRIVATE_VNDK_SNAPSHOT_OUT) |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 215 | $(call private-copy-intermediates, \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 216 | $(PRIVATE_VNDK_CORE_OUT),$(PRIVATE_VNDK_CORE_INTERMEDIATES)) |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 217 | $(call private-copy-intermediates, \ |
Jae Shin | c13c0ea | 2017-12-04 13:16:21 +0900 | [diff] [blame] | 218 | $(PRIVATE_VNDK_SP_OUT),$(PRIVATE_VNDK_SP_INTERMEDIATES)) |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 219 | $(call private-copy-intermediates, \ |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 220 | $(PRIVATE_CONFIGS_OUT),$(PRIVATE_CONFIGS_INTERMEDIATES)) |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 221 | $(call private-copy-intermediates, \ |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 222 | $(PRIVATE_NOTICE_FILES_OUT),$(PRIVATE_NOTICE_FILES_INTERMEDIATES)) |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 223 | ifdef TARGET_2ND_ARCH |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 224 | $(call private-copy-intermediates, \ |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 225 | $(PRIVATE_VNDK_CORE_OUT_2ND),$(PRIVATE_VNDK_CORE_INTERMEDIATES_2ND)) |
Dan Willemsen | 6493118 | 2018-06-17 21:47:18 -0700 | [diff] [blame^] | 226 | $(call private-copy-intermediates, \ |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 227 | $(PRIVATE_VNDK_SP_OUT_2ND),$(PRIVATE_VNDK_SP_INTERMEDIATES_2ND)) |
| 228 | endif |
Jae Shin | c13c0ea | 2017-12-04 13:16:21 +0900 | [diff] [blame] | 229 | $(hide) $(SOONG_ZIP) -o $@ -C $(PRIVATE_VNDK_SNAPSHOT_OUT) -D $(PRIVATE_VNDK_SNAPSHOT_OUT) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 230 | |
| 231 | .PHONY: vndk |
| 232 | vndk: $(vndk_snapshot_zip) |
| 233 | |
| 234 | $(call dist-for-goals, vndk, $(vndk_snapshot_zip)) |
| 235 | |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 236 | # clear global vars |
| 237 | clang-ubsan-vndk-core := |
| 238 | paths-of-intermediates := |
Jae Shin | 410a1af | 2017-12-15 19:35:16 +0900 | [diff] [blame] | 239 | paths-of-notice-files := |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 240 | vndk_core_libs := |
| 241 | vndk_sp_libs := |
| 242 | vndk_snapshot_libs := |
| 243 | vndk_prebuilt_txts := |
| 244 | vndk_snapshot_configs := |
| 245 | vndk_snapshot_top := |
| 246 | vndk_snapshot_out := |
| 247 | vndk_snapshot_configs_out := |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 248 | vndk_snapshot_variant := |
Jae Shin | f20605c | 2018-05-30 21:01:29 +0900 | [diff] [blame] | 249 | binder := |
Jae Shin | 893fca6 | 2017-12-28 16:00:10 +0900 | [diff] [blame] | 250 | vndk_lib_dir := |
| 251 | vndk_lib_dir_2nd := |
Jae Shin | 4736dc1 | 2017-11-22 19:25:36 +0900 | [diff] [blame] | 252 | |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 253 | else # BOARD_VNDK_RUNTIME_DISABLE is set to 'true' |
| 254 | error_msg := "CANNOT generate VNDK snapshot. BOARD_VNDK_RUNTIME_DISABLE must not be set to 'true'." |
| 255 | endif # BOARD_VNDK_RUNTIME_DISABLE |
| 256 | |
Jae Shin | 0b1792e | 2017-12-21 19:04:13 +0900 | [diff] [blame] | 257 | else # PLATFORM_VNDK_VERSION is NOT set |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 258 | error_msg := "CANNOT generate VNDK snapshot. PLATFORM_VNDK_VERSION must be set." |
Jae Shin | 0b1792e | 2017-12-21 19:04:13 +0900 | [diff] [blame] | 259 | endif # PLATFORM_VNDK_VERSION |
| 260 | |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 261 | else # BOARD_VNDK_VERSION is NOT set to 'current' |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 262 | error_msg := "CANNOT generate VNDK snapshot. BOARD_VNDK_VERSION must be set to 'current'." |
| 263 | endif # BOARD_VNDK_VERSION |
| 264 | |
| 265 | ifneq (,$(error_msg)) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 266 | |
| 267 | .PHONY: vndk |
| 268 | vndk: |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 269 | $(call echo-error,$(current_makefile),$(error_msg)) |
Jae Shin | e6b7c84 | 2017-10-20 17:46:46 +0900 | [diff] [blame] | 270 | exit 1 |
| 271 | |
Justin Yun | 4dff0c6 | 2018-01-04 10:51:16 +0900 | [diff] [blame] | 272 | endif |