OSDN Git Service

[DO NOT MERGE] Update Security String to 2017-04-01 for mnc-dev am: 06a57496e6 am...
[android-x86/build.git] / core / base_rules.mk
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
37   ifeq ($(LOCAL_HOST_PREFIX),)
38     my_prefix := HOST_
39   else
40     my_prefix := $(LOCAL_HOST_PREFIX)
41   endif
42   my_host := host-
43 else
44   my_prefix := TARGET_
45   my_host :=
46 endif
47
48 ifeq ($(my_prefix),HOST_CROSS_)
49   my_host_cross := true
50 else
51   my_host_cross :=
52 endif
53
54 my_module_tags := $(LOCAL_MODULE_TAGS)
55 ifeq ($(my_host_cross),true)
56   my_module_tags :=
57 endif
58
59 ifdef BUILDING_WITH_NINJA
60 # Ninja has an implicit dependency on the command being run, and kati will
61 # regenerate the ninja manifest if any read makefile changes, so there is no
62 # need to have dependencies on makefiles.
63 # This won't catch all the cases where LOCAL_ADDITIONAL_DEPENDENCIES contains
64 # a .mk file, because a few users of LOCAL_ADDITIONAL_DEPENDENCIES don't include
65 # base_rules.mk, but it will fix the most common ones.
66 LOCAL_ADDITIONAL_DEPENDENCIES := $(filter-out %.mk,$(LOCAL_ADDITIONAL_DEPENDENCIES))
67 endif
68
69 ###########################################################
70 ## Validate and define fallbacks for input LOCAL_* variables.
71 ###########################################################
72
73 ## Dump a .csv file of all modules and their tags
74 #ifneq ($(tag-list-first-time),false)
75 #$(shell rm -f tag-list.csv)
76 #tag-list-first-time := false
77 #endif
78 #$(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)
79
80 LOCAL_UNINSTALLABLE_MODULE := $(strip $(LOCAL_UNINSTALLABLE_MODULE))
81 my_module_tags := $(sort $(my_module_tags))
82 ifeq (,$(my_module_tags))
83   my_module_tags := optional
84 endif
85
86 # User tags are not allowed anymore.  Fail early because it will not be installed
87 # like it used to be.
88 ifneq ($(filter $(my_module_tags),user),)
89   $(warning *** Module name: $(LOCAL_MODULE))
90   $(warning *** Makefile location: $(LOCAL_MODULE_MAKEFILE))
91   $(warning * )
92   $(warning * Module is attempting to use the 'user' tag.  This)
93   $(warning * used to cause the module to be installed automatically.)
94   $(warning * Now, the module must be listed in the PRODUCT_PACKAGES)
95   $(warning * section of a product makefile to have it installed.)
96   $(warning * )
97   $(error user tag detected on module.)
98 endif
99
100 # Only the tags mentioned in this test are expected to be set by module
101 # makefiles. Anything else is either a typo or a source of unexpected
102 # behaviors.
103 ifneq ($(filter-out debug eng tests optional samples,$(my_module_tags)),)
104 $(warning unusual tags $(my_module_tags) on $(LOCAL_MODULE) at $(LOCAL_PATH))
105 endif
106
107 # Add implicit tags.
108 #
109 # If the local directory or one of its parents contains a MODULE_LICENSE_GPL
110 # file, tag the module as "gnu".  Search for "*_GPL*", "*_LGPL*" and "*_MPL*"
111 # so that we can also find files like MODULE_LICENSE_GPL_AND_AFL
112 #
113 license_files := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*)
114 gpl_license_file := $(call find-parent-file,$(LOCAL_PATH),MODULE_LICENSE*_GPL* MODULE_LICENSE*_MPL* MODULE_LICENSE*_LGPL*)
115 ifneq ($(gpl_license_file),)
116   my_module_tags += gnu
117   ALL_GPL_MODULE_LICENSE_FILES := $(sort $(ALL_GPL_MODULE_LICENSE_FILES) $(gpl_license_file))
118 endif
119
120 LOCAL_MODULE_CLASS := $(strip $(LOCAL_MODULE_CLASS))
121 ifneq ($(words $(LOCAL_MODULE_CLASS)),1)
122   $(error $(LOCAL_PATH): LOCAL_MODULE_CLASS must contain exactly one word, not "$(LOCAL_MODULE_CLASS)")
123 endif
124
125 my_32_64_bit_suffix := $(if $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)IS_64_BIT),64,32)
126
127 ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
128 my_multilib_module_path := $(strip $(LOCAL_MODULE_PATH_$(my_32_64_bit_suffix)))
129 ifdef my_multilib_module_path
130 my_module_path := $(my_multilib_module_path)
131 else
132 my_module_path := $(strip $(LOCAL_MODULE_PATH))
133 endif
134 my_module_relative_path := $(strip $(LOCAL_MODULE_RELATIVE_PATH))
135 ifeq ($(my_module_path),)
136   ifdef LOCAL_IS_HOST_MODULE
137     partition_tag :=
138   else
139   ifeq (true,$(LOCAL_PROPRIETARY_MODULE))
140     partition_tag := _VENDOR
141   else ifeq (true,$(LOCAL_OEM_MODULE))
142     partition_tag := _OEM
143   else ifeq (true,$(LOCAL_ODM_MODULE))
144     partition_tag := _ODM
145   else
146     # The definition of should-install-to-system will be different depending
147     # on which goal (e.g., sdk or just droid) is being built.
148     partition_tag := $(if $(call should-install-to-system,$(my_module_tags)),,_DATA)
149   endif
150   endif
151   install_path_var := $(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)OUT$(partition_tag)_$(LOCAL_MODULE_CLASS)
152   ifeq (true,$(LOCAL_PRIVILEGED_MODULE))
153     install_path_var := $(install_path_var)_PRIVILEGED
154   endif
155
156   my_module_path := $($(install_path_var))
157   ifeq ($(strip $(my_module_path)),)
158     $(error $(LOCAL_PATH): unhandled install path "$(install_path_var) for $(LOCAL_MODULE)")
159   endif
160 endif
161 ifneq ($(my_module_relative_path),)
162   my_module_path := $(my_module_path)/$(my_module_relative_path)
163 endif
164 endif # not LOCAL_UNINSTALLABLE_MODULE
165
166 ifneq ($(strip $(LOCAL_BUILT_MODULE)$(LOCAL_INSTALLED_MODULE)),)
167   $(error $(LOCAL_PATH): LOCAL_BUILT_MODULE and LOCAL_INSTALLED_MODULE must not be defined by component makefiles)
168 endif
169
170 my_register_name := $(LOCAL_MODULE)
171 ifeq ($(my_host_cross),true)
172   my_register_name := host_cross_$(LOCAL_MODULE)
173 endif
174 ifdef LOCAL_2ND_ARCH_VAR_PREFIX
175 ifndef LOCAL_NO_2ND_ARCH_MODULE_SUFFIX
176 my_register_name := $(my_register_name)$($(my_prefix)2ND_ARCH_MODULE_SUFFIX)
177 endif
178 endif
179 # Make sure that this IS_HOST/CLASS/MODULE combination is unique.
180 module_id := MODULE.$(if \
181     $(LOCAL_IS_HOST_MODULE),$($(my_prefix)OS),TARGET).$(LOCAL_MODULE_CLASS).$(my_register_name)
182 ifdef $(module_id)
183 $(error $(LOCAL_PATH): $(module_id) already defined by $($(module_id)))
184 endif
185 $(module_id) := $(LOCAL_PATH)
186
187 intermediates := $(call local-intermediates-dir,,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))
188 intermediates.COMMON := $(call local-intermediates-dir,COMMON)
189 generated_sources_dir := $(call local-generated-sources-dir)
190
191 ###########################################################
192 # Pick a name for the intermediate and final targets
193 ###########################################################
194 include $(BUILD_SYSTEM)/configure_module_stem.mk
195
196 # OVERRIDE_BUILT_MODULE_PATH is only allowed to be used by the
197 # internal SHARED_LIBRARIES build files.
198 OVERRIDE_BUILT_MODULE_PATH := $(strip $(OVERRIDE_BUILT_MODULE_PATH))
199 ifdef OVERRIDE_BUILT_MODULE_PATH
200   ifneq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
201     $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH)
202   endif
203   built_module_path := $(OVERRIDE_BUILT_MODULE_PATH)
204 else
205   built_module_path := $(intermediates)
206 endif
207 LOCAL_BUILT_MODULE := $(built_module_path)/$(my_built_module_stem)
208
209 ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
210   # Apk and its attachments reside in its own subdir.
211   ifeq ($(LOCAL_MODULE_CLASS),APPS)
212   # framework-res.apk doesn't like the additional layer.
213   ifneq ($(LOCAL_NO_STANDARD_LIBRARIES),true)
214     my_module_path := $(my_module_path)/$(LOCAL_MODULE)
215   endif
216   endif
217   LOCAL_INSTALLED_MODULE := $(my_module_path)/$(my_installed_module_stem)
218 endif
219
220 # Assemble the list of targets to create PRIVATE_ variables for.
221 LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE)
222
223 ###########################################################
224 ## Create .toc files from shared objects to reduce unnecessary rebuild
225 # .toc files have the list of external dynamic symbols without their addresses.
226 # As .KATI_RESTAT is specified to .toc files and commit-change-for-toc is used,
227 # dependent binaries of a .toc file will be rebuilt only when the content of
228 # the .toc file is changed.
229 ###########################################################
230 ifndef LOCAL_IS_HOST_MODULE
231 # Disable .toc optimization for host modules: we may run the host binaries during the build process
232 # and the libraries' implementation matters.
233 ifeq ($(LOCAL_MODULE_CLASS),SHARED_LIBRARIES)
234 LOCAL_INTERMEDIATE_TARGETS += $(LOCAL_BUILT_MODULE).toc
235 $(LOCAL_BUILT_MODULE).toc: $(LOCAL_BUILT_MODULE)
236         $(call $(PRIVATE_2ND_ARCH_VAR_PREFIX)$(PRIVATE_PREFIX)transform-shared-lib-to-toc,$<,$@.tmp)
237         $(call commit-change-for-toc,$@)
238
239 # Kati adds restat=1 to ninja. GNU make does nothing for this.
240 .KATI_RESTAT: $(LOCAL_BUILT_MODULE).toc
241 # Build .toc file when using mm, mma, or make $(my_register_name)
242 $(my_register_name): $(LOCAL_BUILT_MODULE).toc
243 endif
244 endif
245
246 ###########################################################
247 ## logtags: Add .logtags files to global list
248 ###########################################################
249
250 logtags_sources := $(filter %.logtags,$(LOCAL_SRC_FILES))
251
252 ifneq ($(strip $(logtags_sources)),)
253 event_log_tags := $(addprefix $(LOCAL_PATH)/,$(logtags_sources))
254 else
255 event_log_tags :=
256 endif
257
258 ###########################################################
259 ## make clean- targets
260 ###########################################################
261 cleantarget := clean-$(my_register_name)
262 $(cleantarget) : PRIVATE_MODULE := $(my_register_name)
263 $(cleantarget) : PRIVATE_CLEAN_FILES := \
264     $(LOCAL_BUILT_MODULE) \
265     $(LOCAL_INSTALLED_MODULE) \
266     $(intermediates)
267 $(cleantarget)::
268         @echo "Clean: $(PRIVATE_MODULE)"
269         $(hide) rm -rf $(PRIVATE_CLEAN_FILES)
270
271 ###########################################################
272 ## Common definitions for module.
273 ###########################################################
274 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PATH:=$(LOCAL_PATH)
275 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_IS_HOST_MODULE := $(LOCAL_IS_HOST_MODULE)
276 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_HOST:= $(my_host)
277 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_PREFIX := $(my_prefix)
278
279 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_INTERMEDIATES_DIR:= $(intermediates)
280 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
281
282 # Tell the module and all of its sub-modules who it is.
283 $(LOCAL_INTERMEDIATE_TARGETS) : PRIVATE_MODULE:= $(my_register_name)
284
285 # Provide a short-hand for building this module.
286 # We name both BUILT and INSTALLED in case
287 # LOCAL_UNINSTALLABLE_MODULE is set.
288 .PHONY: $(my_register_name)
289 $(my_register_name): $(LOCAL_BUILT_MODULE) $(LOCAL_INSTALLED_MODULE)
290
291 # Set up phony targets that covers all modules under the given paths.
292 # This allows us to build everything in given paths by running mmma/mma.
293 my_path_components := $(subst /,$(space),$(LOCAL_PATH))
294 my_path_prefix := MODULES-IN
295 $(foreach c, $(my_path_components),\
296   $(eval my_path_prefix := $(my_path_prefix)-$(c))\
297   $(eval .PHONY : $(my_path_prefix))\
298   $(eval $(my_path_prefix) : $(my_register_name)))
299
300 ###########################################################
301 ## Module installation rule
302 ###########################################################
303
304 # Some hosts do not have ACP; override the LOCAL version if that's the case.
305 ifneq ($(strip $(HOST_ACP_UNAVAILABLE)),)
306   LOCAL_ACP_UNAVAILABLE := $(strip $(HOST_ACP_UNAVAILABLE))
307 endif
308
309 ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
310   # Define a copy rule to install the module.
311   # acp and libraries that it uses can't use acp for
312   # installation;  hence, LOCAL_ACP_UNAVAILABLE.
313 $(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD := $(LOCAL_POST_INSTALL_CMD)
314 ifneq ($(LOCAL_ACP_UNAVAILABLE),true)
315 $(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE) | $(ACP)
316         @echo "Install: $@"
317         $(copy-file-to-new-target)
318         $(PRIVATE_POST_INSTALL_CMD)
319 else
320 $(LOCAL_INSTALLED_MODULE): $(LOCAL_BUILT_MODULE)
321         @echo "Install: $@"
322         $(copy-file-to-target-with-cp)
323 endif
324
325 # Rule to install the module's companion init.rc.
326 my_init_rc := $(LOCAL_INIT_RC_$(my_32_64_bit_suffix))
327 my_init_rc_src :=
328 my_init_rc_installed :=
329 ifndef my_init_rc
330 my_init_rc := $(LOCAL_INIT_RC)
331 # Make sure we don't define the rule twice in multilib module.
332 LOCAL_INIT_RC :=
333 endif
334 ifdef my_init_rc
335 my_init_rc_src := $(LOCAL_PATH)/$(my_init_rc)
336 my_init_rc_installed := $(TARGET_OUT$(partition_tag)_ETC)/init/$(notdir $(my_init_rc_src))
337 $(my_init_rc_installed) : $(my_init_rc_src) | $(ACP)
338         @echo "Install: $@"
339         $(copy-file-to-new-target)
340
341 $(my_register_name) : $(my_init_rc_installed)
342 endif # my_init_rc
343 endif # !LOCAL_UNINSTALLABLE_MODULE
344
345 ###########################################################
346 ## CHECK_BUILD goals
347 ###########################################################
348 my_checked_module :=
349 # If nobody has defined a more specific module for the
350 # checked modules, use LOCAL_BUILT_MODULE.
351 ifdef LOCAL_CHECKED_MODULE
352   my_checked_module := $(LOCAL_CHECKED_MODULE)
353 else
354   my_checked_module := $(LOCAL_BUILT_MODULE)
355 endif
356
357 # If they request that this module not be checked, then don't.
358 # PLEASE DON'T SET THIS.  ANY PLACES THAT SET THIS WITHOUT
359 # GOOD REASON WILL HAVE IT REMOVED.
360 ifdef LOCAL_DONT_CHECK_MODULE
361   my_checked_module :=
362 endif
363 # Don't check build target module defined for the 2nd arch
364 ifndef LOCAL_IS_HOST_MODULE
365 ifdef LOCAL_2ND_ARCH_VAR_PREFIX
366   my_checked_module :=
367 endif
368 endif
369
370 ###########################################################
371 ## Compatibiliy suite files.
372 ###########################################################
373 ifdef LOCAL_COMPATIBILITY_SUITE
374 ifneq ($(words $(LOCAL_COMPATIBILITY_SUITE)),1)
375 $(error $(LOCAL_PATH):$(LOCAL_MODULE) LOCAL_COMPATIBILITY_SUITE can be only one name)
376 endif
377
378 # The module itself.
379 my_compat_dist := \
380   $(LOCAL_BUILT_MODULE):$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(my_installed_module_stem)
381
382 # Make sure we only add the files once for multilib modules.
383 ifndef $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
384 $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files := true
385
386 # LOCAL_COMPATIBILITY_SUPPORT_FILES is a list of <src>[:<dest>].
387 my_compat_dist += $(foreach f, $(LOCAL_COMPATIBILITY_SUPPORT_FILES),\
388   $(eval p := $(subst :,$(space),$(f)))\
389   $(eval s := $(word 1,$(p)))\
390   $(eval d := $(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(or $(word 2,$(p)),$(notdir $(word 1,$(p)))))\
391   $(s):$(d))
392
393 ifneq (,$(wildcard $(LOCAL_PATH)/AndroidTest.xml))
394 my_compat_dist += \
395   $(LOCAL_PATH)/AndroidTest.xml:$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).config
396 endif
397
398 ifneq (,$(wildcard $(LOCAL_PATH)/DynamicConfig.xml))
399 my_compat_dist += \
400   $(LOCAL_PATH)/DynamicConfig.xml:$(COMPATIBILITY_TESTCASES_OUT_$(LOCAL_COMPATIBILITY_SUITE))/$(LOCAL_MODULE).dynamic
401 endif
402 endif # $(my_prefix)$(LOCAL_MODULE_CLASS)_$(LOCAL_MODULE)_compat_files
403
404 my_compat_files := $(call copy-many-files, $(my_compat_dist))
405
406 COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES := \
407   $(COMPATIBILITY.$(LOCAL_COMPATIBILITY_SUITE).FILES) \
408   $(my_compat_files)
409
410 # Copy over the compatibility files when user runs mm/mmm.
411 $(my_register_name) : $(my_compat_files)
412 endif  # LOCAL_COMPATIBILITY_SUITE
413
414 ###########################################################
415 ## Register with ALL_MODULES
416 ###########################################################
417
418 ALL_MODULES += $(my_register_name)
419
420 # Don't use += on subvars, or else they'll end up being
421 # recursively expanded.
422 ALL_MODULES.$(my_register_name).CLASS := \
423     $(ALL_MODULES.$(my_register_name).CLASS) $(LOCAL_MODULE_CLASS)
424 ALL_MODULES.$(my_register_name).PATH := \
425     $(ALL_MODULES.$(my_register_name).PATH) $(LOCAL_PATH)
426 ALL_MODULES.$(my_register_name).TAGS := \
427     $(ALL_MODULES.$(my_register_name).TAGS) $(my_module_tags)
428 ALL_MODULES.$(my_register_name).CHECKED := \
429     $(ALL_MODULES.$(my_register_name).CHECKED) $(my_checked_module)
430 ALL_MODULES.$(my_register_name).BUILT := \
431     $(ALL_MODULES.$(my_register_name).BUILT) $(LOCAL_BUILT_MODULE)
432 ifneq (true,$(LOCAL_UNINSTALLABLE_MODULE))
433 ALL_MODULES.$(my_register_name).INSTALLED := \
434     $(strip $(ALL_MODULES.$(my_register_name).INSTALLED) \
435     $(LOCAL_INSTALLED_MODULE) $(my_init_rc_installed))
436 ALL_MODULES.$(my_register_name).BUILT_INSTALLED := \
437     $(strip $(ALL_MODULES.$(my_register_name).BUILT_INSTALLED) \
438     $(LOCAL_BUILT_MODULE):$(LOCAL_INSTALLED_MODULE) \
439     $(addprefix $(my_init_rc_src):,$(my_init_rc_installed)))
440 endif
441 ifdef LOCAL_PICKUP_FILES
442 # Files or directories ready to pick up by the build system
443 # when $(LOCAL_BUILT_MODULE) is done.
444 ALL_MODULES.$(my_register_name).PICKUP_FILES := \
445     $(ALL_MODULES.$(my_register_name).PICKUP_FILES) $(LOCAL_PICKUP_FILES)
446 endif
447 my_required_modules := $(LOCAL_REQUIRED_MODULES) \
448     $(LOCAL_REQUIRED_MODULES_$(TARGET_$(LOCAL_2ND_ARCH_VAR_PREFIX)ARCH))
449 ifdef LOCAL_IS_HOST_MODULE
450 my_required_modules += $(LOCAL_REQUIRED_MODULES_$($(my_prefix)OS))
451 endif
452 ALL_MODULES.$(my_register_name).REQUIRED := \
453     $(strip $(ALL_MODULES.$(my_register_name).REQUIRED) $(my_required_modules))
454 ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS := \
455     $(ALL_MODULES.$(my_register_name).EVENT_LOG_TAGS) $(event_log_tags)
456 ALL_MODULES.$(my_register_name).MAKEFILE := \
457     $(ALL_MODULES.$(my_register_name).MAKEFILE) $(LOCAL_MODULE_MAKEFILE)
458 ifdef LOCAL_MODULE_OWNER
459 ALL_MODULES.$(my_register_name).OWNER := \
460     $(sort $(ALL_MODULES.$(my_register_name).OWNER) $(LOCAL_MODULE_OWNER))
461 endif
462 ifdef LOCAL_2ND_ARCH_VAR_PREFIX
463 ALL_MODULES.$(my_register_name).FOR_2ND_ARCH := true
464 endif
465 ALL_MODULES.$(my_register_name).FOR_HOST_CROSS := $(my_host_cross)
466
467 INSTALLABLE_FILES.$(LOCAL_INSTALLED_MODULE).MODULE := $(my_register_name)
468
469 ##########################################################
470 # Track module-level dependencies.
471 # Use $(LOCAL_MODULE) instead of $(my_register_name) to ignore module's bitness.
472 ALL_DEPS.MODULES := $(sort $(ALL_DEPS.MODULES) $(LOCAL_MODULE))
473 ALL_DEPS.$(LOCAL_MODULE).ALL_DEPS := $(sort \
474   $(ALL_MODULES.$(LOCAL_MODULE).ALL_DEPS) \
475   $(LOCAL_STATIC_LIBRARIES) \
476   $(LOCAL_WHOLE_STATIC_LIBRARIES) \
477   $(LOCAL_SHARED_LIBRARIES) \
478   $(LOCAL_STATIC_JAVA_LIBRARIES) \
479   $(LOCAL_JAVA_LIBRARIES)\
480   $(LOCAL_JNI_SHARED_LIBRARIES))
481
482 ALL_DEPS.$(LOCAL_MODULE).LICENSE := $(sort $(ALL_DEPS.$(LOCAL_MODULE).LICENSE) $(license_files))
483
484 ###########################################################
485 ## Take care of my_module_tags
486 ###########################################################
487
488 # Keep track of all the tags we've seen.
489 ALL_MODULE_TAGS := $(sort $(ALL_MODULE_TAGS) $(my_module_tags))
490
491 # Add this module name to the tag list of each specified tag.
492 $(foreach tag,$(my_module_tags),\
493     $(eval ALL_MODULE_NAME_TAGS.$(tag) += $(my_register_name)))
494
495 ###########################################################
496 ## umbrella targets used to verify builds
497 ###########################################################
498 j_or_n :=
499 ifneq (,$(filter EXECUTABLES SHARED_LIBRARIES STATIC_LIBRARIES,$(LOCAL_MODULE_CLASS)))
500 j_or_n := native
501 else
502 ifneq (,$(filter JAVA_LIBRARIES APPS,$(LOCAL_MODULE_CLASS)))
503 j_or_n := java
504 endif
505 endif
506 ifdef LOCAL_IS_HOST_MODULE
507 h_or_t := host
508 else
509 h_or_t := target
510 endif
511
512 ifdef j_or_n
513 $(j_or_n) $(h_or_t) $(j_or_n)-$(h_or_t) : $(my_checked_module)
514 ifneq (,$(filter $(my_module_tags),tests))
515 $(j_or_n)-$(h_or_t)-tests $(j_or_n)-tests $(h_or_t)-tests : $(my_checked_module)
516 endif
517 endif
518
519 ###########################################################
520 ## NOTICE files
521 ###########################################################
522
523 include $(BUILD_NOTICE_FILE)