From 62c81f821f3675ea57485bfa6cb3320b7178759e Mon Sep 17 00:00:00 2001 From: Ying Wang Date: Thu, 22 Aug 2013 20:02:03 -0700 Subject: [PATCH] Collect NOTICE files for apps_only build. In apps_only build (after running tapas or exporting TARGET_BUILD_APPS), run "make notice_files" to collect and combine the NOTICE files of modules that are needed by the apps. Bug: 10445634 Change-Id: I6555bba1104e43b48c723c82143c46d444a75e80 --- core/Makefile | 2 ++ core/main.mk | 9 +++++++++ core/notice_files.mk | 13 +++++++++++++ 3 files changed, 24 insertions(+) diff --git a/core/Makefile b/core/Makefile index da2454a78..d83578b5c 100644 --- a/core/Makefile +++ b/core/Makefile @@ -507,6 +507,7 @@ target_notice_file_html_gz := $(TARGET_OUT_INTERMEDIATES)/NOTICE.html.gz tools_notice_file_txt := $(HOST_OUT_INTERMEDIATES)/NOTICE.txt tools_notice_file_html := $(HOST_OUT_INTERMEDIATES)/NOTICE.html +ifndef TARGET_BUILD_APPS kernel_notice_file := $(TARGET_OUT_NOTICE_FILES)/src/kernel.txt pdk_fusion_notice_files := $(filter $(TARGET_OUT_NOTICE_FILES)/%, $(ALL_PDK_FUSION_FILES)) @@ -539,6 +540,7 @@ $(installed_notice_html_gz): $(target_notice_file_html_gz) | $(ACP) ifeq ($(ONE_SHOT_MAKEFILE),) ALL_DEFAULT_INSTALLED_MODULES += $(installed_notice_html_gz) endif +endif # TARGET_BUILD_APPS # The kernel isn't really a module, so to get its module file in there, we # make the target NOTICE files depend on this particular file too, which will diff --git a/core/main.mk b/core/main.mk index b8a81915b..0b43efef0 100644 --- a/core/main.mk +++ b/core/main.mk @@ -836,6 +836,15 @@ apps_only: $(unbundled_build_modules) droid: apps_only +# Combine the NOTICE files for a apps_only build +$(eval $(call combine-notice-files, \ + $(target_notice_file_txt), \ + $(target_notice_file_html), \ + "Notices for files for apps:", \ + $(TARGET_OUT_NOTICE_FILES), \ + $(apps_only_installed_files))) + + else # TARGET_BUILD_APPS $(call dist-for-goals, droidcore, \ $(INTERNAL_UPDATE_PACKAGE_TARGET) \ diff --git a/core/notice_files.mk b/core/notice_files.mk index 7e61c1e23..5af01137f 100644 --- a/core/notice_files.mk +++ b/core/notice_files.mk @@ -73,6 +73,19 @@ ifdef LOCAL_INSTALLED_MODULE $(LOCAL_INSTALLED_MODULE): | $(installed_notice_file) endif +# To facilitate collecting NOTICE files for apps_only build, +# we install the NOTICE file even if a module gets built but not installed, +# because shared jni libraries won't be installed to the system image. +ifdef TARGET_BUILD_APPS +# for static Java libraries, we don't need to even build LOCAL_BUILT_MODULE, +# but just javalib.jar in the common intermediate dir. +ifeq ($(LOCAL_MODULE_CLASS),JAVA_LIBRARIES) +$(intermediates.COMMON)/javalib.jar : | $(installed_notice_file) +else +$(LOCAL_BUILT_MODULE): | $(installed_notice_file) +endif # JAVA_LIBRARIES +endif # TARGET_BUILD_APPS + else # NOTICE file does not exist installed_notice_file := -- 2.11.0