• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1###########################################################
2## Standard rules for building a normal shared 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 := SHARED_LIBRARIES
12endif
13ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
14LOCAL_MODULE_SUFFIX := $($(my_prefix)SHLIB_SUFFIX)
15endif
16ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
17$(error $(LOCAL_PATH): Cannot set module stem for a library)
18endif
19
20ifdef host-shared-library-hook
21$(call host-shared-library-hook)
22endif
23
24skip_build_from_source :=
25ifdef LOCAL_PREBUILT_MODULE_FILE
26ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
27include $(BUILD_SYSTEM)/prebuilt_internal.mk
28skip_build_from_source := true
29endif
30endif
31
32ifndef skip_build_from_source
33
34include $(BUILD_SYSTEM)/binary.mk
35
36my_host_libprofile_rt := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)LIBPROFILE_RT)
37$(LOCAL_BUILT_MODULE): PRIVATE_HOST_LIBPROFILE_RT := $(my_host_libprofile_rt)
38
39ifdef USE_HOST_MUSL
40  my_crtbegin := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_OBJECT_libc_musl_crtbegin_so)
41  my_crtend := $(SOONG_$(LOCAL_2ND_ARCH_VAR_PREFIX)HOST_OBJECT_libc_musl_crtend_so)
42  my_libcrt_builtins := $($(LOCAL_2ND_ARCH_VAR_PREFIX)$(my_prefix)LIBCRT_BUILTINS)
43endif
44
45$(LOCAL_BUILT_MODULE): PRIVATE_CRTBEGIN := $(my_crtbegin)
46$(LOCAL_BUILT_MODULE): PRIVATE_CRTEND := $(my_crtend)
47$(LOCAL_BUILT_MODULE): PRIVATE_LIBCRT_BUILTINS := $(my_libcrt_builtins)
48$(LOCAL_BUILT_MODULE): $(my_crtbegin) $(my_crtend) $(my_libcrt_builtins)
49
50$(LOCAL_BUILT_MODULE): \
51        $(all_objects) \
52        $(all_libraries) \
53        $(LOCAL_ADDITIONAL_DEPENDENCIES)
54	$(transform-host-o-to-shared-lib)
55
56endif  # skip_build_from_source
57