blob: 82f5f8de90d9c7f1528c561362a013bd25632956 [file] [log] [blame]
Brian Carlstromced4bff2013-11-14 23:44:56 -08001# dexpreopt_odex_install.mk is used to define odex creation rules for JARs and APKs
2# This file depends on variables set in base_rules.mk
Nicolas Geoffray3972a472018-01-09 11:46:30 +00003# Output variables: LOCAL_DEX_PREOPT, LOCAL_UNCOMPRESS_DEX, built_odex,
4# dexpreopt_boot_jar_module
5
6# We explicitly uncompress APKs of privileged apps, and used by
7# privileged apps
8LOCAL_UNCOMPRESS_DEX := false
9ifneq (true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS))
10ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
11 LOCAL_UNCOMPRESS_DEX := true
12else
13 ifneq (,$(filter $(PRODUCT_LOADED_BY_PRIVILEGED_MODULES), $(LOCAL_MODULE)))
14 LOCAL_UNCOMPRESS_DEX := true
15 endif # PRODUCT_LOADED_BY_PRIVILEGED_MODULES
16endif # LOCAL_PRIVILEGED_MODULE
17endif # DONT_UNCOMPRESS_PRIV_APPS_DEXS
Brian Carlstromced4bff2013-11-14 23:44:56 -080018
19# Setting LOCAL_DEX_PREOPT based on WITH_DEXPREOPT, LOCAL_DEX_PREOPT, etc
20LOCAL_DEX_PREOPT := $(strip $(LOCAL_DEX_PREOPT))
21ifneq (true,$(WITH_DEXPREOPT))
22 LOCAL_DEX_PREOPT :=
23else # WITH_DEXPREOPT=true
24 ifeq (,$(TARGET_BUILD_APPS)) # TARGET_BUILD_APPS empty
Ying Wang9db168c2014-01-03 16:24:56 -080025 ifndef LOCAL_DEX_PREOPT # LOCAL_DEX_PREOPT undefined
Ying Wangedfd55a2014-07-09 10:57:32 -070026 ifneq ($(filter $(TARGET_OUT)/%,$(my_module_path)),) # Installed to system.img.
27 ifeq (,$(LOCAL_APK_LIBRARIES)) # LOCAL_APK_LIBRARIES empty
Ying Wang20ebd2e2014-10-07 18:07:23 -070028 # If we have product-specific config for this module?
29 ifeq (disable,$(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG))
30 LOCAL_DEX_PREOPT := false
31 else
32 LOCAL_DEX_PREOPT := $(DEX_PREOPT_DEFAULT)
33 endif
Ying Wangedfd55a2014-07-09 10:57:32 -070034 else # LOCAL_APK_LIBRARIES not empty
35 LOCAL_DEX_PREOPT := nostripping
36 endif # LOCAL_APK_LIBRARIES not empty
37 endif # Installed to system.img.
Ying Wang9db168c2014-01-03 16:24:56 -080038 endif # LOCAL_DEX_PREOPT undefined
Brian Carlstromced4bff2013-11-14 23:44:56 -080039 endif # TARGET_BUILD_APPS empty
40endif # WITH_DEXPREOPT=true
41ifeq (false,$(LOCAL_DEX_PREOPT))
42 LOCAL_DEX_PREOPT :=
43endif
44ifdef LOCAL_UNINSTALLABLE_MODULE
45LOCAL_DEX_PREOPT :=
46endif
Colin Crossf229de42017-10-05 16:01:00 -070047ifeq (,$(strip $(built_dex)$(my_prebuilt_src_file)$(LOCAL_SOONG_DEX_JAR))) # contains no java code
Brian Carlstromced4bff2013-11-14 23:44:56 -080048LOCAL_DEX_PREOPT :=
49endif
Mathieu Chartier418258c2017-08-28 14:19:35 -070050# if WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY=true and module is not in boot class path skip
51# Also preopt system server jars since selinux prevents system server from loading anything from
52# /data. If we don't do this they will need to be extracted which is not favorable for RAM usage
Mathieu Chartier0fbb8362017-09-15 13:40:48 -070053# or performance. If my_preopt_for_extracted_apk is true, we ignore the only preopt boot image
54# options.
55ifneq (true,$(my_preopt_for_extracted_apk))
Mathieu Chartier418258c2017-08-28 14:19:35 -070056ifeq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
57ifeq ($(filter $(PRODUCT_SYSTEM_SERVER_JARS) $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE)),)
Alex Light7326f7b2014-08-04 17:09:41 -070058LOCAL_DEX_PREOPT :=
59endif
60endif
Mathieu Chartier0fbb8362017-09-15 13:40:48 -070061endif
62
Alex Light4e358ab2016-06-16 14:47:10 -070063ifeq ($(LOCAL_DEX_PREOPT),true)
Nicolas Geoffray3972a472018-01-09 11:46:30 +000064
65# Don't strip with dexes we explicitly uncompress (dexopt will not store the dex code).
66ifeq ($(LOCAL_UNCOMPRESS_DEX),true)
67LOCAL_DEX_PREOPT := nostripping
68endif # LOCAL_UNCOMPRESS_DEX
69
70# system_other isn't there for an OTA, so don't strip
71# if module is on system, and odex is on system_other.
72ifeq ($(BOARD_USES_SYSTEM_OTHER_ODEX),true)
Nicolas Geoffraycdd43432017-03-24 14:45:59 +000073ifneq ($(call install-on-system-other, $(my_module_path)),)
Alex Light4e358ab2016-06-16 14:47:10 -070074LOCAL_DEX_PREOPT := nostripping
Nicolas Geoffray3972a472018-01-09 11:46:30 +000075endif # install-on-system-other
76endif # BOARD_USES_SYSTEM_OTHER_ODEX
77
78# We also don't strip if all dexs are uncompressed (dexopt will not store the dex code),
79# but that requires to inspect the source file, which is too early at this point (as we
80# don't know if the source file will actually be used).
81# See dexpreopt-remove-classes.dex.
82
83endif # LOCAL_DEX_PREOPT
Brian Carlstromced4bff2013-11-14 23:44:56 -080084
85built_odex :=
David Brazdil70470162016-08-25 13:50:15 +010086built_vdex :=
Mathieu Chartier192b91c2017-02-08 18:30:31 -080087built_art :=
Brian Carlstromced4bff2013-11-14 23:44:56 -080088installed_odex :=
David Brazdil70470162016-08-25 13:50:15 +010089installed_vdex :=
Mathieu Chartier192b91c2017-02-08 18:30:31 -080090installed_art :=
Ying Wang74c98502014-05-19 13:03:36 -070091built_installed_odex :=
David Brazdil70470162016-08-25 13:50:15 +010092built_installed_vdex :=
Mathieu Chartier192b91c2017-02-08 18:30:31 -080093built_installed_art :=
94
Mathieu Chartier6324c2d2017-05-05 17:22:37 -070095ifeq (false,$(WITH_DEX_PREOPT_GENERATE_PROFILE))
96LOCAL_DEX_PREOPT_GENERATE_PROFILE := false
97endif
98
99ifndef LOCAL_DEX_PREOPT_GENERATE_PROFILE
100# If LOCAL_DEX_PREOPT_GENERATE_PROFILE is not defined, default it based on the existence of the
101# profile class listing. TODO: Use product specific directory here.
102my_classes_directory := $(PRODUCT_DEX_PREOPT_PROFILE_DIR)
103LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING := $(my_classes_directory)/$(LOCAL_MODULE).prof.txt
104ifneq (,$(wildcard $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)))
105# Profile listing exists, use it to generate the profile.
Mathieu Chartier6324c2d2017-05-05 17:22:37 -0700106LOCAL_DEX_PREOPT_GENERATE_PROFILE := true
107endif
108endif
Mathieu Chartier48762292017-09-13 22:08:45 -0700109
110ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
111
112ifdef LOCAL_VENDOR_MODULE
113$(call pretty-error, Internal error: profiles are not supported for vendor modules)
114else
115LOCAL_DEX_PREOPT_APP_IMAGE := true
Mathieu Chartier44c9c072017-05-09 19:17:33 -0700116endif
Mathieu Chartier6324c2d2017-05-05 17:22:37 -0700117
Mathieu Chartier48762292017-09-13 22:08:45 -0700118ifndef LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING
119$(call pretty-error,Must have specified class listing (LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING))
120endif
121ifeq (,$(dex_preopt_profile_src_file))
122$(call pretty-error, Internal error: dex_preopt_profile_src_file must be set)
123endif
124my_built_profile := $(dir $(LOCAL_BUILT_MODULE))/profile.prof
125my_dex_location := $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))
126# Remove compressed APK extension.
127my_dex_location := $(patsubst %.gz,%,$(my_dex_location))
128$(my_built_profile): PRIVATE_BUILT_MODULE := $(dex_preopt_profile_src_file)
129$(my_built_profile): PRIVATE_DEX_LOCATION := $(my_dex_location)
130$(my_built_profile): PRIVATE_SOURCE_CLASSES := $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)
131$(my_built_profile): $(LOCAL_DEX_PREOPT_PROFILE_CLASS_LISTING)
132$(my_built_profile): $(PROFMAN)
133$(my_built_profile): $(dex_preopt_profile_src_file)
134$(my_built_profile):
135 $(hide) mkdir -p $(dir $@)
136 ANDROID_LOG_TAGS="*:e" $(PROFMAN) \
137 --create-profile-from=$(PRIVATE_SOURCE_CLASSES) \
138 --apk=$(PRIVATE_BUILT_MODULE) \
139 --dex-location=$(PRIVATE_DEX_LOCATION) \
140 --reference-profile-file=$@
141dex_preopt_profile_src_file:=
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800142
143# Remove compressed APK extension.
Mathieu Chartier48762292017-09-13 22:08:45 -0700144my_installed_profile := $(patsubst %.gz,%,$(LOCAL_INSTALLED_MODULE)).prof
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800145
Mathieu Chartier48762292017-09-13 22:08:45 -0700146# my_installed_profile := $(LOCAL_INSTALLED_MODULE).prof
147$(eval $(call copy-one-file,$(my_built_profile),$(my_installed_profile)))
148build_installed_profile:=$(my_built_profile):$(my_installed_profile)
149else
150build_installed_profile:=
151my_installed_profile :=
152endif
153
154ifdef LOCAL_DEX_PREOPT
155
Brian Carlstromced4bff2013-11-14 23:44:56 -0800156dexpreopt_boot_jar_module := $(filter $(DEXPREOPT_BOOT_JARS_MODULES),$(LOCAL_MODULE))
Andreas Gampe039bb482018-01-19 10:56:23 -0800157
158# Filter org.apache.http.legacy.boot.
159ifeq ($(dexpreopt_boot_jar_module),org.apache.http.legacy.boot)
160dexpreopt_boot_jar_module :=
161endif
162
Brian Carlstromced4bff2013-11-14 23:44:56 -0800163ifdef dexpreopt_boot_jar_module
Brian Carlstromced4bff2013-11-14 23:44:56 -0800164# For libart, the boot jars' odex files are replaced by $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE).
165# We use this installed_odex trick to get boot.art installed.
166installed_odex := $(DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)
Ying Wangb9aa5d42014-05-13 13:57:28 -0700167# Append the odex for the 2nd arch if we have one.
168installed_odex += $($(TARGET_2ND_ARCH_VAR_PREFIX)DEFAULT_DEX_PREOPT_INSTALLED_IMAGE)
Brian Carlstromced4bff2013-11-14 23:44:56 -0800169else # boot jar
Ying Wangb9aa5d42014-05-13 13:57:28 -0700170ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES)
Ying Wangc7ca6172015-03-09 17:17:51 -0700171# For a Java library, by default we build odex for both 1st arch and 2nd arch.
172# But it can be overridden with "LOCAL_MULTILIB := first".
173ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE)))
174# For system server jars, we build for only "first".
175my_module_multilib := first
176else
177my_module_multilib := $(LOCAL_MULTILIB)
178endif
Ying Wangb9aa5d42014-05-13 13:57:28 -0700179# #################################################
180# Odex for the 1st arch
Ying Wangdb48da72014-09-13 11:26:39 -0700181my_2nd_arch_prefix :=
182include $(BUILD_SYSTEM)/setup_one_odex.mk
Ying Wangb9aa5d42014-05-13 13:57:28 -0700183# #################################################
184# Odex for the 2nd arch
185ifdef TARGET_2ND_ARCH
Ying Wang62630222016-04-20 11:53:39 -0700186ifneq ($(TARGET_TRANSLATE_2ND_ARCH),true)
Ying Wangc7ca6172015-03-09 17:17:51 -0700187ifneq (first,$(my_module_multilib))
Ying Wangdb48da72014-09-13 11:26:39 -0700188my_2nd_arch_prefix := $(TARGET_2ND_ARCH_VAR_PREFIX)
189include $(BUILD_SYSTEM)/setup_one_odex.mk
Ying Wangc7ca6172015-03-09 17:17:51 -0700190endif # my_module_multilib is not first.
Ying Wang62630222016-04-20 11:53:39 -0700191endif # TARGET_TRANSLATE_2ND_ARCH not true
Ying Wangb9aa5d42014-05-13 13:57:28 -0700192endif # TARGET_2ND_ARCH
193# #################################################
194else # must be APPS
Ying Wangdb48da72014-09-13 11:26:39 -0700195# The preferred arch
196my_2nd_arch_prefix := $(LOCAL_2ND_ARCH_VAR_PREFIX)
197include $(BUILD_SYSTEM)/setup_one_odex.mk
Ying Wang7a899192014-09-15 11:45:52 -0700198ifdef TARGET_2ND_ARCH
Ying Wangdb48da72014-09-13 11:26:39 -0700199ifeq ($(LOCAL_MULTILIB),both)
200# The non-preferred arch
201my_2nd_arch_prefix := $(if $(LOCAL_2ND_ARCH_VAR_PREFIX),,$(TARGET_2ND_ARCH_VAR_PREFIX))
202include $(BUILD_SYSTEM)/setup_one_odex.mk
203endif # LOCAL_MULTILIB is both
Ying Wang7a899192014-09-15 11:45:52 -0700204endif # TARGET_2ND_ARCH
Ying Wangb9aa5d42014-05-13 13:57:28 -0700205endif # LOCAL_MODULE_CLASS
Ying Wang7a899192014-09-15 11:45:52 -0700206endif # boot jar
Brian Carlstromced4bff2013-11-14 23:44:56 -0800207
Ying Wangfbc5b9f2016-03-11 10:32:01 -0800208built_odex := $(strip $(built_odex))
David Brazdil70470162016-08-25 13:50:15 +0100209built_vdex := $(strip $(built_vdex))
Mathieu Chartier192b91c2017-02-08 18:30:31 -0800210built_art := $(strip $(built_art))
Ying Wangfbc5b9f2016-03-11 10:32:01 -0800211installed_odex := $(strip $(installed_odex))
David Brazdil70470162016-08-25 13:50:15 +0100212installed_vdex := $(strip $(installed_vdex))
Mathieu Chartier192b91c2017-02-08 18:30:31 -0800213installed_art := $(strip $(installed_art))
Ying Wangfbc5b9f2016-03-11 10:32:01 -0800214
Brian Carlstromced4bff2013-11-14 23:44:56 -0800215ifdef built_odex
Mathieu Chartier2ac264f2017-03-03 11:17:36 -0800216ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
Mathieu Chartier2ac264f2017-03-03 11:17:36 -0800217$(built_odex): $(my_built_profile)
218$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS := --profile-file=$(my_built_profile)
Mathieu Chartier2ac264f2017-03-03 11:17:36 -0800219else
220$(built_odex): PRIVATE_PROFILE_PREOPT_FLAGS :=
221endif
222
Ying Wang20ebd2e2014-10-07 18:07:23 -0700223ifndef LOCAL_DEX_PREOPT_FLAGS
224LOCAL_DEX_PREOPT_FLAGS := $(DEXPREOPT.$(TARGET_PRODUCT).$(LOCAL_MODULE).CONFIG)
225ifndef LOCAL_DEX_PREOPT_FLAGS
226LOCAL_DEX_PREOPT_FLAGS := $(PRODUCT_DEX_PREOPT_DEFAULT_FLAGS)
227endif
228endif
Nicolas Geoffrayb08ada12017-03-22 12:36:05 +0000229
Mathieu Chartier6a902102017-06-23 10:44:45 -0700230my_system_server_compiler_filter := $(PRODUCT_SYSTEM_SERVER_COMPILER_FILTER)
231ifeq (,$(my_system_server_compiler_filter))
232my_system_server_compiler_filter := speed
233endif
234
Mathieu Chartiere8fb7cf2018-02-15 13:19:38 -0800235my_default_compiler_filter := $(PRODUCT_DEX_PREOPT_DEFAULT_COMPILER_FILTER)
236ifeq (,$(my_default_compiler_filter))
237# If no default compiler filter is specified, default to 'quicken' to save on storage.
238my_default_compiler_filter := quicken
239endif
240
Mathieu Chartierb8d3cc02017-06-16 11:17:53 -0700241ifeq (,$(filter --compiler-filter=%, $(LOCAL_DEX_PREOPT_FLAGS)))
Mathieu Chartier6a902102017-06-23 10:44:45 -0700242 ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE)))
243 # Jars of system server, use the product option if it is set, speed otherwise.
244 LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=$(my_system_server_compiler_filter)
Mathieu Chartierb8d3cc02017-06-16 11:17:53 -0700245 else
Mathieu Chartier6a902102017-06-23 10:44:45 -0700246 ifneq (,$(filter $(PRODUCT_DEXPREOPT_SPEED_APPS) $(PRODUCT_SYSTEM_SERVER_APPS),$(LOCAL_MODULE)))
247 # Apps loaded into system server, and apps the product default to being compiled with the
248 # 'speed' compiler filter.
249 LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed
Mathieu Chartierc5536ff2017-05-05 14:59:06 -0700250 else
Mathieu Chartier6a902102017-06-23 10:44:45 -0700251 ifeq (true,$(LOCAL_DEX_PREOPT_GENERATE_PROFILE))
252 # For non system server jars, use speed-profile when we have a profile.
253 LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=speed-profile
254 else
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800255 LOCAL_DEX_PREOPT_FLAGS += --compiler-filter=$(my_default_compiler_filter)
Mathieu Chartier6a902102017-06-23 10:44:45 -0700256 endif
Mathieu Chartierc5536ff2017-05-05 14:59:06 -0700257 endif
Nicolas Geoffray24f54692017-03-30 13:50:12 +0100258 endif
Nicolas Geoffrayb08ada12017-03-22 12:36:05 +0000259endif
260
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800261my_generate_dm := $(PRODUCT_DEX_PREOPT_GENERATE_DM_FILES)
262ifeq (,$(filter $(LOCAL_DEX_PREOPT_FLAGS),--compiler-filter=verify))
263# Generating DM files only makes sense for verify, avoid doing for non verify compiler filter APKs.
264my_generate_dm := false
265endif
266
267# No reason to use a dm file if the dex is already uncompressed.
268ifeq ($(LOCAL_UNCOMPRESS_DEX),true)
269my_generate_dm := false
270endif
271
272ifeq (true,$(my_generate_dm))
273LOCAL_DEX_PREOPT_FLAGS += --copy-dex-files=false
274LOCAL_DEX_PREOPT := nostripping
275my_built_dm := $(dir $(LOCAL_BUILT_MODULE))generated.dm
276my_installed_dm := $(patsubst %.apk,%,$(LOCAL_INSTALLED_MODULE)).dm
277my_copied_vdex := $(dir $(LOCAL_BUILT_MODULE))primary.vdex
278$(eval $(call copy-one-file,$(built_vdex),$(my_copied_vdex)))
279$(my_built_dm): PRIVATE_INPUT_VDEX := $(my_copied_vdex)
280$(my_built_dm): $(my_copied_vdex) $(ZIPTIME)
281 $(hide) mkdir -p $(dir $@)
282 $(hide) rm -f $@
283 $(hide) zip -qD -j -X -9 $@ $(PRIVATE_INPUT_VDEX)
284 $(ZIPTIME) $@
285$(eval $(call copy-one-file,$(my_built_dm),$(my_installed_dm)))
286endif
287
Andreas Gampecdfe46b2018-03-19 14:28:15 -0700288# By default, emit debug info.
289my_dexpreopt_debug_info := true
290# If the global setting suppresses mini-debug-info, disable it.
291ifeq (false,$(WITH_DEXPREOPT_DEBUG_INFO))
292 my_dexpreopt_debug_info := false
Mathieu Chartier94f5f932017-06-23 14:47:56 -0700293endif
294
Andreas Gampecdfe46b2018-03-19 14:28:15 -0700295# PRODUCT_SYSTEM_SERVER_DEBUG_INFO overrides WITH_DEXPREOPT_DEBUG_INFO.
296# PRODUCT_OTHER_JAVA_DEBUG_INFO overrides WITH_DEXPREOPT_DEBUG_INFO.
297ifneq (,$(filter $(PRODUCT_SYSTEM_SERVER_JARS),$(LOCAL_MODULE)))
298 ifeq (true,$(PRODUCT_SYSTEM_SERVER_DEBUG_INFO))
299 my_dexpreopt_debug_info := true
300 else ifeq (false,$(PRODUCT_SYSTEM_SERVER_DEBUG_INFO))
301 my_dexpreopt_debug_info := false
Mathieu Chartier94f5f932017-06-23 14:47:56 -0700302 endif
Andreas Gampecdfe46b2018-03-19 14:28:15 -0700303else
304 ifeq (true,$(PRODUCT_OTHER_JAVA_DEBUG_INFO))
305 my_dexpreopt_debug_info := true
306 else ifeq (false,$(PRODUCT_OTHER_JAVA_DEBUG_INFO))
307 my_dexpreopt_debug_info := false
308 endif
309endif
310
311# Never enable on eng.
312ifeq (eng,$(filter eng, $(TARGET_BUILD_VARIANT)))
313my_dexpreopt_debug_info := false
314endif
315
316# Add dex2oat flag for debug-info/no-debug-info.
317ifeq (true,$(my_dexpreopt_debug_info))
318 LOCAL_DEX_PREOPT_FLAGS += --generate-mini-debug-info
319else ifeq (false,$(my_dexpreopt_debug_info))
320 LOCAL_DEX_PREOPT_FLAGS += --no-generate-mini-debug-info
Mathieu Chartier94f5f932017-06-23 14:47:56 -0700321endif
322
Calin Juravle55f14922018-02-15 12:51:08 -0800323# Set the compiler reason to 'prebuilt' to identify the oat files produced
324# during the build, as opposed to compiled on the device.
325LOCAL_DEX_PREOPT_FLAGS += --compilation-reason=prebuilt
326
Ying Wang20ebd2e2014-10-07 18:07:23 -0700327$(built_odex): PRIVATE_DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
David Brazdil70470162016-08-25 13:50:15 +0100328$(built_vdex): $(built_odex)
Mathieu Chartier192b91c2017-02-08 18:30:31 -0800329$(built_art): $(built_odex)
Brian Carlstromced4bff2013-11-14 23:44:56 -0800330endif
331
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800332ifneq (true,$(my_generate_dm))
333 # Add the installed_odex to the list of installed files for this module if we aren't generating a
334 # dm file.
335 ALL_MODULES.$(my_register_name).INSTALLED += $(installed_odex)
336 ALL_MODULES.$(my_register_name).INSTALLED += $(installed_vdex)
337 ALL_MODULES.$(my_register_name).INSTALLED += $(installed_art)
Mathieu Chartier48762292017-09-13 22:08:45 -0700338
Mathieu Chartier5c658ac2018-02-15 13:19:38 -0800339 ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_odex)
340 ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_vdex)
341 ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(built_installed_art)
342
343 # Make sure to install the .odex and .vdex when you run "make <module_name>"
344 $(my_all_targets): $(installed_odex) $(installed_vdex) $(installed_art)
345else
346 ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed_dm)
347 ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(my_built_dm) $(my_installed_dm)
348
349 # Make sure to install the .dm when you run "make <module_name>"
350 $(my_all_targets): $(installed_dm)
351endif
Ying Wang74c98502014-05-19 13:03:36 -0700352
Ying Wangfbc5b9f2016-03-11 10:32:01 -0800353# Record dex-preopt config.
354DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT := $(LOCAL_DEX_PREOPT)
355DEXPREOPT.$(LOCAL_MODULE).MULTILIB := $(LOCAL_MULTILIB)
356DEXPREOPT.$(LOCAL_MODULE).DEX_PREOPT_FLAGS := $(LOCAL_DEX_PREOPT_FLAGS)
357DEXPREOPT.$(LOCAL_MODULE).PRIVILEGED_MODULE := $(LOCAL_PRIVILEGED_MODULE)
Dan Willemsen05a2b932017-03-20 18:31:17 -0700358DEXPREOPT.$(LOCAL_MODULE).VENDOR_MODULE := $(LOCAL_VENDOR_MODULE)
Ying Wangfbc5b9f2016-03-11 10:32:01 -0800359DEXPREOPT.$(LOCAL_MODULE).TARGET_ARCH := $(LOCAL_MODULE_TARGET_ARCH)
360DEXPREOPT.$(LOCAL_MODULE).INSTALLED := $(installed_odex)
361DEXPREOPT.$(LOCAL_MODULE).INSTALLED_STRIPPED := $(LOCAL_INSTALLED_MODULE)
362DEXPREOPT.MODULES.$(LOCAL_MODULE_CLASS) := $(sort \
363 $(DEXPREOPT.MODULES.$(LOCAL_MODULE_CLASS)) $(LOCAL_MODULE))
364
Brian Carlstromced4bff2013-11-14 23:44:56 -0800365endif # LOCAL_DEX_PREOPT
Mathieu Chartier48762292017-09-13 22:08:45 -0700366
367# Profile doesn't depend on LOCAL_DEX_PREOPT.
368ALL_MODULES.$(my_register_name).INSTALLED += $(my_installed_profile)
369ALL_MODULES.$(my_register_name).BUILT_INSTALLED += $(build_installed_profile)
370
371$(my_all_targets): $(my_installed_profile)