From f72308af835c8b5e3b9dc8b5ffe081ea032899e6 Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Mon, 15 May 2017 23:38:04 -0700 Subject: [PATCH] Start deprecating OVERRIDE_BUILT_MODULE_PATH We no longer need to use $PRODUCT_OUT/obj/lib as a linker path, we can directly specify the shared libraries to the linker. So install both into the standard built module path, and declare a copy rule to the old OVERRIDE_BUILT_MODULE_PATH location. This way we can incrementally move users from the old location to the standard path. Test: m -j Change-Id: I3c6140ac26e5e5ca486337ce0192e15e530da32c --- core/base_rules.mk | 12 ++++++++---- core/package_internal.mk | 10 +++++----- core/prebuilt_internal.mk | 8 ++++---- 3 files changed, 17 insertions(+), 13 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index 2157517fe..c327d2c6c 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -248,6 +248,8 @@ generated_sources_dir := $(call local-generated-sources-dir) ########################################################### include $(BUILD_SYSTEM)/configure_module_stem.mk +LOCAL_BUILT_MODULE := $(intermediates)/$(my_built_module_stem) + # OVERRIDE_BUILT_MODULE_PATH is only allowed to be used by the # internal SHARED_LIBRARIES build files. OVERRIDE_BUILT_MODULE_PATH := $(strip $(OVERRIDE_BUILT_MODULE_PATH)) @@ -255,11 +257,8 @@ ifdef OVERRIDE_BUILT_MODULE_PATH ifneq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES) $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH) endif - built_module_path := $(OVERRIDE_BUILT_MODULE_PATH) -else - built_module_path := $(intermediates) + $(eval $(call copy-one-file,$(LOCAL_BUILT_MODULE),$(OVERRIDE_BUILT_MODULE_PATH)/$(my_built_module_stem))) endif -LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem) ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE)) # Apk and its attachments reside in its own subdir. @@ -295,6 +294,11 @@ $(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE) .KATI_RESTAT: $(LOCAL_BUILT_MODULE).toc # Build .toc file when using mm, mma, or make $(my_register_name) $(my_all_targets): $(LOCAL_BUILT_MODULE).toc + +ifdef OVERRIDE_BUILT_MODULE_PATH +$(eval $(call copy-one-file,$(LOCAL_BUILT_MODULE).toc,$(OVERRIDE_BUILT_MODULE_PATH)/$(my_built_module_stem).toc)) +$(OVERRIDE_BUILT_MODULE_PATH)/$(my_built_module_stem).toc: $(OVERRIDE_BUILT_MODULE_PATH)/$(my_built_module_stem) +endif endif ########################################################### diff --git a/core/package_internal.mk b/core/package_internal.mk index 1643b5cf0..4003aafb2 100644 --- a/core/package_internal.mk +++ b/core/package_internal.mk @@ -375,7 +375,7 @@ my_apk_split_configs := ifdef LOCAL_PACKAGE_SPLITS my_apk_split_configs := $(LOCAL_PACKAGE_SPLITS) my_split_suffixes := $(subst $(comma),_,$(my_apk_split_configs)) -built_apk_splits := $(foreach s,$(my_split_suffixes),$(built_module_path)/package_$(s).apk) +built_apk_splits := $(foreach s,$(my_split_suffixes),$(intermediates)/package_$(s).apk) installed_apk_splits := $(foreach s,$(my_split_suffixes),$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) endif @@ -655,7 +655,7 @@ ifdef LOCAL_PACKAGE_SPLITS # That way the build system will rerun the aapt after the user changes the splitting parameters. $(built_apk_splits): PRIVATE_PRIVATE_KEY := $(private_key) $(built_apk_splits): PRIVATE_CERTIFICATE := $(certificate) -$(built_apk_splits) : $(built_module_path)/%.apk : $(LOCAL_BUILT_MODULE) +$(built_apk_splits) : $(intermediates)/%.apk : $(LOCAL_BUILT_MODULE) $(hide) if [ ! -f $@ ]; then \ echo 'No $@ generated, check your apk splitting parameters.' 1>&2; \ rm $<; exit 1; \ @@ -663,14 +663,14 @@ $(built_apk_splits) : $(built_module_path)/%.apk : $(LOCAL_BUILT_MODULE) $(sign-package) # Rules to install the splits -$(installed_apk_splits) : $(my_module_path)/$(LOCAL_MODULE)_%.apk : $(built_module_path)/package_%.apk +$(installed_apk_splits) : $(my_module_path)/$(LOCAL_MODULE)_%.apk : $(intermediates)/package_%.apk @echo "Install: $@" $(copy-file-to-new-target) # Register the additional built and installed files. ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits) ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \ - $(foreach s,$(my_split_suffixes),$(built_module_path)/package_$(s).apk:$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) + $(foreach s,$(my_split_suffixes),$(intermediates)/package_$(s).apk:$(my_module_path)/$(LOCAL_MODULE)_$(s).apk) # Make sure to install the splits when you run "make ". $(my_all_targets): $(installed_apk_splits) @@ -680,7 +680,7 @@ ifdef LOCAL_COMPATIBILITY_SUITE $(foreach suite, $(LOCAL_COMPATIBILITY_SUITE), \ $(eval my_compat_dist_$(suite) := $(foreach dir, $(call compatibility_suite_dirs,$(suite)), \ $(foreach s,$(my_split_suffixes),\ - $(built_module_path)/package_$(s).apk:$(dir)/$(LOCAL_MODULE)_$(s).apk)))) + $(intermediates)/package_$(s).apk:$(dir)/$(LOCAL_MODULE)_$(s).apk)))) $(call create-suite-dependencies) diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 1b3d459f8..5c9d8221b 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -370,7 +370,7 @@ endif ## Install split apks. ifdef LOCAL_PACKAGE_SPLITS # LOCAL_PACKAGE_SPLITS is a list of apks to be installed. -built_apk_splits := $(addprefix $(built_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) +built_apk_splits := $(addprefix $(intermediates)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) installed_apk_splits := $(addprefix $(my_module_path)/,$(notdir $(LOCAL_PACKAGE_SPLITS))) # Rules to sign the split apks. @@ -383,19 +383,19 @@ my_src_dir := $(LOCAL_PATH)/$(my_src_dir) $(built_apk_splits) : $(LOCAL_CERTIFICATE).pk8 $(LOCAL_CERTIFICATE).x509.pem $(built_apk_splits) : PRIVATE_PRIVATE_KEY := $(LOCAL_CERTIFICATE).pk8 $(built_apk_splits) : PRIVATE_CERTIFICATE := $(LOCAL_CERTIFICATE).x509.pem -$(built_apk_splits) : $(built_module_path)/%.apk : $(my_src_dir)/%.apk +$(built_apk_splits) : $(intermediates)/%.apk : $(my_src_dir)/%.apk $(copy-file-to-new-target) $(sign-package) # Rules to install the split apks. -$(installed_apk_splits) : $(my_module_path)/%.apk : $(built_module_path)/%.apk +$(installed_apk_splits) : $(my_module_path)/%.apk : $(intermediates)/%.apk @echo "Install: $@" $(copy-file-to-new-target) # Register the additional built and installed files. ALL_MODULES.$(my_register_name).INSTALLED += $(installed_apk_splits) ALL_MODULES.$(my_register_name).BUILT_INSTALLED += \ - $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(built_module_path)/$(notdir $(s)):$(my_module_path)/$(notdir $(s))) + $(foreach s,$(LOCAL_PACKAGE_SPLITS),$(intermediates)/$(notdir $(s)):$(my_module_path)/$(notdir $(s))) # Make sure to install the splits when you run "make ". $(my_all_targets): $(installed_apk_splits)