2009-03-04 11:28:42 +08:00
|
|
|
#
|
|
|
|
# Copyright (C) 2008 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Users can define base-rules-hook in their buildspec.mk to perform
|
|
|
|
# arbitrary operations as each module is included.
|
|
|
|
ifdef base-rules-hook
|
|
|
|
$(if $(base-rules-hook),)
|
|
|
|
endif
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Common instructions for a generic module.
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
LOCAL_MODULE := $(strip $(LOCAL_MODULE))
|
|
|
|
ifeq ($(LOCAL_MODULE),)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_MODULE is not defined)
|
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_IS_HOST_MODULE := $(strip $(LOCAL_IS_HOST_MODULE))
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
ifneq ($(LOCAL_IS_HOST_MODULE),true)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_IS_HOST_MODULE must be "true" or empty, not "$(LOCAL_IS_HOST_MODULE)")
|
|
|
|
endif
|
2012-11-02 08:22:33 +08:00
|
|
|
my_prefix := HOST_
|
|
|
|
my_host := host-
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
2012-11-02 08:22:33 +08:00
|
|
|
my_prefix := TARGET_
|
|
|
|
my_host :=
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
2014-01-28 07:19:09 +08:00
|
|
|
my_module_tags := $(LOCAL_MODULE_TAGS)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
###########################################################
|
|
|
|
## Validate and define fallbacks for input LOCAL_* variables.
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
## Dump a .csv file of all modules and their tags
|
|
|
|
#ifneq ($(tag-list-first-time),false)
|
|
|
|
#$(shell rm -f tag-list.csv)
|
|
|
|
#tag-list-first-time := false
|
|
|
|
#endif
|
2014-01-28 07:19:09 +08:00
|
|
|
#$(shell echo $(lastword $(filter-out config/% out/%,$(MAKEFILE_LIST))),$(LOCAL_MODULE),$(strip $(LOCAL_MODULE_CLASS)),$(subst $(space),$(comma),$(sort $(my_module_tags))) >> tag-list.csv)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2012-05-16 05:31:26 +08:00
|
|
|
LOCAL_UNINSTALLABLE_MODULE := $(strip $(LOCAL_UNINSTALLABLE_MODULE))
|
2014-01-28 07:19:09 +08:00
|
|
|
my_module_tags := $(sort $(my_module_tags))
|
|
|
|
ifeq (,$(my_module_tags))
|
|
|
|
my_module_tags := optional
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
2012-05-23 05:08:50 +08:00
|
|
|
# User tags are not allowed anymore. Fail early because it will not be installed
|
|
|
|
# like it used to be.
|
2014-01-28 07:19:09 +08:00
|
|
|
ifneq ($(filter $(my_module_tags),user),)
|
2012-05-23 05:08:50 +08:00
|
|
|
$(warning *** Module name: $(LOCAL_MODULE))
|
|
|
|
$(warning *** Makefile location: $(LOCAL_MODULE_MAKEFILE))
|
|
|
|
$(warning * )
|
|
|
|
$(warning * Module is attempting to use the 'user' tag. This)
|
|
|
|
$(warning * used to cause the module to be installed automatically.)
|
|
|
|
$(warning * Now, the module must be listed in the PRODUCT_PACKAGES)
|
|
|
|
$(warning * section of a product makefile to have it installed.)
|
|
|
|
$(warning * )
|
|
|
|
$(error user tag detected on module.)
|
|
|
|
endif
|
2012-05-19 11:43:14 +08:00
|
|
|
|
2010-01-08 03:06:50 +08:00
|
|
|
# Only the tags mentioned in this test are expected to be set by module
|
|
|
|
# makefiles. Anything else is either a typo or a source of unexpected
|
|
|
|
# behaviors.
|
2014-01-28 07:19:09 +08:00
|
|
|
ifneq ($(filter-out debug eng tests optional samples,$(my_module_tags)),)
|
|
|
|
$(warning unusual tags $(my_module_tags) on $(LOCAL_MODULE) at $(LOCAL_PATH))
|
2010-01-08 03:06:50 +08:00
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Add implicit tags.
|
|
|
|
#
|
|
|
|
# If the local directory or one of its parents contains a MODULE_LICENSE_GPL
|
2013-12-11 05:52:00 +08:00
|
|
|
# file, tag the module as "gnu". Search for "*_GPL*", "*_LGPL*" and "*_MPL*"
|
|
|
|
# so that we can also find files like MODULE_LICENSE_GPL_AND_AFL
|
2009-03-04 11:28:42 +08:00
|
|
|
#
|
2015-05-08 03:08:53 +08:00
|
|
|
license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*)
|
2013-12-11 05:52:00 +08:00
|
|
|
gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)
|
2011-12-13 04:57:38 +08:00
|
|
|
ifneq ($(gpl_license_file),)
|
2014-01-28 07:19:09 +08:00
|
|
|
my_module_tags += gnu
|
2011-12-13 04:57:38 +08:00
|
|
|
ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
|
|
|
|
ifneq ($(words $(LOCAL_MODULE_CLASS)),1)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)")
|
|
|
|
endif
|
|
|
|
|
2014-04-18 01:03:35 +08:00
|
|
|
my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
|
2014-03-22 03:25:44 +08:00
|
|
|
|
2012-05-16 05:31:26 +08:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2014-03-22 03:25:44 +08:00
|
|
|
my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix)))
|
|
|
|
ifdef my_multilib_module_path
|
|
|
|
my_module_path := $(my_multilib_module_path)
|
|
|
|
else
|
2014-01-24 07:09:04 +08:00
|
|
|
my_module_path := $(strip $(LOCAL_MODULE_PATH))
|
2014-03-22 03:25:44 +08:00
|
|
|
endif
|
2014-01-25 11:23:40 +08:00
|
|
|
my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
|
2014-01-24 07:09:04 +08:00
|
|
|
ifeq ($(my_module_path),)
|
2013-05-09 06:49:08 +08:00
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
partition_tag :=
|
|
|
|
else
|
|
|
|
ifeq (true,$(LOCAL_PROPRIETARY_MODULE))
|
|
|
|
partition_tag := _VENDOR
|
2014-03-12 08:13:27 +08:00
|
|
|
else ifeq (true,$(LOCAL_OEM_MODULE))
|
|
|
|
partition_tag := _OEM
|
Support to configure and build multiple custom images.
Build additional images requested by the product makefile.
This script gives the ability to build multiple additional images and
you can configure what modules/files to include in each image.
1. Define PRODUCT_CUSTOM_IMAGE_MAKEFILES in your product makefile.
PRODUCT_CUSTOM_IMAGE_MAKEFILES is a list of makefiles.
Each makefile configures an image.
For image configuration makefile foo/bar/xyz.mk, the built image
file name
will be xyz.img. So make sure they won't conflict.
2. In each image's configuration makefile, you can define variables:
- CUSTOM_IMAGE_MOUNT_POINT, the mount point, such as "oem", "odm"
etc.
- CUSTOM_IMAGE_PARTITION_SIZE
- CUSTOM_IMAGE_FILE_SYSTEM_TYPE
- CUSTOM_IMAGE_DICT_FILE, a text file defining a dictionary
accepted by BuildImage() in tools/releasetools/build_image.py.
- CUSTOM_IMAGE_MODULES, a list of module names you want to include
in the image; Not only the module itself will be installed to proper
path in the image, you can also piggyback additional files/directories
with the module's LOCAL_PICKUP_FILES.
- CUSTOM_IMAGE_COPY_FILES, a list of "<src>:<dest>" to be copied to
the image. <dest> is relativ to the root of the image.
To build all those images, run "make custom_images".
Bug: 19609718
Change-Id: Ic73587e08503a251be27797c7b00329716051927
2015-03-13 09:30:39 +08:00
|
|
|
else ifeq (true,$(LOCAL_ODM_MODULE))
|
|
|
|
partition_tag := _ODM
|
2013-05-09 06:49:08 +08:00
|
|
|
else
|
|
|
|
# The definition of should-install-to-system will be different depending
|
|
|
|
# on which goal (e.g., sdk or just droid) is being built.
|
2014-01-28 07:19:09 +08:00
|
|
|
partition_tag := $(if $(call should-install-to-system,$(my_module_tags)),,_DATA)
|
2013-05-09 06:49:08 +08:00
|
|
|
endif
|
|
|
|
endif
|
2014-01-16 08:02:16 +08:00
|
|
|
install_path_var := $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS)
|
2013-05-09 06:49:08 +08:00
|
|
|
ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
|
|
|
|
install_path_var := $(install_path_var)_PRIVILEGED
|
|
|
|
endif
|
|
|
|
|
2014-01-23 09:34:28 +08:00
|
|
|
my_module_path := $($(install_path_var))
|
2014-01-24 07:09:04 +08:00
|
|
|
ifeq ($(strip $(my_module_path)),)
|
|
|
|
$(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)")
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
endif
|
2014-01-25 11:23:40 +08:00
|
|
|
ifneq ($(my_module_relative_path),)
|
|
|
|
my_module_path := $(my_module_path)/$(my_module_relative_path)
|
|
|
|
endif
|
2012-05-16 05:31:26 +08:00
|
|
|
endif # not LOCAL_UNINSTALLABLE_MODULE
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
ifneq ($(strip $(LOCAL_BUILT_MODULE)$(LOCAL_INSTALLED_MODULE)),)
|
|
|
|
$(error $(LOCAL_PATH): LOCAL_BUILT_MODULE and LOCAL_INSTALLED_MODULE must not be defined by component makefiles)
|
|
|
|
endif
|
|
|
|
|
2014-01-16 08:02:16 +08:00
|
|
|
my_register_name := $(LOCAL_MODULE)
|
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
2014-02-05 03:16:16 +08:00
|
|
|
ifndef LOCAL_NO_2ND_ARCH_MODULE_SUFFIX
|
2014-04-18 01:03:35 +08:00
|
|
|
my_register_name := $(LOCAL_MODULE)$($(my_prefix)2ND_ARCH_MODULE_SUFFIX)
|
2014-01-16 08:02:16 +08:00
|
|
|
endif
|
2014-02-05 03:16:16 +08:00
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
# Make sure that this IS_HOST/CLASS/MODULE combination is unique.
|
|
|
|
module_id := MODULE.$(if \
|
2014-01-16 08:02:16 +08:00
|
|
|
$(LOCAL_IS_HOST_MODULE),HOST,TARGET).$(LOCAL_MODULE_CLASS).$(my_register_name)
|
2009-03-04 11:28:42 +08:00
|
|
|
ifdef $(module_id)
|
|
|
|
$(error $(LOCAL_PATH): $(module_id) already defined by $($(module_id)))
|
|
|
|
endif
|
|
|
|
$(module_id) := $(LOCAL_PATH)
|
|
|
|
|
2014-01-16 08:02:16 +08:00
|
|
|
intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX))
|
2009-03-04 11:28:42 +08:00
|
|
|
intermediates.COMMON := $(call local-intermediates-dir,COMMON)
|
2014-01-25 15:17:21 +08:00
|
|
|
generated_sources_dir := $(call local-generated-sources-dir)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
# Pick a name for the intermediate and final targets
|
|
|
|
###########################################################
|
2014-03-22 03:27:37 +08:00
|
|
|
include $(BUILD_SYSTEM)/configure_module_stem.mk
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# 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))
|
|
|
|
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)
|
|
|
|
endif
|
2014-05-21 05:43:51 +08:00
|
|
|
LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2011-09-08 01:21:42 +08:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2014-07-18 12:24:42 +08:00
|
|
|
# Apk and its attachments reside in its own subdir.
|
|
|
|
ifeq ($(LOCAL_MODULE_CLASS),APPS)
|
|
|
|
# framework-res.apk doesn't like the additional layer.
|
|
|
|
ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
|
|
|
|
my_module_path := $(my_module_path)/$(LOCAL_MODULE)
|
|
|
|
endif
|
|
|
|
endif
|
2014-05-21 05:43:51 +08:00
|
|
|
LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
# Assemble the list of targets to create PRIVATE_ variables for.
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE)
|
|
|
|
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## AIDL: Compile .aidl files to .java
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
aidl_sources := $(filter %.aidl,$(LOCAL_SRC_FILES))
|
|
|
|
|
|
|
|
ifneq ($(strip $(aidl_sources)),)
|
|
|
|
|
|
|
|
aidl_java_sources := $(patsubst %.aidl,%.java,$(addprefix $(intermediates.COMMON)/src/, $(aidl_sources)))
|
|
|
|
aidl_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(aidl_sources))
|
|
|
|
|
2010-01-26 01:56:41 +08:00
|
|
|
aidl_preprocess_import :=
|
|
|
|
LOCAL_SDK_VERSION:=$(strip $(LOCAL_SDK_VERSION))
|
|
|
|
ifdef LOCAL_SDK_VERSION
|
2014-07-20 08:00:50 +08:00
|
|
|
ifneq ($(filter current system_current, $(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS)),)
|
2012-05-11 08:25:51 +08:00
|
|
|
# LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS
|
2010-06-10 02:43:33 +08:00
|
|
|
aidl_preprocess_import := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
|
|
|
|
else
|
|
|
|
aidl_preprocess_import := $(HISTORICAL_SDK_VERSIONS_ROOT)/$(LOCAL_SDK_VERSION)/framework.aidl
|
2014-07-20 08:00:50 +08:00
|
|
|
endif # not current or system_current
|
2013-10-02 09:16:45 +08:00
|
|
|
else
|
|
|
|
# build against the platform.
|
|
|
|
LOCAL_AIDL_INCLUDES += $(FRAMEWORKS_BASE_JAVA_SRC_DIRS)
|
2010-01-26 01:56:41 +08:00
|
|
|
endif # LOCAL_SDK_VERSION
|
2010-06-10 02:43:33 +08:00
|
|
|
$(aidl_java_sources): PRIVATE_AIDL_FLAGS := -b $(addprefix -p,$(aidl_preprocess_import)) -I$(LOCAL_PATH) -I$(LOCAL_PATH)/src $(addprefix -I,$(LOCAL_AIDL_INCLUDES))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2014-11-09 14:20:03 +08:00
|
|
|
$(aidl_java_sources): $(intermediates.COMMON)/src/%.java: \
|
|
|
|
$(TOPDIR)$(LOCAL_PATH)/%.aidl \
|
|
|
|
$(LOCAL_MODULE_MAKEFILE) \
|
|
|
|
$(LOCAL_ADDITIONAL_DEPENDENCIES) \
|
|
|
|
$(AIDL) \
|
|
|
|
$(aidl_preprocess_import)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(transform-aidl-to-java)
|
|
|
|
-include $(aidl_java_sources:%.java=%.P)
|
|
|
|
|
|
|
|
else
|
|
|
|
aidl_java_sources :=
|
|
|
|
endif
|
|
|
|
|
2009-12-01 06:28:59 +08:00
|
|
|
###########################################################
|
|
|
|
## logtags: Add .logtags files to global list, emit java source
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
logtags_sources := $(filter %.logtags,$(LOCAL_SRC_FILES))
|
|
|
|
|
|
|
|
ifneq ($(strip $(logtags_sources)),)
|
|
|
|
|
|
|
|
event_log_tags := $(addprefix $(LOCAL_PATH)/,$(logtags_sources))
|
|
|
|
|
|
|
|
# Emit a java source file with constants for the tags, if
|
|
|
|
# LOCAL_MODULE_CLASS is "APPS" or "JAVA_LIBRARIES".
|
2014-07-08 06:01:15 +08:00
|
|
|
ifneq ($(filter $(LOCAL_MODULE_CLASS),APPS JAVA_LIBRARIES),)
|
2009-12-01 06:28:59 +08:00
|
|
|
|
|
|
|
logtags_java_sources := $(patsubst %.logtags,%.java,$(addprefix $(intermediates.COMMON)/src/, $(logtags_sources)))
|
|
|
|
logtags_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(logtags_sources))
|
|
|
|
|
2010-07-15 01:22:54 +08:00
|
|
|
$(logtags_java_sources): $(intermediates.COMMON)/src/%.java: $(TOPDIR)$(LOCAL_PATH)/%.logtags $(TARGET_OUT_COMMON_INTERMEDIATES)/all-event-log-tags.txt
|
2009-12-01 06:28:59 +08:00
|
|
|
$(transform-logtags-to-java)
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
logtags_java_sources :=
|
|
|
|
event_log_tags :=
|
|
|
|
endif
|
|
|
|
|
2010-11-03 09:43:16 +08:00
|
|
|
###########################################################
|
|
|
|
## .proto files: Compile proto files to .java
|
|
|
|
###########################################################
|
|
|
|
proto_sources := $(filter %.proto,$(LOCAL_SRC_FILES))
|
|
|
|
# Because names of the .java files compiled from .proto files are unknown until the
|
|
|
|
# .proto files are compiled, we use a timestamp file as depedency.
|
|
|
|
proto_java_sources_file_stamp :=
|
|
|
|
ifneq ($(proto_sources),)
|
|
|
|
proto_sources_fullpath := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(proto_sources))
|
|
|
|
# By putting the generated java files into $(LOCAL_INTERMEDIATE_SOURCE_DIR), they will be
|
|
|
|
# automatically found by the java compiling function transform-java-to-classes.jar.
|
2010-11-06 02:20:03 +08:00
|
|
|
ifneq ($(LOCAL_INTERMEDIATE_SOURCE_DIR),)
|
2010-11-03 09:43:16 +08:00
|
|
|
proto_java_intemediate_dir := $(LOCAL_INTERMEDIATE_SOURCE_DIR)/proto
|
2010-11-06 02:20:03 +08:00
|
|
|
else
|
|
|
|
# LOCAL_INTERMEDIATE_SOURCE_DIR may be not defined in non-java modules.
|
|
|
|
proto_java_intemediate_dir := $(intermediates)/proto
|
|
|
|
endif
|
2010-11-03 09:43:16 +08:00
|
|
|
proto_java_sources_file_stamp := $(proto_java_intemediate_dir)/Proto.stamp
|
|
|
|
proto_java_sources_dir := $(proto_java_intemediate_dir)/src
|
|
|
|
|
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_INCLUDES := $(TOP)
|
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_SRC_FILES := $(proto_sources_fullpath)
|
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_DIR := $(proto_java_sources_dir)
|
|
|
|
ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),micro)
|
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_OPTION := --javamicro_out
|
|
|
|
else
|
2013-03-29 05:02:14 +08:00
|
|
|
ifeq ($(LOCAL_PROTOC_OPTIMIZE_TYPE),nano)
|
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_OPTION := --javanano_out
|
|
|
|
else
|
2010-11-03 09:43:16 +08:00
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_OPTION := --java_out
|
2013-03-29 05:02:14 +08:00
|
|
|
endif
|
2010-11-03 09:43:16 +08:00
|
|
|
endif
|
2010-11-06 02:30:58 +08:00
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTOC_FLAGS := $(LOCAL_PROTOC_FLAGS)
|
2013-07-26 03:28:19 +08:00
|
|
|
$(proto_java_sources_file_stamp): PRIVATE_PROTO_JAVA_OUTPUT_PARAMS := $(LOCAL_PROTO_JAVA_OUTPUT_PARAMS)
|
2010-11-03 09:43:16 +08:00
|
|
|
$(proto_java_sources_file_stamp) : $(proto_sources_fullpath) $(PROTOC)
|
|
|
|
$(call transform-proto-to-java)
|
|
|
|
|
|
|
|
#TODO: protoc should output the dependencies introduced by imports.
|
|
|
|
|
|
|
|
LOCAL_INTERMEDIATE_TARGETS += $(proto_java_sources_file_stamp)
|
|
|
|
endif # proto_sources
|
|
|
|
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
###########################################################
|
|
|
|
## Java: Compile .java files to .class
|
|
|
|
###########################################################
|
|
|
|
#TODO: pull this into java.make once host and target are combined
|
|
|
|
|
2010-05-27 04:13:56 +08:00
|
|
|
java_sources := $(addprefix $(TOP_DIR)$(LOCAL_PATH)/, $(filter %.java,$(LOCAL_SRC_FILES))) $(aidl_java_sources) $(logtags_java_sources) \
|
|
|
|
$(filter %.java,$(LOCAL_GENERATED_SOURCES))
|
2009-03-04 11:28:42 +08:00
|
|
|
all_java_sources := $(java_sources) $(addprefix $($(my_prefix)OUT_COMMON_INTERMEDIATES)/, $(filter %.java,$(LOCAL_INTERMEDIATE_SOURCES)))
|
|
|
|
|
|
|
|
## Java resources #########################################
|
|
|
|
|
|
|
|
# Look for resource files in any specified directories.
|
|
|
|
# Non-java and non-doc files will be picked up as resources
|
|
|
|
# and included in the output jar file.
|
|
|
|
java_resource_file_groups :=
|
|
|
|
|
|
|
|
LOCAL_JAVA_RESOURCE_DIRS := $(strip $(LOCAL_JAVA_RESOURCE_DIRS))
|
|
|
|
ifneq ($(LOCAL_JAVA_RESOURCE_DIRS),)
|
|
|
|
# This makes a list of words like
|
|
|
|
# <dir1>::<file1>:<file2> <dir2>::<file1> <dir3>:
|
|
|
|
# where each of the files is relative to the directory it's grouped with.
|
|
|
|
# Directories that don't contain any resource files will result in groups
|
|
|
|
# that end with a colon, and they are stripped out in the next step.
|
|
|
|
java_resource_file_groups += \
|
|
|
|
$(foreach dir,$(LOCAL_JAVA_RESOURCE_DIRS), \
|
|
|
|
$(subst $(space),:,$(strip \
|
|
|
|
$(TOP_DIR)$(LOCAL_PATH)/$(dir): \
|
|
|
|
$(patsubst ./%,%,$(shell cd $(TOP_DIR)$(LOCAL_PATH)/$(dir) && \
|
|
|
|
find . \
|
|
|
|
-type d -a -name ".svn" -prune -o \
|
|
|
|
-type f \
|
|
|
|
-a \! -name "*.java" \
|
|
|
|
-a \! -name "package.html" \
|
|
|
|
-a \! -name "overview.html" \
|
|
|
|
-a \! -name ".*.swp" \
|
|
|
|
-a \! -name ".DS_Store" \
|
|
|
|
-a \! -name "*~" \
|
|
|
|
-print \
|
|
|
|
)) \
|
|
|
|
)) \
|
|
|
|
)
|
|
|
|
java_resource_file_groups := $(filter-out %:,$(java_resource_file_groups))
|
|
|
|
endif # LOCAL_JAVA_RESOURCE_DIRS
|
|
|
|
|
|
|
|
LOCAL_JAVA_RESOURCE_FILES := $(strip $(LOCAL_JAVA_RESOURCE_FILES))
|
|
|
|
ifneq ($(LOCAL_JAVA_RESOURCE_FILES),)
|
|
|
|
java_resource_file_groups += \
|
|
|
|
$(foreach f,$(LOCAL_JAVA_RESOURCE_FILES), \
|
|
|
|
$(patsubst %/,%,$(dir $(f)))::$(notdir $(f)) \
|
|
|
|
)
|
|
|
|
endif # LOCAL_JAVA_RESOURCE_FILES
|
|
|
|
|
|
|
|
ifdef java_resource_file_groups
|
|
|
|
# The full paths to all resources, used for dependencies.
|
|
|
|
java_resource_sources := \
|
|
|
|
$(foreach group,$(java_resource_file_groups), \
|
|
|
|
$(addprefix $(word 1,$(subst :,$(space),$(group)))/, \
|
|
|
|
$(wordlist 2,9999,$(subst :,$(space),$(group))) \
|
|
|
|
) \
|
|
|
|
)
|
|
|
|
# The arguments to jar that will include these files in a jar file.
|
2011-06-07 05:34:52 +08:00
|
|
|
# Quote the file name to handle special characters (such as #) correctly.
|
2009-03-04 11:28:42 +08:00
|
|
|
extra_jar_args := \
|
|
|
|
$(foreach group,$(java_resource_file_groups), \
|
2011-06-07 05:34:52 +08:00
|
|
|
$(addprefix -C "$(word 1,$(subst :,$(space),$(group)))" , \
|
|
|
|
$(foreach w, $(wordlist 2,9999,$(subst :,$(space),$(group))), "$(w)" ) \
|
2009-03-04 11:28:42 +08:00
|
|
|
) \
|
|
|
|
)
|
|
|
|
java_resource_file_groups :=
|
|
|
|
else
|
|
|
|
java_resource_sources :=
|
|
|
|
extra_jar_args :=
|
|
|
|
endif # java_resource_file_groups
|
|
|
|
|
|
|
|
## PRIVATE java vars ######################################
|
2013-08-29 04:04:46 +08:00
|
|
|
# LOCAL_SOURCE_FILES_ALL_GENERATED is set only if the module does not have static source files,
|
|
|
|
# but generated source files in its LOCAL_INTERMEDIATE_SOURCE_DIR.
|
|
|
|
# You have to set up the dependency in some other way.
|
2015-02-03 07:33:31 +08:00
|
|
|
need_compile_java := $(strip $(all_java_sources)$(all_res_assets)$(java_resource_sources))$(LOCAL_STATIC_JAVA_LIBRARIES)$(filter true,$(LOCAL_SOURCE_FILES_ALL_GENERATED))
|
2013-08-29 04:04:46 +08:00
|
|
|
ifdef need_compile_java
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
full_static_java_libs := \
|
|
|
|
$(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
|
|
|
|
$(call intermediates-dir-for, \
|
2010-09-25 09:09:04 +08:00
|
|
|
JAVA_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE),COMMON)/javalib.jar)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_INSTALL_DIR := $(dir $(LOCAL_INSTALLED_MODULE))
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CLASS_INTERMEDIATES_DIR := $(intermediates)/classes
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_SOURCE_INTERMEDIATES_DIR := $(intermediates)/src
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAVA_SOURCES := $(all_java_sources)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAVA_OBJECTS := $(patsubst %.java,%.class,$(LOCAL_SRC_FILES))
|
|
|
|
ifeq ($(my_prefix),TARGET_)
|
2009-09-24 06:28:12 +08:00
|
|
|
ifeq ($(LOCAL_SDK_VERSION),)
|
2014-06-24 06:34:17 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,core-libart)
|
2010-06-10 02:43:33 +08:00
|
|
|
else
|
2012-05-11 08:25:51 +08:00
|
|
|
ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
|
|
|
|
# LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
|
2010-06-10 02:43:33 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,android_stubs_current)
|
2014-07-20 08:00:50 +08:00
|
|
|
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,android_system_stubs_current)
|
2010-06-10 02:43:33 +08:00
|
|
|
else
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,sdk_v$(LOCAL_SDK_VERSION))
|
2014-07-20 08:00:50 +08:00
|
|
|
endif # current or system_current
|
2010-06-10 02:43:33 +08:00
|
|
|
endif # LOCAL_SDK_VERSION
|
|
|
|
endif # TARGET_
|
2009-03-04 11:28:42 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_RESOURCE_DIR := $(LOCAL_RESOURCE_DIR)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASSET_DIR := $(LOCAL_ASSET_DIR)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JAVA_LIBRARIES := $(full_static_java_libs)
|
|
|
|
|
|
|
|
# full_java_libs: The list of files that should be used as the classpath.
|
|
|
|
# Using this list as a dependency list WILL NOT WORK.
|
|
|
|
# full_java_lib_deps: Should be specified as a prerequisite of this module
|
|
|
|
# to guarantee that the files in full_java_libs will
|
|
|
|
# be up-to-date.
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
2013-10-28 21:20:52 +08:00
|
|
|
ifeq ($(USE_CORE_LIB_BOOTCLASSPATH),true)
|
2014-09-08 20:45:14 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH := -bootclasspath $(call java-lib-files,core-libart-hostdex,$(LOCAL_IS_HOST_MODULE))
|
2011-01-21 07:01:56 +08:00
|
|
|
|
2013-08-22 09:32:49 +08:00
|
|
|
full_shared_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
2015-01-22 09:30:21 +08:00
|
|
|
full_java_lib_deps := $(call java-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE)) \
|
|
|
|
$(full_shared_java_libs)
|
2010-09-11 09:38:10 +08:00
|
|
|
else
|
2011-01-21 07:01:56 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH :=
|
|
|
|
|
2013-08-22 09:32:49 +08:00
|
|
|
full_shared_java_libs := $(addprefix $(HOST_OUT_JAVA_LIBRARIES)/,\
|
|
|
|
$(addsuffix $(COMMON_JAVA_PACKAGE_SUFFIX),$(LOCAL_JAVA_LIBRARIES)))
|
|
|
|
full_java_lib_deps := $(full_shared_java_libs)
|
2014-07-08 08:15:38 +08:00
|
|
|
endif # USE_CORE_LIB_BOOTCLASSPATH
|
|
|
|
else # !LOCAL_IS_HOST_MODULE
|
2013-08-22 09:32:49 +08:00
|
|
|
full_shared_java_libs := $(call java-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
2010-01-26 01:56:41 +08:00
|
|
|
full_java_lib_deps := $(call java-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|
2013-08-22 09:32:49 +08:00
|
|
|
full_java_libs := $(full_shared_java_libs) $(full_static_java_libs) $(LOCAL_CLASSPATH)
|
2009-03-04 11:28:42 +08:00
|
|
|
full_java_lib_deps += $(full_static_java_libs) $(LOCAL_CLASSPATH)
|
|
|
|
|
2013-03-12 09:04:55 +08:00
|
|
|
# This is set by packages that are linking to other packages that export
|
|
|
|
# shared libraries, allowing them to make use of the code in the linked apk.
|
2014-03-26 06:45:34 +08:00
|
|
|
apk_libraries := $(sort $(LOCAL_APK_LIBRARIES) $(LOCAL_RES_LIBRARIES))
|
|
|
|
ifneq ($(apk_libraries),)
|
2013-03-12 09:04:55 +08:00
|
|
|
link_apk_libraries := \
|
2014-03-26 06:45:34 +08:00
|
|
|
$(foreach lib,$(apk_libraries), \
|
2013-03-12 09:04:55 +08:00
|
|
|
$(call intermediates-dir-for, \
|
|
|
|
APPS,$(lib),,COMMON)/classes.jar)
|
|
|
|
|
|
|
|
# link against the jar with full original names (before proguard processing).
|
2013-08-24 02:59:49 +08:00
|
|
|
full_shared_java_libs += $(link_apk_libraries)
|
2013-03-12 09:04:55 +08:00
|
|
|
full_java_libs += $(link_apk_libraries)
|
|
|
|
full_java_lib_deps += $(link_apk_libraries)
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# This is set by packages that contain instrumentation, allowing them to
|
|
|
|
# link against the package they are instrumenting. Currently only one such
|
|
|
|
# package is allowed.
|
|
|
|
LOCAL_INSTRUMENTATION_FOR := $(strip $(LOCAL_INSTRUMENTATION_FOR))
|
|
|
|
ifdef LOCAL_INSTRUMENTATION_FOR
|
|
|
|
ifneq ($(words $(LOCAL_INSTRUMENTATION_FOR)),1)
|
|
|
|
$(error \
|
|
|
|
$(LOCAL_PATH): Multiple LOCAL_INSTRUMENTATION_FOR members defined)
|
|
|
|
endif
|
|
|
|
|
|
|
|
link_instr_intermediates_dir.COMMON := $(call intermediates-dir-for, \
|
|
|
|
APPS,$(LOCAL_INSTRUMENTATION_FOR),,COMMON)
|
2010-02-02 01:51:23 +08:00
|
|
|
# link against the jar with full original names (before proguard processing).
|
2013-08-22 09:32:49 +08:00
|
|
|
link_instr_classes_jar := $(link_instr_intermediates_dir.COMMON)/classes.jar
|
|
|
|
full_java_libs += $(link_instr_classes_jar)
|
|
|
|
full_java_lib_deps += $(link_instr_classes_jar)
|
2009-03-04 11:28:42 +08:00
|
|
|
endif
|
|
|
|
|
2014-10-01 08:32:58 +08:00
|
|
|
endif # need_compile_java
|
|
|
|
|
|
|
|
# We may want to add jar manifest or jar resource files even if there is no java code at all.
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_EXTRA_JAR_ARGS := $(extra_jar_args)
|
2010-04-27 11:09:56 +08:00
|
|
|
jar_manifest_file :=
|
2009-03-04 11:28:42 +08:00
|
|
|
ifneq ($(strip $(LOCAL_JAR_MANIFEST)),)
|
2010-04-27 11:09:56 +08:00
|
|
|
jar_manifest_file := $(LOCAL_PATH)/$(LOCAL_JAR_MANIFEST)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAR_MANIFEST := $(jar_manifest_file)
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JAR_MANIFEST :=
|
|
|
|
endif
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## make clean- targets
|
|
|
|
###########################################################
|
2014-01-16 08:02:16 +08:00
|
|
|
cleantarget := clean-$(my_register_name)
|
|
|
|
$(cleantarget) : PRIVATE_MODULE := $(my_register_name)
|
2013-03-23 09:52:57 +08:00
|
|
|
$(cleantarget) : PRIVATE_CLEAN_FILES := \
|
2012-11-08 06:07:34 +08:00
|
|
|
$(LOCAL_BUILT_MODULE) \
|
|
|
|
$(LOCAL_INSTALLED_MODULE) \
|
|
|
|
$(intermediates)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(cleantarget)::
|
|
|
|
@echo "Clean: $(PRIVATE_MODULE)"
|
|
|
|
$(hide) rm -rf $(PRIVATE_CLEAN_FILES)
|
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Common definitions for module.
|
|
|
|
###########################################################
|
|
|
|
|
2012-11-08 06:07:34 +08:00
|
|
|
# aapt doesn't accept multiple --extra-packages flags.
|
|
|
|
# We have to collapse them into a single --extra-packages flag here.
|
|
|
|
LOCAL_AAPT_FLAGS := $(strip $(LOCAL_AAPT_FLAGS))
|
|
|
|
ifdef LOCAL_AAPT_FLAGS
|
|
|
|
ifeq ($(filter 0 1,$(words $(filter --extra-packages,$(LOCAL_AAPT_FLAGS)))),)
|
|
|
|
aapt_flags := $(subst --extra-packages$(space),--extra-packages@,$(LOCAL_AAPT_FLAGS))
|
|
|
|
aapt_flags_extra_packages := $(patsubst --extra-packages@%,%,$(filter --extra-packages@%,$(aapt_flags)))
|
|
|
|
aapt_flags_extra_packages := $(sort $(subst :,$(space),$(aapt_flags_extra_packages)))
|
|
|
|
LOCAL_AAPT_FLAGS := $(filter-out --extra-packages@%,$(aapt_flags)) \
|
|
|
|
--extra-packages $(subst $(space),:,$(aapt_flags_extra_packages))
|
|
|
|
aapt_flags_extra_packages :=
|
|
|
|
aapt_flags :=
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Propagate local configuration options to this target.
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PATH:=$(LOCAL_PATH)
|
2014-06-27 05:56:21 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_AAPT_FLAGS:= $(LOCAL_AAPT_FLAGS) $(PRODUCT_AAPT_FLAGS)
|
2009-03-04 11:28:42 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_JAVA_LIBRARIES:= $(LOCAL_JAVA_LIBRARIES)
|
2010-02-06 12:36:42 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MANIFEST_PACKAGE_NAME:= $(LOCAL_MANIFEST_PACKAGE_NAME)
|
2010-09-03 06:41:01 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MANIFEST_INSTRUMENTATION_FOR:= $(LOCAL_MANIFEST_INSTRUMENTATION_FOR)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_ALL_JAVA_LIBRARIES:= $(full_java_libs)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_IS_HOST_MODULE := $(LOCAL_IS_HOST_MODULE)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_HOST:= $(my_host)
|
|
|
|
|
2009-05-28 10:41:07 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_INTERMEDIATES_DIR:= $(intermediates)
|
|
|
|
|
2014-04-18 01:03:35 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
# Tell the module and all of its sub-modules who it is.
|
2014-01-16 08:02:16 +08:00
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Provide a short-hand for building this module.
|
|
|
|
# We name both BUILT and INSTALLED in case
|
|
|
|
# LOCAL_UNINSTALLABLE_MODULE is set.
|
2014-01-16 08:02:16 +08:00
|
|
|
.PHONY: $(my_register_name)
|
|
|
|
$(my_register_name): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## Module installation rule
|
|
|
|
###########################################################
|
|
|
|
|
|
|
|
# Some hosts do not have ACP; override the LOCAL version if that's the case.
|
|
|
|
ifneq ($(strip $(HOST_ACP_UNAVAILABLE)),)
|
|
|
|
LOCAL_ACP_UNAVAILABLE := $(strip $(HOST_ACP_UNAVAILABLE))
|
|
|
|
endif
|
|
|
|
|
2015-04-20 00:55:39 +08:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2009-03-04 11:28:42 +08:00
|
|
|
# Define a copy rule to install the module.
|
|
|
|
# acp and libraries that it uses can't use acp for
|
|
|
|
# installation; hence, LOCAL_ACP_UNAVAILABLE.
|
2013-02-07 03:44:41 +08:00
|
|
|
$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
|
2009-03-04 11:28:42 +08:00
|
|
|
ifneq ($(LOCAL_ACP_UNAVAILABLE),true)
|
|
|
|
$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE) | $(ACP)
|
|
|
|
@echo "Install: $@"
|
2011-01-19 09:21:20 +08:00
|
|
|
$(copy-file-to-new-target)
|
2013-02-07 03:44:41 +08:00
|
|
|
$(PRIVATE_POST_INSTALL_CMD)
|
2009-03-04 11:28:42 +08:00
|
|
|
else
|
|
|
|
$(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE)
|
|
|
|
@echo "Install: $@"
|
|
|
|
$(copy-file-to-target-with-cp)
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif # !LOCAL_UNINSTALLABLE_MODULE
|
|
|
|
|
2009-07-18 03:33:40 +08:00
|
|
|
|
|
|
|
###########################################################
|
|
|
|
## CHECK_BUILD goals
|
|
|
|
###########################################################
|
2014-09-30 05:34:32 +08:00
|
|
|
my_checked_module :=
|
2009-07-18 03:33:40 +08:00
|
|
|
# If nobody has defined a more specific module for the
|
2013-01-31 06:43:05 +08:00
|
|
|
# checked modules, use LOCAL_BUILT_MODULE.
|
2014-09-30 05:34:32 +08:00
|
|
|
ifdef LOCAL_CHECKED_MODULE
|
|
|
|
my_checked_module := $(LOCAL_CHECKED_MODULE)
|
2014-09-30 08:10:34 +08:00
|
|
|
else ifdef java_alternative_checked_module
|
|
|
|
my_checked_module := $(java_alternative_checked_module)
|
2014-09-30 05:34:32 +08:00
|
|
|
else
|
|
|
|
my_checked_module := $(LOCAL_BUILT_MODULE)
|
2009-07-18 03:33:40 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
# If they request that this module not be checked, then don't.
|
|
|
|
# PLEASE DON'T SET THIS. ANY PLACES THAT SET THIS WITHOUT
|
|
|
|
# GOOD REASON WILL HAVE IT REMOVED.
|
|
|
|
ifdef LOCAL_DONT_CHECK_MODULE
|
2014-09-30 05:34:32 +08:00
|
|
|
my_checked_module :=
|
2009-07-18 03:33:40 +08:00
|
|
|
endif
|
2014-05-21 05:43:51 +08:00
|
|
|
# Don't check build target module defined for the 2nd arch
|
|
|
|
ifndef LOCAL_IS_HOST_MODULE
|
2014-01-16 08:02:16 +08:00
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
2014-09-30 05:34:32 +08:00
|
|
|
my_checked_module :=
|
2014-01-16 08:02:16 +08:00
|
|
|
endif
|
2014-05-21 05:43:51 +08:00
|
|
|
endif
|
2009-07-18 03:33:40 +08:00
|
|
|
|
2015-06-04 03:43:50 +08:00
|
|
|
###########################################################
|
|
|
|
## Compatibiliy suite files.
|
|
|
|
###########################################################
|
|
|
|
ifdef LOCAL_COMPATIBILITY_SUITE
|
|
|
|
ifneq ($(words $(LOCAL_COMPATIBILITY_SUITE)),1)
|
|
|
|
$(error $(LOCAL_PATH):$(LOCAL_MODULE) LOCAL_COMPATIBILITY_SUITE can be only one name)
|
|
|
|
endif
|
|
|
|
|
|
|
|
cts_testcase_file := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem)
|
|
|
|
$(cts_testcase_file) : $(LOCAL_BUILT_MODULE) | $(ACP)
|
|
|
|
$(copy-file-to-new-target)
|
|
|
|
|
2015-06-05 02:21:49 +08:00
|
|
|
cts_testcase_config :=
|
|
|
|
android_test_xml := $(wildcard $(LOCAL_PATH)/AndroidTest.xml)
|
|
|
|
ifdef android_test_xml
|
2015-06-04 03:43:50 +08:00
|
|
|
cts_testcase_config := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).config
|
2015-06-24 01:15:00 +08:00
|
|
|
$(cts_testcase_config) : $(android_test_xml) | $(ACP)
|
2015-06-04 03:43:50 +08:00
|
|
|
$(copy-file-to-new-target)
|
2015-06-05 02:21:49 +08:00
|
|
|
endif
|
2015-06-04 03:43:50 +08:00
|
|
|
|
|
|
|
COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \
|
|
|
|
$(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \
|
|
|
|
$(cts_testcase_file) $(cts_testcase_config)
|
|
|
|
|
|
|
|
# Copy over the compatibility files when user runs mm/mmm.
|
|
|
|
$(my_register_name) : $(cts_testcase_file) $(cts_testcase_config)
|
|
|
|
endif # LOCAL_COMPATIBILITY_SUITE
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
###########################################################
|
|
|
|
## Register with ALL_MODULES
|
|
|
|
###########################################################
|
|
|
|
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES += $(my_register_name)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Don't use += on subvars, or else they'll end up being
|
|
|
|
# recursively expanded.
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).CLASS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).CLASS) $(LOCAL_MODULE_CLASS)
|
|
|
|
ALL_MODULES.$(my_register_name).PATH := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).PATH) $(LOCAL_PATH)
|
|
|
|
ALL_MODULES.$(my_register_name).TAGS := \
|
2014-01-28 07:19:09 +08:00
|
|
|
$(ALL_MODULES.$(my_register_name).TAGS) $(my_module_tags)
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).CHECKED := \
|
2014-09-30 05:34:32 +08:00
|
|
|
$(ALL_MODULES.$(my_register_name).CHECKED) $(my_checked_module)
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).BUILT := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).BUILT) $(LOCAL_BUILT_MODULE)
|
2014-05-20 04:03:36 +08:00
|
|
|
ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).INSTALLED := \
|
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).INSTALLED) $(LOCAL_INSTALLED_MODULE))
|
2014-05-20 04:03:36 +08:00
|
|
|
ALL_MODULES.$(my_register_name).BUILT_INSTALLED := \
|
2014-05-21 07:20:44 +08:00
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) $(LOCAL_BUILT_MODULE):$(LOCAL_INSTALLED_MODULE))
|
2014-05-20 04:03:36 +08:00
|
|
|
endif
|
2014-05-06 07:46:52 +08:00
|
|
|
ifdef LOCAL_PICKUP_FILES
|
|
|
|
# Files or directories ready to pick up by the build system
|
|
|
|
# when $(LOCAL_BUILT_MODULE) is done.
|
|
|
|
ALL_MODULES.$(my_register_name).PICKUP_FILES := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).PICKUP_FILES) $(LOCAL_PICKUP_FILES)
|
|
|
|
endif
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).REQUIRED := \
|
2014-02-11 14:26:23 +08:00
|
|
|
$(strip $(ALL_MODULES.$(my_register_name).REQUIRED) $(LOCAL_REQUIRED_MODULES) \
|
|
|
|
$(LOCAL_REQUIRED_MODULES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)))
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS) $(event_log_tags)
|
|
|
|
ALL_MODULES.$(my_register_name).INTERMEDIATE_SOURCE_DIR := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).INTERMEDIATE_SOURCE_DIR) $(LOCAL_INTERMEDIATE_SOURCE_DIR)
|
|
|
|
ALL_MODULES.$(my_register_name).MAKEFILE := \
|
|
|
|
$(ALL_MODULES.$(my_register_name).MAKEFILE) $(LOCAL_MODULE_MAKEFILE)
|
2011-12-10 07:11:57 +08:00
|
|
|
ifdef LOCAL_MODULE_OWNER
|
2014-01-16 08:02:16 +08:00
|
|
|
ALL_MODULES.$(my_register_name).OWNER := \
|
|
|
|
$(sort $(ALL_MODULES.$(my_register_name).OWNER) $(LOCAL_MODULE_OWNER))
|
2011-12-10 07:11:57 +08:00
|
|
|
endif
|
2014-02-11 14:26:23 +08:00
|
|
|
ifdef LOCAL_2ND_ARCH_VAR_PREFIX
|
|
|
|
ALL_MODULES.$(my_register_name).FOR_2ND_ARCH := true
|
|
|
|
endif
|
2014-07-08 06:01:15 +08:00
|
|
|
ifdef aidl_sources
|
|
|
|
ALL_MODULES.$(my_register_name).AIDL_FILES := $(aidl_sources)
|
|
|
|
endif
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2014-01-16 08:02:16 +08:00
|
|
|
INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(my_register_name)
|
2010-05-22 05:29:29 +08:00
|
|
|
|
2015-05-08 03:08:53 +08:00
|
|
|
##########################################################
|
|
|
|
# Track module-level dependencies.
|
|
|
|
# Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
|
|
|
|
ALL_DEPS.MODULES := $(sort $(ALL_DEPS.MODULES) $(LOCAL_MODULE))
|
|
|
|
ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
|
|
|
|
$(ALL_MODULES.$(LOCAL_MODULE).ALL_DEPS) \
|
|
|
|
$(LOCAL_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_WHOLE_STATIC_LIBRARIES) \
|
|
|
|
$(LOCAL_SHARED_LIBRARIES) \
|
|
|
|
$(LOCAL_STATIC_JAVA_LIBRARIES) \
|
|
|
|
$(LOCAL_JAVA_LIBRARIES)\
|
|
|
|
$(LOCAL_JNI_SHARED_LIBRARIES))
|
|
|
|
|
|
|
|
ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files))
|
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
###########################################################
|
2014-01-28 07:19:09 +08:00
|
|
|
## Take care of my_module_tags
|
2009-03-04 11:28:42 +08:00
|
|
|
###########################################################
|
|
|
|
|
|
|
|
# Keep track of all the tags we've seen.
|
2014-01-28 07:19:09 +08:00
|
|
|
ALL_MODULE_TAGS := $(sort $(ALL_MODULE_TAGS) $(my_module_tags))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
# Add this module name to the tag list of each specified tag.
|
2014-01-28 07:19:09 +08:00
|
|
|
$(foreach tag,$(my_module_tags),\
|
2014-01-16 08:02:16 +08:00
|
|
|
$(eval ALL_MODULE_NAME_TAGS.$(tag) += $(my_register_name)))
|
2009-03-04 11:28:42 +08:00
|
|
|
|
2013-01-30 08:59:18 +08:00
|
|
|
###########################################################
|
|
|
|
## umbrella targets used to verify builds
|
|
|
|
###########################################################
|
|
|
|
j_or_n :=
|
|
|
|
ifneq (,$(filter EXECUTABLES SHARED_LIBRARIES STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)))
|
|
|
|
j_or_n := native
|
|
|
|
else
|
|
|
|
ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS)))
|
|
|
|
j_or_n := java
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
h_or_t := host
|
|
|
|
else
|
|
|
|
h_or_t := target
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef j_or_n
|
2014-09-30 05:34:32 +08:00
|
|
|
$(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_t) : $(my_checked_module)
|
2014-01-28 07:19:09 +08:00
|
|
|
ifneq (,$(filter $(my_module_tags),tests))
|
2014-09-30 05:34:32 +08:00
|
|
|
$(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(my_checked_module)
|
2013-01-30 08:59:18 +08:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2014-09-08 20:45:14 +08:00
|
|
|
###########################################################
|
|
|
|
# JACK
|
|
|
|
###########################################################
|
2015-01-09 17:36:40 +08:00
|
|
|
ifdef LOCAL_JACK_ENABLED
|
2014-09-08 20:45:14 +08:00
|
|
|
ifdef need_compile_java
|
|
|
|
|
|
|
|
full_static_jack_libs := \
|
|
|
|
$(foreach lib,$(LOCAL_STATIC_JAVA_LIBRARIES), \
|
|
|
|
$(call intermediates-dir-for, \
|
|
|
|
JAVA_LIBRARIES,$(lib),$(LOCAL_IS_HOST_MODULE),COMMON)/classes.jack)
|
|
|
|
|
|
|
|
ifeq ($(my_prefix),TARGET_)
|
|
|
|
ifeq ($(LOCAL_SDK_VERSION),)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(call jack-lib-files,core-libart)
|
|
|
|
else
|
|
|
|
ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),current)
|
|
|
|
# LOCAL_SDK_VERSION is current and no TARGET_BUILD_APPS.
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(call jack-lib-files,android_stubs_current)
|
|
|
|
else ifeq ($(LOCAL_SDK_VERSION)$(TARGET_BUILD_APPS),system_current)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(call jack-lib-files,android_system_stubs_current)
|
|
|
|
else
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(call jack-lib-files,sdk_v$(LOCAL_SDK_VERSION))
|
|
|
|
endif # current or system_current
|
|
|
|
endif # LOCAL_SDK_VERSION
|
|
|
|
endif # TARGET_
|
|
|
|
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_STATIC_JACK_LIBRARIES := $(full_static_jack_libs)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_JACK_EXTRA_ARGS := $(LOCAL_JACK_EXTRA_ARGS)
|
|
|
|
|
|
|
|
ifdef LOCAL_IS_HOST_MODULE
|
|
|
|
ifeq ($(USE_CORE_LIB_BOOTCLASSPATH),true)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES := $(call jack-lib-files,core-libart-hostdex,$(LOCAL_IS_HOST_MODULE))
|
|
|
|
full_shared_jack_libs := $(call jack-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
|
|
|
full_jack_lib_deps := $(call jack-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
|
|
|
else
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_BOOTCLASSPATH_JAVA_LIBRARIES :=
|
|
|
|
full_shared_jack_libs := $(call jack-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
|
|
|
full_jack_lib_deps := $(full_shared_jack_libs)
|
|
|
|
endif # USE_CORE_LIB_BOOTCLASSPATH
|
|
|
|
else # !LOCAL_IS_HOST_MODULE
|
|
|
|
full_shared_jack_libs := $(call jack-lib-files,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
|
|
|
full_jack_lib_deps := $(call jack-lib-deps,$(LOCAL_JAVA_LIBRARIES),$(LOCAL_IS_HOST_MODULE))
|
|
|
|
endif # !LOCAL_IS_HOST_MODULE
|
|
|
|
full_jack_libs := $(full_shared_jack_libs) $(full_static_jack_libs) $(LOCAL_JACK_CLASSPATH)
|
|
|
|
full_jack_lib_deps += $(full_static_jack_libs) $(LOCAL_JACK_CLASSPATH)
|
|
|
|
|
|
|
|
# This is set by packages that are linking to other packages that export
|
|
|
|
# shared libraries, allowing them to make use of the code in the linked apk.
|
|
|
|
ifneq ($(apk_libraries),)
|
|
|
|
link_apk_jack_libraries := \
|
|
|
|
$(foreach lib,$(apk_libraries), \
|
|
|
|
$(call intermediates-dir-for, \
|
|
|
|
APPS,$(lib),,COMMON)/classes.jack)
|
|
|
|
|
|
|
|
# link against the jar with full original names (before proguard processing).
|
|
|
|
full_shared_jack_libs += $(link_apk_jack_libraries)
|
|
|
|
full_jack_libs += $(link_apk_jack_libraries)
|
|
|
|
full_jack_lib_deps += $(link_apk_jack_libraries)
|
|
|
|
endif
|
|
|
|
|
|
|
|
# This is set by packages that contain instrumentation, allowing them to
|
|
|
|
# link against the package they are instrumenting. Currently only one such
|
|
|
|
# package is allowed.
|
|
|
|
ifdef LOCAL_INSTRUMENTATION_FOR
|
|
|
|
|
|
|
|
# link against the jar with full original names (before proguard processing).
|
|
|
|
link_instr_classes_jack := $(link_instr_intermediates_dir.COMMON)/classes.noshrob.jack
|
|
|
|
full_jack_libs += $(link_instr_classes_jack)
|
|
|
|
full_jack_lib_deps += $(link_instr_classes_jack)
|
|
|
|
endif
|
|
|
|
|
|
|
|
endif # need_compile_java
|
|
|
|
|
|
|
|
# Propagate local configuration options to this target.
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_ALL_JACK_LIBRARIES:= $(full_jack_libs)
|
|
|
|
$(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_JARJAR_RULES := $(LOCAL_JARJAR_RULES)
|
|
|
|
|
2015-01-09 17:36:40 +08:00
|
|
|
endif # LOCAL_JACK_ENABLED
|
2014-09-08 20:45:14 +08:00
|
|
|
|
2009-03-04 11:28:42 +08:00
|
|
|
###########################################################
|
|
|
|
## NOTICE files
|
|
|
|
###########################################################
|
|
|
|
|
2012-11-02 08:22:33 +08:00
|
|
|
include $(BUILD_NOTICE_FILE)
|
2009-03-04 11:28:42 +08:00
|
|
|
|
|
|
|
#:vi noexpandtab
|