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 | LOCAL_IS_HOST_MODULE := true |
| 11 | |
| 12 | ifeq ($(strip $(LOCAL_MODULE_CLASS)),) |
| 13 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 14 | endif |
| 15 | ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),) |
| 16 | LOCAL_MODULE_SUFFIX := $(HOST_SHLIB_SUFFIX) |
| 17 | endif |
| 18 | ifneq ($(strip $(OVERRIDE_BUILT_MODULE_PATH)),) |
| 19 | $(error $(LOCAL_PATH): Illegal use of OVERRIDE_BUILT_MODULE_PATH) |
| 20 | endif |
Ying Wang | 5f07480 | 2011-11-08 09:31:21 -0800 | [diff] [blame] | 21 | ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),) |
Ian Rogers | 76a6dc3 | 2012-10-01 16:36:23 -0700 | [diff] [blame] | 22 | $(error $(LOCAL_PATH): Cannot set module stem for a library) |
Ying Wang | 5f07480 | 2011-11-08 09:31:21 -0800 | [diff] [blame] | 23 | endif |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 24 | |
Ying Wang | 63d94fa | 2012-12-13 18:23:01 -0800 | [diff] [blame] | 25 | $(call host-shared-library-hook) |
| 26 | |
| 27 | skip_build_from_source := |
| 28 | ifdef LOCAL_PREBUILT_MODULE_FILE |
| 29 | ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH))) |
| 30 | include $(BUILD_PREBUILT) |
| 31 | skip_build_from_source := true |
| 32 | endif |
| 33 | endif |
| 34 | |
| 35 | ifndef skip_build_from_source |
| 36 | |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 37 | # Put the built modules of all shared libraries in a common directory |
| 38 | # to simplify the link line. |
| 39 | OVERRIDE_BUILT_MODULE_PATH := $(HOST_OUT_INTERMEDIATE_LIBRARIES) |
| 40 | |
| 41 | include $(BUILD_SYSTEM)/binary.mk |
| 42 | |
| 43 | $(LOCAL_BUILT_MODULE): $(all_objects) $(all_libraries) $(LOCAL_ADDITIONAL_DEPENDENCIES) |
| 44 | $(transform-host-o-to-shared-lib) |
Ying Wang | 63d94fa | 2012-12-13 18:23:01 -0800 | [diff] [blame] | 45 | |
| 46 | endif # skip_build_from_source |
Ying Wang | bf4a8d3 | 2014-02-20 13:54:43 -0800 | [diff] [blame^] | 47 | |
| 48 | ########################################################### |
| 49 | ## Copy headers to the install tree |
| 50 | ########################################################### |
| 51 | include $(BUILD_COPY_HEADERS) |