summaryrefslogtreecommitdiffstats
path: root/core/prebuilt.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2011-11-08 09:31:21 -0800
committerYing Wang <wangying@google.com>2011-11-17 10:52:32 -0800
commit5f074803fbc14d091fb83208b81b3ffa10f54f90 (patch)
tree8c9985059abb5cbf84d2faeda8a261e4c42b704d /core/prebuilt.mk
parent1985846eb07757451a6e9f5d4c838e64397b5540 (diff)
downloadbuild-5f074803fbc14d091fb83208b81b3ffa10f54f90.zip
build-5f074803fbc14d091fb83208b81b3ffa10f54f90.tar.gz
build-5f074803fbc14d091fb83208b81b3ffa10f54f90.tar.bz2
Build system support to export include paths
Bug: 5573756 With this change, we can set LOCAL_EXPORT_C_INCLUDE_DIRS in the module definition to export include dir paths. Paths in LOCAL_EXPORT_C_INCLUDE_DIRS should be relative to the top dir of the source tree. If a library (shared or static) exports some include paths, any module using it will import the include paths and add them to the compiler command line. Change-Id: I49aabc589d2cf214044d13ccd5532ef68209adf0
Diffstat (limited to 'core/prebuilt.mk')
-rw-r--r--core/prebuilt.mk36
1 files changed, 21 insertions, 15 deletions
diff --git a/core/prebuilt.mk b/core/prebuilt.mk
index 54a7fa9..0c46341 100644
--- a/core/prebuilt.mk
+++ b/core/prebuilt.mk
@@ -27,6 +27,14 @@ ifeq (SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS))
OVERRIDE_BUILT_MODULE_PATH := $($(my_prefix)OUT_INTERMEDIATE_LIBRARIES)
endif
+# Deal with the OSX library timestamp issue when installing
+# a prebuilt simulator library.
+ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
+ prebuilt_module_is_a_library := true
+else
+ prebuilt_module_is_a_library :=
+endif
+
ifeq ($(LOCAL_STRIP_MODULE),true)
ifdef LOCAL_IS_HOST_MODULE
$(error Cannot strip host module LOCAL_PATH=$(LOCAL_PATH))
@@ -42,14 +50,13 @@ ifeq ($(LOCAL_STRIP_MODULE),true)
else
include $(BUILD_SYSTEM)/base_rules.mk
built_module := $(LOCAL_BUILT_MODULE)
-endif
-# Deal with the OSX library timestamp issue when installing
-# a prebuilt simulator library.
-ifneq ($(filter STATIC_LIBRARIES SHARED_LIBRARIES,$(LOCAL_MODULE_CLASS)),)
- prebuilt_module_is_a_library := true
-else
- prebuilt_module_is_a_library :=
+ifdef prebuilt_module_is_a_library
+# Create a dummy export_includes.
+$(intermediates)/export_includes:
+ $(hide) mkdir -p $(dir $@) && rm -f $@
+ $(hide) touch $@
+endif
endif
PACKAGES.$(LOCAL_MODULE).OVERRIDES := $(strip $(LOCAL_OVERRIDES_PACKAGES))
@@ -115,6 +122,13 @@ $(built_module) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES)
else
$(built_module) : $(LOCAL_PATH)/$(LOCAL_SRC_FILES) | $(ACP)
$(transform-prebuilt-to-target)
+ifneq ($(prebuilt_module_is_a_library),)
+ ifneq ($(LOCAL_IS_HOST_MODULE),)
+ $(transform-host-ranlib-copy-hack)
+ else
+ $(transform-ranlib-copy-hack)
+ endif
+endif
endif
endif
@@ -135,11 +149,3 @@ $(common_javalib_jar) : $(common_classes_jar) | $(ACP)
# make sure the classes.jar and javalib.jar are built before $(LOCAL_BUILT_MODULE)
$(built_module) : $(common_javalib_jar)
endif # TARGET JAVA_LIBRARIES
-
-ifneq ($(prebuilt_module_is_a_library),)
- ifneq ($(LOCAL_IS_HOST_MODULE),)
- $(transform-host-ranlib-copy-hack)
- else
- $(transform-ranlib-copy-hack)
- endif
-endif