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) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_AR)
25	$(transform-o-to-static-lib)
26
27ifeq ($(NATIVE_COVERAGE),true)
28gcno_suffix := .zip
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) : $(SOONG_ZIP) $(MERGE_ZIPS)
39$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_OBJECTS := $(strip $(LOCAL_GCNO_FILES))
40$(intermediates)/$(GCNO_ARCHIVE) : PRIVATE_ALL_WHOLE_STATIC_LIBRARIES := $(strip $(built_whole_gcno_libraries))
41$(intermediates)/$(GCNO_ARCHIVE) : $(LOCAL_GCNO_FILES) $(built_whole_gcno_libraries)
42	$(package-coverage-files)
43endif
44