Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c49372c authored by Ying Wang's avatar Ying Wang
Browse files

Support to switch between prebuilt and buiding from source

For target shared library and executable.

Change-Id: I40a4e4e0c971811ac60e9bd04206f2422387d3d0
parent b6fd569c
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -12,6 +12,17 @@ ifeq ($(strip $(LOCAL_MODULE_SUFFIX)),)
LOCAL_MODULE_SUFFIX := $(TARGET_EXECUTABLE_SUFFIX)
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
####################################################
@@ -61,3 +72,5 @@ else
$(linked_module): $(my_target_crtbegin_dynamic_o) $(all_objects) $(all_libraries) $(my_target_crtend_o)
	$(transform-o-to-executable)
endif

endif  # skip_build_from_source
+13 −0
Original line number Diff line number Diff line
@@ -20,6 +20,17 @@ ifneq ($(strip $(LOCAL_MODULE_STEM)$(LOCAL_BUILT_MODULE_STEM)),)
$(error $(LOCAL_PATH): Cannot set module stem for a library)
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
####################################################
@@ -68,3 +79,5 @@ $(linked_module): $(all_objects) $(all_libraries) \
                  $(LOCAL_ADDITIONAL_DEPENDENCIES) \
                  $(my_target_crtbegin_so_o) $(my_target_crtend_so_o)
	$(transform-o-to-shared-lib)

endif  # skip_build_from_source