The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 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 | |
| 10 | ifeq ($(strip $(LOCAL_MODULE_CLASS)),) |
| 11 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 12 | endif |
| 13 | ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),) |
| 14 | LOCAL_MODULE_SUFFIX := $(TARGET_SHLIB_SUFFIX) |
| 15 | endif |
| 16 | ifeq ($(strip $(LOCAL_PRELINK_MODULE)),) |
| 17 | LOCAL_PRELINK_MODULE := $(strip $(TARGET_PRELINK_MODULE)) |
| 18 | endif |
| 19 | ifneq ($(strip $(OVERRIDE_BUILT_MODULE_PATH)),) |
| 20 | $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH) |
| 21 | endif |
| 22 | |
| 23 | # Put the built targets of all shared libraries in a common directory |
| 24 | # to simplify the link line. |
| 25 | OVERRIDE_BUILT_MODULE_PATH := $(TARGET_OUT_INTERMEDIATE_LIBRARIES) |
| 26 | |
| 27 | include $(BUILD_SYSTEM)/dynamic_binary.mk |
| 28 | |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 29 | # Define PRIVATE_ variables from global vars |
| 30 | my_target_global_ld_dirs := $(TARGET_GLOBAL_LD_DIRS) |
| 31 | my_target_global_ldflags := $(TARGET_GLOBAL_LDFLAGS) |
| 32 | my_target_fdo_lib := $(TARGET_FDO_LIB) |
| 33 | my_target_libgcc := $(TARGET_LIBGCC) |
| 34 | my_target_crtbegin_so_o := $(TARGET_CRTBEGIN_SO_O) |
| 35 | my_target_crtend_so_o := $(TARGET_CRTEND_SO_O) |
| 36 | ifdef LOCAL_NDK_VERSION |
| 37 | my_target_global_ld_dirs += -L$(my_ndk_version_root)/usr/lib |
| 38 | # The latest ndk does NOT support TARGET_CRTBEGIN_SO_O and TARGET_CRTEND_SO_O yet. |
| 39 | # my_target_crtbegin_so_o := $(my_ndk_version_root)/usr/lib/crtbegin_so.o |
| 40 | # my_target_crtend_so_o := $(my_ndk_version_root)/usr/lib/crtend_so.o |
| 41 | my_target_crtbegin_so_o := |
| 42 | my_target_crtend_so_o := |
| 43 | endif |
| 44 | $(linked_module): PRIVATE_TARGET_GLOBAL_LD_DIRS := $(my_target_global_ld_dirs) |
| 45 | $(linked_module): PRIVATE_TARGET_GLOBAL_LDFLAGS := $(my_target_global_ldflags) |
| 46 | $(linked_module): PRIVATE_TARGET_FDO_LIB := $(my_target_fdo_lib) |
| 47 | $(linked_module): PRIVATE_TARGET_LIBGCC := $(my_target_libgcc) |
| 48 | $(linked_module): PRIVATE_TARGET_CRTBEGIN_SO_O := $(my_target_crtbegin_so_o) |
| 49 | $(linked_module): PRIVATE_TARGET_CRTEND_SO_O := $(my_target_crtend_so_o) |
| 50 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 51 | $(linked_module): $(all_objects) $(all_libraries) \ |
| 52 | $(LOCAL_ADDITIONAL_DEPENDENCIES) \ |
Ying Wang | 1a08100 | 2010-07-13 14:55:47 -0700 | [diff] [blame] | 53 | $(my_target_crtbegin_so_o) $(my_target_crtend_so_o) |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 54 | $(transform-o-to-shared-lib) |