Support to switch between prebuilt and buiding from source

For target shared library and executable.

Change-Id: I40a4e4e0c971811ac60e9bd04206f2422387d3d0
This commit is contained in:
Ying Wang 2013-01-15 15:28:08 -08:00
parent b6fd569c0c
commit 4c49372c53
2 changed files with 26 additions and 0 deletions

View File

@ -12,6 +12,17 @@ ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
LOCAL_MODULE_SUFFIX := $(TARGET_EXECUTABLE_SUFFIX) LOCAL_MODULE_SUFFIX := $(TARGET_EXECUTABLE_SUFFIX)
endif endif
$(call target-executable-hook)
skip_build_from_source :=
ifdef LOCAL_PREBUILT_MODULE_FILE
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
include $(BUILD_PREBUILT)
skip_build_from_source := true
endif
endif
ifndef skip_build_from_source
#################################################### ####################################################
## Add profiling libraries if aprof is turned ## Add profiling libraries if aprof is turned
#################################################### ####################################################
@ -61,3 +72,5 @@ else
$(linked_module): $(my_target_crtbegin_dynamic_o) $(all_objects) $(all_libraries) $(my_target_crtend_o) $(linked_module): $(my_target_crtbegin_dynamic_o) $(all_objects) $(all_libraries) $(my_target_crtend_o)
$(transform-o-to-executable) $(transform-o-to-executable)
endif endif
endif # skip_build_from_source

View File

@ -20,6 +20,17 @@ ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
$(error $(LOCAL_PATH): Cannot set module stem for a library) $(error $(LOCAL_PATH): Cannot set module stem for a library)
endif endif
$(call target-shared-library-hook)
skip_build_from_source :=
ifdef LOCAL_PREBUILT_MODULE_FILE
ifeq (,$(call if-build-from-source,$(LOCAL_MODULE),$(LOCAL_PATH)))
include $(BUILD_PREBUILT)
skip_build_from_source := true
endif
endif
ifndef skip_build_from_source
#################################################### ####################################################
## Add profiling libraries if aprof is turned ## Add profiling libraries if aprof is turned
#################################################### ####################################################
@ -68,3 +79,5 @@ $(linked_module): $(all_objects) $(all_libraries) \
$(LOCAL_ADDITIONAL_DEPENDENCIES) \ $(LOCAL_ADDITIONAL_DEPENDENCIES) \
$(my_target_crtbegin_so_o) $(my_target_crtend_so_o) $(my_target_crtbegin_so_o) $(my_target_crtend_so_o)
$(transform-o-to-shared-lib) $(transform-o-to-shared-lib)
endif # skip_build_from_source