2014-09-13 20:26:39 +02:00
|
|
|
#
|
|
|
|
# Copyright (C) 2014 The Android Open Source Project
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Set up variables and dependency for one odex file
|
|
|
|
# Input variables: my_2nd_arch_prefix
|
|
|
|
# Output(modified) variables: built_odex, installed_odex, built_installed_odex
|
|
|
|
|
|
|
|
my_built_odex := $(call get-odex-file-path,$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH),$(LOCAL_BUILT_MODULE))
|
|
|
|
ifdef LOCAL_DEX_PREOPT_IMAGE_LOCATION
|
|
|
|
my_dex_preopt_image_location := $(LOCAL_DEX_PREOPT_IMAGE_LOCATION)
|
|
|
|
else
|
|
|
|
my_dex_preopt_image_location := $($(my_2nd_arch_prefix)DEFAULT_DEX_PREOPT_BUILT_IMAGE_LOCATION)
|
|
|
|
endif
|
|
|
|
my_dex_preopt_image_filename := $(call get-image-file-path,$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH),$(my_dex_preopt_image_location))
|
|
|
|
$(my_built_odex): PRIVATE_2ND_ARCH_VAR_PREFIX := $(my_2nd_arch_prefix)
|
|
|
|
$(my_built_odex): PRIVATE_DEX_LOCATION := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
|
|
|
|
$(my_built_odex): PRIVATE_DEX_PREOPT_IMAGE_LOCATION := $(my_dex_preopt_image_location)
|
|
|
|
$(my_built_odex) : $($(my_2nd_arch_prefix)DEXPREOPT_ONE_FILE_DEPENDENCY_BUILT_BOOT_PREOPT) \
|
|
|
|
$(DEXPREOPT_ONE_FILE_DEPENDENCY_TOOLS) \
|
|
|
|
$(my_dex_preopt_image_filename)
|
|
|
|
|
2016-06-16 23:47:10 +02:00
|
|
|
my_installed_odex := $(call get-odex-installed-file-path,$($(my_2nd_arch_prefix)DEX2OAT_TARGET_ARCH),$(LOCAL_INSTALLED_MODULE))
|
|
|
|
|
2016-09-12 17:43:28 +02:00
|
|
|
my_built_vdex := $(patsubst %.odex,%.vdex,$(my_built_odex))
|
|
|
|
my_installed_vdex := $(patsubst %.odex,%.vdex,$(my_installed_odex))
|
2017-02-09 03:30:31 +01:00
|
|
|
my_installed_art := $(patsubst %.odex,%.art,$(my_installed_odex))
|
|
|
|
|
2017-02-28 20:17:32 +01:00
|
|
|
ifndef LOCAL_DEX_PREOPT_APP_IMAGE
|
|
|
|
# Local override not defined, use the global one.
|
|
|
|
ifeq (true,$(WITH_DEX_PREOPT_APP_IMAGE))
|
|
|
|
LOCAL_DEX_PREOPT_APP_IMAGE := true
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq (true,$(LOCAL_DEX_PREOPT_APP_IMAGE))
|
2017-02-09 03:30:31 +01:00
|
|
|
my_built_art := $(patsubst %.odex,%.art,$(my_built_odex))
|
|
|
|
$(my_built_odex): PRIVATE_ART_FILE_PREOPT_FLAGS := --app-image-file=$(my_built_art) \
|
|
|
|
--image-format=lz4
|
|
|
|
$(eval $(call copy-one-file,$(my_built_art),$(my_installed_art)))
|
|
|
|
built_art += $(my_built_art)
|
|
|
|
installed_art += $(my_installed_art)
|
|
|
|
built_installed_art += $(my_built_art):$(my_installed_art)
|
|
|
|
endif
|
2016-09-12 17:43:28 +02:00
|
|
|
|
2016-06-16 23:47:10 +02:00
|
|
|
$(eval $(call copy-one-file,$(my_built_odex),$(my_installed_odex)))
|
2016-09-12 17:43:28 +02:00
|
|
|
$(eval $(call copy-one-file,$(my_built_vdex),$(my_installed_vdex)))
|
2014-09-13 20:26:39 +02:00
|
|
|
|
|
|
|
built_odex += $(my_built_odex)
|
2016-09-12 17:43:28 +02:00
|
|
|
built_vdex += $(my_built_vdex)
|
2016-08-25 14:50:15 +02:00
|
|
|
|
2014-09-13 20:26:39 +02:00
|
|
|
installed_odex += $(my_installed_odex)
|
2016-09-12 17:43:28 +02:00
|
|
|
installed_vdex += $(my_installed_vdex)
|
2016-08-25 14:50:15 +02:00
|
|
|
|
2014-09-13 20:26:39 +02:00
|
|
|
built_installed_odex += $(my_built_odex):$(my_installed_odex)
|
2016-08-25 14:50:15 +02:00
|
|
|
built_installed_vdex += $(my_built_vdex):$(my_installed_vdex)
|