• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1###########################################################
2## Standard rules for building a static library.
3##
4## Additional inputs from base_rules.make:
5## None.
6##
7## LOCAL_MODULE_SUFFIX will be set for you.
8###########################################################
9
10ifeq ($(strip $(LOCAL_MODULE_CLASS)),)
11LOCAL_MODULE_CLASS := STATIC_LIBRARIES
12endif
13ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
14LOCAL_MODULE_SUFFIX := .a
15endif
16LOCAL_UNINSTALLABLE_MODULE := true
17ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
18$(error $(LOCAL_PATH): Cannot set module stem for a library)
19endif
20
21include $(BUILD_SYSTEM)/binary.mk
22
23$(LOCAL_BUILT_MODULE) : $(built_whole_libraries)
24$(LOCAL_BUILT_MODULE) : $(all_objects)
25	$(transform-o-to-static-lib)
26
27ifeq ($(NATIVE_COVERAGE),true)
28gcno_suffix := .gcnodir
29
30built_whole_gcno_libraries := \
31    $(foreach lib,$(my_whole_static_libraries), \
32      $(call intermediates-dir-for, \
33        STATIC_LIBRARIES,$(lib),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX), \
34        $(my_host_cross))/$(lib)$(gcno_suffix))
35
36GCNO_ARCHIVE := $(LOCAL_MODULE)$(gcno_suffix)
37
38$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS := $(strip $(LOCAL_GCNO_FILES))
39$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(strip $(built_whole_gcno_libraries))
40$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_PREFIX := $(my_prefix)
41$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_2ND_ARCH_VAR_PREFIX := $(LOCAL_2ND_ARCH_VAR_PREFIX)
42$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_INTERMEDIATES_DIR := $(intermediates)
43$(intermediates)/$(GCNO_ARCHIVE) : $(LOCAL_GCNO_FILES) $(built_whole_gcno_libraries)
44	$(transform-o-to-static-lib)
45endif
46