The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2008 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 17 | # Catch users that directly include base_rules.mk |
| 18 | $(call record-module-type,base_rules) |
| 19 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 20 | # Users can define base-rules-hook in their buildspec.mk to perform |
| 21 | # arbitrary operations as each module is included. |
| 22 | ifdef base-rules-hook |
| 23 | $(if $(base-rules-hook),) |
| 24 | endif |
| 25 | |
| 26 | ########################################################### |
| 27 | ## Common instructions for a generic module. |
| 28 | ########################################################### |
| 29 | |
| 30 | LOCAL_MODULE := $(strip $(LOCAL_MODULE)) |
| 31 | ifeq ($(LOCAL_MODULE),) |
| 32 | $(error $(LOCAL_PATH): LOCAL_MODULE is not defined) |
| 33 | endif |
| 34 | |
| 35 | LOCAL_IS_HOST_MODULE := $(strip $(LOCAL_IS_HOST_MODULE)) |
| 36 | ifdef LOCAL_IS_HOST_MODULE |
| 37 | ifneq ($(LOCAL_IS_HOST_MODULE),true) |
| 38 | $(error $(LOCAL_PATH): LOCAL_IS_HOST_MODULE must be "true" or empty, not "$(LOCAL_IS_HOST_MODULE)") |
| 39 | endif |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 40 | ifeq ($(LOCAL_HOST_PREFIX),) |
| 41 | my_prefix := HOST_ |
| 42 | else |
| 43 | my_prefix := $(LOCAL_HOST_PREFIX) |
| 44 | endif |
Ying Wang | 13d6950 | 2012-11-01 17:22:33 -0700 | [diff] [blame] | 45 | my_host := host- |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 46 | else |
Ying Wang | 13d6950 | 2012-11-01 17:22:33 -0700 | [diff] [blame] | 47 | my_prefix := TARGET_ |
| 48 | my_host := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 49 | endif |
| 50 | |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 51 | ifeq ($(my_prefix),HOST_CROSS_) |
| 52 | my_host_cross := true |
| 53 | else |
| 54 | my_host_cross := |
| 55 | endif |
| 56 | |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 57 | my_module_tags := $(LOCAL_MODULE_TAGS) |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 58 | ifeq ($(my_host_cross),true) |
| 59 | my_module_tags := |
| 60 | endif |
Ying Wang | 87538e4 | 2016-03-16 19:53:19 -0700 | [diff] [blame] | 61 | ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) |
| 62 | ifdef LOCAL_2ND_ARCH_VAR_PREFIX |
| 63 | # Don't pull in modules by tags if this is for translation TARGET_2ND_ARCH. |
| 64 | my_module_tags := |
| 65 | endif |
| 66 | endif |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 67 | |
Colin Cross | a4447e8 | 2015-09-28 16:26:00 -0700 | [diff] [blame] | 68 | # Ninja has an implicit dependency on the command being run, and kati will |
| 69 | # regenerate the ninja manifest if any read makefile changes, so there is no |
| 70 | # need to have dependencies on makefiles. |
| 71 | # This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains |
| 72 | # a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't include |
| 73 | # base_rules.mk, but it will fix the most common ones. |
| 74 | LOCAL_ADDITIONAL_DEPENDENCIES := $(filter-out %.mk,$(LOCAL_ADDITIONAL_DEPENDENCIES)) |
Colin Cross | a4447e8 | 2015-09-28 16:26:00 -0700 | [diff] [blame] | 75 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 76 | ########################################################### |
| 77 | ## Validate and define fallbacks for input LOCAL_* variables. |
| 78 | ########################################################### |
| 79 | |
| 80 | ## Dump a .csv file of all modules and their tags |
| 81 | #ifneq ($(tag-list-first-time),false) |
| 82 | #$(shell rm -f tag-list.csv) |
| 83 | #tag-list-first-time := false |
| 84 | #endif |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 85 | #$(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) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 86 | |
Ying Wang | 6e371e4 | 2012-05-15 14:31:26 -0700 | [diff] [blame] | 87 | LOCAL_UNINSTALLABLE_MODULE := $(strip $(LOCAL_UNINSTALLABLE_MODULE)) |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 88 | my_module_tags := $(sort $(my_module_tags)) |
| 89 | ifeq (,$(my_module_tags)) |
| 90 | my_module_tags := optional |
Ying Wang | 2fd81cf | 2010-12-10 11:17:28 -0800 | [diff] [blame] | 91 | endif |
Joe Onorato | 918ee31 | 2012-05-18 20:43:14 -0700 | [diff] [blame] | 92 | |
Joe Onorato | 6a185e4 | 2012-05-22 14:08:50 -0700 | [diff] [blame] | 93 | # User tags are not allowed anymore. Fail early because it will not be installed |
| 94 | # like it used to be. |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 95 | ifneq ($(filter $(my_module_tags),user),) |
Joe Onorato | 6a185e4 | 2012-05-22 14:08:50 -0700 | [diff] [blame] | 96 | $(warning *** Module name: $(LOCAL_MODULE)) |
| 97 | $(warning *** Makefile location: $(LOCAL_MODULE_MAKEFILE)) |
| 98 | $(warning * ) |
| 99 | $(warning * Module is attempting to use the 'user' tag. This) |
| 100 | $(warning * used to cause the module to be installed automatically.) |
| 101 | $(warning * Now, the module must be listed in the PRODUCT_PACKAGES) |
| 102 | $(warning * section of a product makefile to have it installed.) |
| 103 | $(warning * ) |
| 104 | $(error user tag detected on module.) |
| 105 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 106 | |
Jean-Baptiste Queru | a831cbd | 2010-01-07 11:06:50 -0800 | [diff] [blame] | 107 | # Only the tags mentioned in this test are expected to be set by module |
| 108 | # makefiles. Anything else is either a typo or a source of unexpected |
| 109 | # behaviors. |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 110 | ifneq ($(filter-out debug eng tests optional samples,$(my_module_tags)),) |
| 111 | $(warning unusual tags $(my_module_tags) on $(LOCAL_MODULE) at $(LOCAL_PATH)) |
Jean-Baptiste Queru | a831cbd | 2010-01-07 11:06:50 -0800 | [diff] [blame] | 112 | endif |
| 113 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 114 | # Add implicit tags. |
| 115 | # |
| 116 | # If the local directory or one of its parents contains a MODULE_LICENSE_GPL |
Andrew Boie | 08a943b | 2013-12-10 13:52:00 -0800 | [diff] [blame] | 117 | # file, tag the module as "gnu". Search for "*_GPL*", "*_LGPL*" and "*_MPL*" |
| 118 | # so that we can also find files like MODULE_LICENSE_GPL_AND_AFL |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 119 | # |
Ying Wang | 39b9b69 | 2015-05-07 12:08:53 -0700 | [diff] [blame] | 120 | license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*) |
Andrew Boie | 08a943b | 2013-12-10 13:52:00 -0800 | [diff] [blame] | 121 | gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*) |
Ying Wang | fd626f2 | 2011-12-12 12:57:38 -0800 | [diff] [blame] | 122 | ifneq ($(gpl_license_file),) |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 123 | my_module_tags += gnu |
Ying Wang | fd626f2 | 2011-12-12 12:57:38 -0800 | [diff] [blame] | 124 | ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 125 | endif |
| 126 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 127 | LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS)) |
| 128 | ifneq ($(words $(LOCAL_MODULE_CLASS)),1) |
| 129 | $(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)") |
| 130 | endif |
| 131 | |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 132 | my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32) |
Colin Cross | 8797405 | 2014-03-21 12:25:44 -0700 | [diff] [blame] | 133 | |
Ying Wang | 6e371e4 | 2012-05-15 14:31:26 -0700 | [diff] [blame] | 134 | ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE)) |
Ying Wang | 87538e4 | 2016-03-16 19:53:19 -0700 | [diff] [blame] | 135 | ifeq ($(TARGET_TRANSLATE_2ND_ARCH),true) |
| 136 | # When in TARGET_TRANSLATE_2ND_ARCH both TARGET_ARCH and TARGET_2ND_ARCH are 32-bit, |
| 137 | # to avoid path conflict we force using LOCAL_MODULE_PATH_64 for the first arch. |
| 138 | ifdef LOCAL_2ND_ARCH_VAR_PREFIX |
| 139 | my_multilib_module_path := $(LOCAL_MODULE_PATH_32) |
| 140 | else # ! LOCAL_2ND_ARCH_VAR_PREFIX |
| 141 | my_multilib_module_path := $(LOCAL_MODULE_PATH_64) |
| 142 | endif # ! LOCAL_2ND_ARCH_VAR_PREFIX |
| 143 | else # ! TARGET_TRANSLATE_2ND_ARCH |
Colin Cross | 8797405 | 2014-03-21 12:25:44 -0700 | [diff] [blame] | 144 | my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix))) |
Ying Wang | 87538e4 | 2016-03-16 19:53:19 -0700 | [diff] [blame] | 145 | endif # ! TARGET_TRANSLATE_2ND_ARCH |
Colin Cross | 8797405 | 2014-03-21 12:25:44 -0700 | [diff] [blame] | 146 | ifdef my_multilib_module_path |
| 147 | my_module_path := $(my_multilib_module_path) |
| 148 | else |
Ying Wang | b8e0185 | 2014-01-23 15:09:04 -0800 | [diff] [blame] | 149 | my_module_path := $(strip $(LOCAL_MODULE_PATH)) |
Colin Cross | 8797405 | 2014-03-21 12:25:44 -0700 | [diff] [blame] | 150 | endif |
Colin Cross | 639c336 | 2014-01-24 19:23:40 -0800 | [diff] [blame] | 151 | my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH)) |
Ying Wang | b8e0185 | 2014-01-23 15:09:04 -0800 | [diff] [blame] | 152 | ifeq ($(my_module_path),) |
Ying Wang | 5338fbf | 2013-05-08 15:49:08 -0700 | [diff] [blame] | 153 | ifdef LOCAL_IS_HOST_MODULE |
| 154 | partition_tag := |
| 155 | else |
| 156 | ifeq (true,$(LOCAL_PROPRIETARY_MODULE)) |
| 157 | partition_tag := _VENDOR |
Ying Wang | b888843 | 2014-03-11 17:13:27 -0700 | [diff] [blame] | 158 | else ifeq (true,$(LOCAL_OEM_MODULE)) |
| 159 | partition_tag := _OEM |
Ying Wang | 4540a85 | 2015-03-12 18:30:39 -0700 | [diff] [blame] | 160 | else ifeq (true,$(LOCAL_ODM_MODULE)) |
| 161 | partition_tag := _ODM |
Dan Willemsen | 7fe992c | 2016-03-02 13:54:51 -0800 | [diff] [blame] | 162 | else ifeq (NATIVE_TESTS,$(LOCAL_MODULE_CLASS)) |
| 163 | partition_tag := _DATA |
Ying Wang | 5338fbf | 2013-05-08 15:49:08 -0700 | [diff] [blame] | 164 | else |
| 165 | # The definition of should-install-to-system will be different depending |
| 166 | # on which goal (e.g., sdk or just droid) is being built. |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 167 | partition_tag := $(if $(call should-install-to-system,$(my_module_tags)),,_DATA) |
Ying Wang | 5338fbf | 2013-05-08 15:49:08 -0700 | [diff] [blame] | 168 | endif |
| 169 | endif |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 170 | install_path_var := $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS) |
Ying Wang | 5338fbf | 2013-05-08 15:49:08 -0700 | [diff] [blame] | 171 | ifeq (true,$(LOCAL_PRIVILEGED_MODULE)) |
| 172 | install_path_var := $(install_path_var)_PRIVILEGED |
| 173 | endif |
| 174 | |
Colin Cross | b34911c | 2014-01-22 17:34:28 -0800 | [diff] [blame] | 175 | my_module_path := $($(install_path_var)) |
Ying Wang | b8e0185 | 2014-01-23 15:09:04 -0800 | [diff] [blame] | 176 | ifeq ($(strip $(my_module_path)),) |
| 177 | $(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)") |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 178 | endif |
| 179 | endif |
Colin Cross | 639c336 | 2014-01-24 19:23:40 -0800 | [diff] [blame] | 180 | ifneq ($(my_module_relative_path),) |
| 181 | my_module_path := $(my_module_path)/$(my_module_relative_path) |
| 182 | endif |
Ying Wang | 6e371e4 | 2012-05-15 14:31:26 -0700 | [diff] [blame] | 183 | endif # not LOCAL_UNINSTALLABLE_MODULE |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 184 | |
| 185 | ifneq ($(strip $(LOCAL_BUILT_MODULE)$(LOCAL_INSTALLED_MODULE)),) |
| 186 | $(error $(LOCAL_PATH): LOCAL_BUILT_MODULE and LOCAL_INSTALLED_MODULE must not be defined by component makefiles) |
| 187 | endif |
| 188 | |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 189 | my_register_name := $(LOCAL_MODULE) |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 190 | ifeq ($(my_host_cross),true) |
| 191 | my_register_name := host_cross_$(LOCAL_MODULE) |
| 192 | endif |
Dan Willemsen | 9ecbf83 | 2016-02-05 16:20:19 -0800 | [diff] [blame] | 193 | ifdef LOCAL_2ND_ARCH_VAR_PREFIX |
| 194 | ifndef LOCAL_NO_2ND_ARCH_MODULE_SUFFIX |
| 195 | my_register_name := $(my_register_name)$($(my_prefix)2ND_ARCH_MODULE_SUFFIX) |
| 196 | endif |
| 197 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 198 | # Make sure that this IS_HOST/CLASS/MODULE combination is unique. |
| 199 | module_id := MODULE.$(if \ |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 200 | $(LOCAL_IS_HOST_MODULE),$($(my_prefix)OS),TARGET).$(LOCAL_MODULE_CLASS).$(my_register_name) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 201 | ifdef $(module_id) |
| 202 | $(error $(LOCAL_PATH): $(module_id) already defined by $($(module_id))) |
| 203 | endif |
| 204 | $(module_id) := $(LOCAL_PATH) |
| 205 | |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 206 | intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 207 | intermediates.COMMON := $(call local-intermediates-dir,COMMON) |
Colin Cross | d826264 | 2014-01-24 23:17:21 -0800 | [diff] [blame] | 208 | generated_sources_dir := $(call local-generated-sources-dir) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 209 | |
| 210 | ########################################################### |
| 211 | # Pick a name for the intermediate and final targets |
| 212 | ########################################################### |
Colin Cross | 5a9db90 | 2014-03-21 12:27:37 -0700 | [diff] [blame] | 213 | include $(BUILD_SYSTEM)/configure_module_stem.mk |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 214 | |
| 215 | # OVERRIDE_BUILT_MODULE_PATH is only allowed to be used by the |
| 216 | # internal SHARED_LIBRARIES build files. |
| 217 | OVERRIDE_BUILT_MODULE_PATH := $(strip $(OVERRIDE_BUILT_MODULE_PATH)) |
| 218 | ifdef OVERRIDE_BUILT_MODULE_PATH |
| 219 | ifneq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES) |
| 220 | $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH) |
| 221 | endif |
| 222 | built_module_path := $(OVERRIDE_BUILT_MODULE_PATH) |
| 223 | else |
| 224 | built_module_path := $(intermediates) |
| 225 | endif |
Ying Wang | 966c1e0 | 2014-05-20 14:43:51 -0700 | [diff] [blame] | 226 | LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 227 | |
Ying Wang | 162991b | 2011-09-07 10:21:42 -0700 | [diff] [blame] | 228 | ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE)) |
Ying Wang | af9757e | 2014-07-17 21:24:42 -0700 | [diff] [blame] | 229 | # Apk and its attachments reside in its own subdir. |
| 230 | ifeq ($(LOCAL_MODULE_CLASS),APPS) |
| 231 | # framework-res.apk doesn't like the additional layer. |
| 232 | ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true) |
| 233 | my_module_path := $(my_module_path)/$(LOCAL_MODULE) |
| 234 | endif |
| 235 | endif |
Ying Wang | 966c1e0 | 2014-05-20 14:43:51 -0700 | [diff] [blame] | 236 | LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 237 | endif |
| 238 | |
| 239 | # Assemble the list of targets to create PRIVATE_ variables for. |
| 240 | LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE) |
| 241 | |
Yasuhiro Matsuda | ff82e82 | 2015-09-04 16:23:49 +0900 | [diff] [blame] | 242 | ########################################################### |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 243 | ## Create .toc files from shared objects to reduce unnecessary rebuild |
| 244 | # .toc files have the list of external dynamic symbols without their addresses. |
Shinichiro Hamaji | 89b255a | 2015-11-09 16:47:42 +0900 | [diff] [blame] | 245 | # As .KATI_RESTAT is specified to .toc files and commit-change-for-toc is used, |
| 246 | # dependent binaries of a .toc file will be rebuilt only when the content of |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 247 | # the .toc file is changed. |
| 248 | ########################################################### |
Ying Wang | c01f2dc | 2015-12-15 10:00:19 -0800 | [diff] [blame] | 249 | ifndef LOCAL_IS_HOST_MODULE |
| 250 | # Disable .toc optimization for host modules: we may run the host binaries during the build process |
| 251 | # and the libraries' implementation matters. |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 252 | ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES) |
| 253 | LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE).toc |
| 254 | $(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE) |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 255 | $(call $(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)transform-shared-lib-to-toc,$<,$@.tmp) |
Shinichiro Hamaji | 89b255a | 2015-11-09 16:47:42 +0900 | [diff] [blame] | 256 | $(call commit-change-for-toc,$@) |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 257 | |
| 258 | # Kati adds restat=1 to ninja. GNU make does nothing for this. |
| 259 | .KATI_RESTAT: $(LOCAL_BUILT_MODULE).toc |
Colin Cross | e2b8f68 | 2016-02-04 13:28:04 -0800 | [diff] [blame] | 260 | # Build .toc file when using mm, mma, or make $(my_register_name) |
| 261 | $(my_register_name): $(LOCAL_BUILT_MODULE).toc |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 262 | endif |
Ying Wang | c01f2dc | 2015-12-15 10:00:19 -0800 | [diff] [blame] | 263 | endif |
Shinichiro Hamaji | 0e7587a | 2015-10-09 14:36:04 +0900 | [diff] [blame] | 264 | |
| 265 | ########################################################### |
Yasuhiro Matsuda | ff82e82 | 2015-09-04 16:23:49 +0900 | [diff] [blame] | 266 | ## logtags: Add .logtags files to global list |
| 267 | ########################################################### |
| 268 | |
Dan Willemsen | b0a08b8 | 2016-06-01 15:27:11 -0700 | [diff] [blame] | 269 | logtags_sources := $(filter %.logtags,$(LOCAL_SRC_FILES)) $(LOCAL_LOGTAGS_FILES) |
Yasuhiro Matsuda | ff82e82 | 2015-09-04 16:23:49 +0900 | [diff] [blame] | 270 | |
| 271 | ifneq ($(strip $(logtags_sources)),) |
| 272 | event_log_tags := $(addprefix $(LOCAL_PATH)/,$(logtags_sources)) |
| 273 | else |
| 274 | event_log_tags := |
| 275 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 276 | |
| 277 | ########################################################### |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 278 | ## make clean- targets |
| 279 | ########################################################### |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 280 | cleantarget := clean-$(my_register_name) |
| 281 | $(cleantarget) : PRIVATE_MODULE := $(my_register_name) |
Ying Wang | 4d06341 | 2013-03-22 18:52:57 -0700 | [diff] [blame] | 282 | $(cleantarget) : PRIVATE_CLEAN_FILES := \ |
Ying Wang | 95221ca | 2012-11-07 14:07:34 -0800 | [diff] [blame] | 283 | $(LOCAL_BUILT_MODULE) \ |
| 284 | $(LOCAL_INSTALLED_MODULE) \ |
| 285 | $(intermediates) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 286 | $(cleantarget):: |
| 287 | @echo "Clean: $(PRIVATE_MODULE)" |
| 288 | $(hide) rm -rf $(PRIVATE_CLEAN_FILES) |
| 289 | |
| 290 | ########################################################### |
| 291 | ## Common definitions for module. |
| 292 | ########################################################### |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 293 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PATH:=$(LOCAL_PATH) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 294 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_IS_HOST_MODULE := $(LOCAL_IS_HOST_MODULE) |
| 295 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_HOST:= $(my_host) |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 296 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PREFIX := $(my_prefix) |
| 297 | |
Dima Zavin | 46e9bec | 2009-05-27 19:41:07 -0700 | [diff] [blame] | 298 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_INTERMEDIATES_DIR:= $(intermediates) |
Ying Wang | 6feb6d5 | 2014-04-17 10:03:35 -0700 | [diff] [blame] | 299 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX) |
| 300 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 301 | # Tell the module and all of its sub-modules who it is. |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 302 | $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 303 | |
| 304 | # Provide a short-hand for building this module. |
| 305 | # We name both BUILT and INSTALLED in case |
| 306 | # LOCAL_UNINSTALLABLE_MODULE is set. |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 307 | .PHONY: $(my_register_name) |
| 308 | $(my_register_name): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 309 | |
Ying Wang | 71c5809 | 2016-03-23 11:02:03 -0700 | [diff] [blame] | 310 | ifneq ($(my_register_name),$(LOCAL_MODULE)) |
| 311 | # $(LOCAL_MODULE) covers all the multilib targets. |
| 312 | .PHONY: $(LOCAL_MODULE) |
| 313 | $(LOCAL_MODULE) : $(my_register_name) |
| 314 | endif |
| 315 | |
Ying Wang | caeaa08 | 2015-09-23 16:08:55 -0700 | [diff] [blame] | 316 | # Set up phony targets that covers all modules under the given paths. |
| 317 | # This allows us to build everything in given paths by running mmma/mma. |
| 318 | my_path_components := $(subst /,$(space),$(LOCAL_PATH)) |
| 319 | my_path_prefix := MODULES-IN |
| 320 | $(foreach c, $(my_path_components),\ |
Ying Wang | 61cd884 | 2015-09-24 16:19:19 -0700 | [diff] [blame] | 321 | $(eval my_path_prefix := $(my_path_prefix)-$(c))\ |
Ying Wang | caeaa08 | 2015-09-23 16:08:55 -0700 | [diff] [blame] | 322 | $(eval .PHONY : $(my_path_prefix))\ |
| 323 | $(eval $(my_path_prefix) : $(my_register_name))) |
| 324 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 325 | ########################################################### |
| 326 | ## Module installation rule |
| 327 | ########################################################### |
| 328 | |
Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 329 | my_init_rc_installed := |
| 330 | my_init_rc_pairs := |
| 331 | my_installed_symlinks := |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 332 | ifndef LOCAL_UNINSTALLABLE_MODULE |
Ying Wang | e56605a | 2013-02-06 11:44:41 -0800 | [diff] [blame] | 333 | $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD) |
Dan Willemsen | 7f01615 | 2016-02-29 17:52:39 -0800 | [diff] [blame] | 334 | $(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 335 | @echo "Install: $@" |
Ying Wang | 84ed6fa | 2011-01-18 17:21:20 -0800 | [diff] [blame] | 336 | $(copy-file-to-new-target) |
Ying Wang | e56605a | 2013-02-06 11:44:41 -0800 | [diff] [blame] | 337 | $(PRIVATE_POST_INSTALL_CMD) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 338 | |
Ying Wang | 9fe15ac | 2015-08-20 12:02:10 -0700 | [diff] [blame] | 339 | # Rule to install the module's companion init.rc. |
Ying Wang | 41d6678 | 2016-02-24 17:34:52 -0800 | [diff] [blame] | 340 | my_init_rc := $(LOCAL_INIT_RC_$(my_32_64_bit_suffix)) |
| 341 | ifneq ($(my_init_rc),) |
| 342 | my_init_rc_pairs += $(LOCAL_PATH)/$(my_init_rc):$(TARGET_OUT$(partition_tag)_ETC)/init/$(notdir $(my_init_rc)) |
| 343 | endif |
| 344 | ifneq ($(LOCAL_INIT_RC),) |
| 345 | my_init_rc_pairs += $(LOCAL_PATH)/$(LOCAL_INIT_RC):$(TARGET_OUT$(partition_tag)_ETC)/init/$(notdir $(LOCAL_INIT_RC)) |
Ying Wang | 9fe15ac | 2015-08-20 12:02:10 -0700 | [diff] [blame] | 346 | # Make sure we don't define the rule twice in multilib module. |
| 347 | LOCAL_INIT_RC := |
| 348 | endif |
Ying Wang | 41d6678 | 2016-02-24 17:34:52 -0800 | [diff] [blame] | 349 | ifneq ($(my_init_rc_pairs),) |
| 350 | my_init_rc_installed := $(call copy-many-files,$(my_init_rc_pairs)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 351 | |
Ying Wang | 9fe15ac | 2015-08-20 12:02:10 -0700 | [diff] [blame] | 352 | $(my_register_name) : $(my_init_rc_installed) |
Ying Wang | 41d6678 | 2016-02-24 17:34:52 -0800 | [diff] [blame] | 353 | endif # my_init_rc_pairs |
Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 354 | |
| 355 | # Rule to install the module's companion symlinks |
| 356 | my_installed_symlinks := $(addprefix $(my_module_path)/,$(LOCAL_MODULE_SYMLINKS) $(LOCAL_MODULE_SYMLINKS_$(my_32_64_bit_suffix))) |
| 357 | $(foreach symlink,$(my_installed_symlinks),\ |
| 358 | $(call symlink-file,$(LOCAL_INSTALLED_MODULE),$(my_installed_module_stem),$(symlink))) |
| 359 | |
Ying Wang | 9fe15ac | 2015-08-20 12:02:10 -0700 | [diff] [blame] | 360 | endif # !LOCAL_UNINSTALLABLE_MODULE |
Joe Onorato | e334d25 | 2009-07-17 15:33:40 -0400 | [diff] [blame] | 361 | |
| 362 | ########################################################### |
| 363 | ## CHECK_BUILD goals |
| 364 | ########################################################### |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 365 | my_checked_module := |
Joe Onorato | e334d25 | 2009-07-17 15:33:40 -0400 | [diff] [blame] | 366 | # If nobody has defined a more specific module for the |
Ying Wang | 5a8d345 | 2013-01-30 14:43:05 -0800 | [diff] [blame] | 367 | # checked modules, use LOCAL_BUILT_MODULE. |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 368 | ifdef LOCAL_CHECKED_MODULE |
| 369 | my_checked_module := $(LOCAL_CHECKED_MODULE) |
| 370 | else |
| 371 | my_checked_module := $(LOCAL_BUILT_MODULE) |
Joe Onorato | e334d25 | 2009-07-17 15:33:40 -0400 | [diff] [blame] | 372 | endif |
| 373 | |
| 374 | # If they request that this module not be checked, then don't. |
| 375 | # PLEASE DON'T SET THIS. ANY PLACES THAT SET THIS WITHOUT |
| 376 | # GOOD REASON WILL HAVE IT REMOVED. |
| 377 | ifdef LOCAL_DONT_CHECK_MODULE |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 378 | my_checked_module := |
Joe Onorato | e334d25 | 2009-07-17 15:33:40 -0400 | [diff] [blame] | 379 | endif |
Ying Wang | 966c1e0 | 2014-05-20 14:43:51 -0700 | [diff] [blame] | 380 | # Don't check build target module defined for the 2nd arch |
| 381 | ifndef LOCAL_IS_HOST_MODULE |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 382 | ifdef LOCAL_2ND_ARCH_VAR_PREFIX |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 383 | my_checked_module := |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 384 | endif |
Ying Wang | 966c1e0 | 2014-05-20 14:43:51 -0700 | [diff] [blame] | 385 | endif |
Joe Onorato | e334d25 | 2009-07-17 15:33:40 -0400 | [diff] [blame] | 386 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 387 | ########################################################### |
| 388 | ## Register with ALL_MODULES |
| 389 | ########################################################### |
| 390 | |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 391 | ALL_MODULES += $(my_register_name) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 392 | |
| 393 | # Don't use += on subvars, or else they'll end up being |
| 394 | # recursively expanded. |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 395 | ALL_MODULES.$(my_register_name).CLASS := \ |
| 396 | $(ALL_MODULES.$(my_register_name).CLASS) $(LOCAL_MODULE_CLASS) |
| 397 | ALL_MODULES.$(my_register_name).PATH := \ |
| 398 | $(ALL_MODULES.$(my_register_name).PATH) $(LOCAL_PATH) |
| 399 | ALL_MODULES.$(my_register_name).TAGS := \ |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 400 | $(ALL_MODULES.$(my_register_name).TAGS) $(my_module_tags) |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 401 | ALL_MODULES.$(my_register_name).CHECKED := \ |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 402 | $(ALL_MODULES.$(my_register_name).CHECKED) $(my_checked_module) |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 403 | ALL_MODULES.$(my_register_name).BUILT := \ |
| 404 | $(ALL_MODULES.$(my_register_name).BUILT) $(LOCAL_BUILT_MODULE) |
Ying Wang | 3380d3a | 2014-05-19 13:03:36 -0700 | [diff] [blame] | 405 | ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE)) |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 406 | ALL_MODULES.$(my_register_name).INSTALLED := \ |
Ying Wang | 9fe15ac | 2015-08-20 12:02:10 -0700 | [diff] [blame] | 407 | $(strip $(ALL_MODULES.$(my_register_name).INSTALLED) \ |
Colin Cross | 744d33b | 2016-07-14 16:02:57 -0700 | [diff] [blame] | 408 | $(LOCAL_INSTALLED_MODULE) $(my_init_rc_installed) $(my_installed_symlinks)) |
Ying Wang | 3380d3a | 2014-05-19 13:03:36 -0700 | [diff] [blame] | 409 | ALL_MODULES.$(my_register_name).BUILT_INSTALLED := \ |
Ying Wang | 9fe15ac | 2015-08-20 12:02:10 -0700 | [diff] [blame] | 410 | $(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) \ |
| 411 | $(LOCAL_BUILT_MODULE):$(LOCAL_INSTALLED_MODULE) \ |
Ying Wang | 41d6678 | 2016-02-24 17:34:52 -0800 | [diff] [blame] | 412 | $(my_init_rc_pairs)) |
Ying Wang | 3380d3a | 2014-05-19 13:03:36 -0700 | [diff] [blame] | 413 | endif |
Ying Wang | 3b81aab | 2014-05-05 16:46:52 -0700 | [diff] [blame] | 414 | ifdef LOCAL_PICKUP_FILES |
| 415 | # Files or directories ready to pick up by the build system |
| 416 | # when $(LOCAL_BUILT_MODULE) is done. |
| 417 | ALL_MODULES.$(my_register_name).PICKUP_FILES := \ |
| 418 | $(ALL_MODULES.$(my_register_name).PICKUP_FILES) $(LOCAL_PICKUP_FILES) |
| 419 | endif |
Dan Willemsen | 7a54985 | 2015-08-13 17:51:40 -0700 | [diff] [blame] | 420 | my_required_modules := $(LOCAL_REQUIRED_MODULES) \ |
| 421 | $(LOCAL_REQUIRED_MODULES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH)) |
| 422 | ifdef LOCAL_IS_HOST_MODULE |
| 423 | my_required_modules += $(LOCAL_REQUIRED_MODULES_$($(my_prefix)OS)) |
| 424 | endif |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 425 | ALL_MODULES.$(my_register_name).REQUIRED := \ |
Dan Willemsen | 7a54985 | 2015-08-13 17:51:40 -0700 | [diff] [blame] | 426 | $(strip $(ALL_MODULES.$(my_register_name).REQUIRED) $(my_required_modules)) |
Yasuhiro Matsuda | ff82e82 | 2015-09-04 16:23:49 +0900 | [diff] [blame] | 427 | ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS := \ |
| 428 | $(ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS) $(event_log_tags) |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 429 | ALL_MODULES.$(my_register_name).MAKEFILE := \ |
| 430 | $(ALL_MODULES.$(my_register_name).MAKEFILE) $(LOCAL_MODULE_MAKEFILE) |
Ying Wang | dbb31be | 2011-12-09 15:11:57 -0800 | [diff] [blame] | 431 | ifdef LOCAL_MODULE_OWNER |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 432 | ALL_MODULES.$(my_register_name).OWNER := \ |
| 433 | $(sort $(ALL_MODULES.$(my_register_name).OWNER) $(LOCAL_MODULE_OWNER)) |
Ying Wang | dbb31be | 2011-12-09 15:11:57 -0800 | [diff] [blame] | 434 | endif |
Ying Wang | 14a6cbd | 2014-02-10 22:26:23 -0800 | [diff] [blame] | 435 | ifdef LOCAL_2ND_ARCH_VAR_PREFIX |
| 436 | ALL_MODULES.$(my_register_name).FOR_2ND_ARCH := true |
| 437 | endif |
Dan Willemsen | 057aaea | 2015-08-14 12:59:50 -0700 | [diff] [blame] | 438 | ALL_MODULES.$(my_register_name).FOR_HOST_CROSS := $(my_host_cross) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 439 | |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 440 | INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(my_register_name) |
Joe Onorato | 8a06bac | 2010-05-21 14:29:29 -0700 | [diff] [blame] | 441 | |
Ying Wang | 39b9b69 | 2015-05-07 12:08:53 -0700 | [diff] [blame] | 442 | ########################################################## |
| 443 | # Track module-level dependencies. |
| 444 | # Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness. |
| 445 | ALL_DEPS.MODULES := $(sort $(ALL_DEPS.MODULES) $(LOCAL_MODULE)) |
| 446 | ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \ |
| 447 | $(ALL_MODULES.$(LOCAL_MODULE).ALL_DEPS) \ |
| 448 | $(LOCAL_STATIC_LIBRARIES) \ |
| 449 | $(LOCAL_WHOLE_STATIC_LIBRARIES) \ |
| 450 | $(LOCAL_SHARED_LIBRARIES) \ |
| 451 | $(LOCAL_STATIC_JAVA_LIBRARIES) \ |
| 452 | $(LOCAL_JAVA_LIBRARIES)\ |
| 453 | $(LOCAL_JNI_SHARED_LIBRARIES)) |
| 454 | |
| 455 | ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files)) |
| 456 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 457 | ########################################################### |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 458 | ## Take care of my_module_tags |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 459 | ########################################################### |
| 460 | |
| 461 | # Keep track of all the tags we've seen. |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 462 | ALL_MODULE_TAGS := $(sort $(ALL_MODULE_TAGS) $(my_module_tags)) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 463 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 464 | # Add this module name to the tag list of each specified tag. |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 465 | $(foreach tag,$(my_module_tags),\ |
Ying Wang | 6ef6519 | 2014-01-15 16:02:16 -0800 | [diff] [blame] | 466 | $(eval ALL_MODULE_NAME_TAGS.$(tag) += $(my_register_name))) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 467 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 468 | ########################################################### |
Ying Wang | ef4d82f | 2013-01-29 16:59:18 -0800 | [diff] [blame] | 469 | ## umbrella targets used to verify builds |
| 470 | ########################################################### |
Ying Wang | ef4d82f | 2013-01-29 16:59:18 -0800 | [diff] [blame] | 471 | j_or_n := |
Dan Willemsen | 7fe992c | 2016-03-02 13:54:51 -0800 | [diff] [blame] | 472 | ifneq (,$(filter EXECUTABLES SHARED_LIBRARIES STATIC_LIBRARIES NATIVE_TESTS,$(LOCAL_MODULE_CLASS))) |
Ying Wang | ef4d82f | 2013-01-29 16:59:18 -0800 | [diff] [blame] | 473 | j_or_n := native |
| 474 | else |
| 475 | ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS))) |
| 476 | j_or_n := java |
Ying Wang | ef4d82f | 2013-01-29 16:59:18 -0800 | [diff] [blame] | 477 | endif |
| 478 | endif |
| 479 | ifdef LOCAL_IS_HOST_MODULE |
| 480 | h_or_t := host |
| 481 | else |
| 482 | h_or_t := target |
| 483 | endif |
| 484 | |
| 485 | ifdef j_or_n |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 486 | $(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_t) : $(my_checked_module) |
Ying Wang | 37bd1f2 | 2014-01-27 15:19:09 -0800 | [diff] [blame] | 487 | ifneq (,$(filter $(my_module_tags),tests)) |
Ying Wang | 6c1d1cc | 2014-09-29 14:34:32 -0700 | [diff] [blame] | 488 | $(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(my_checked_module) |
Ying Wang | ef4d82f | 2013-01-29 16:59:18 -0800 | [diff] [blame] | 489 | endif |
| 490 | endif |
| 491 | |
| 492 | ########################################################### |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 493 | ## NOTICE files |
| 494 | ########################################################### |
| 495 | |
Ying Wang | 13d6950 | 2012-11-01 17:22:33 -0700 | [diff] [blame] | 496 | include $(BUILD_NOTICE_FILE) |