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