Complete support for project pathmap
* Use project pathmap when available for LOCAL_C_INCLUDES
Change-Id: Iddc7cc8509d966307c4a490c9d6c15d761dbb3b4
diff --git a/applypatch/Android.mk b/applypatch/Android.mk
index 581e53a..2f96f0a 100644
--- a/applypatch/Android.mk
+++ b/applypatch/Android.mk
@@ -14,6 +14,12 @@
LOCAL_PATH := $(call my-dir)
+ifdef project-path-for
+ RECOVERY_PATH := $(call project-path-for,recovery)
+else
+ RECOVERY_PATH := bootable/recovery
+endif
+
include $(CLEAR_VARS)
BOARD_RECOVERY_DEFINES := BOARD_BML_BOOT BOARD_BML_RECOVERY
@@ -33,7 +39,7 @@
LOCAL_SRC_FILES := applypatch.cpp bspatch.cpp freecache.cpp imgpatch.cpp utils.cpp
LOCAL_MODULE := libapplypatch
LOCAL_MODULE_TAGS := eng
-LOCAL_C_INCLUDES += bootable/recovery
+LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_STATIC_LIBRARIES += libbase libotafault libmtdutils libcrypto_static libbz libz
include $(BUILD_STATIC_LIBRARY)
@@ -46,7 +52,7 @@
LOCAL_CLANG := true
LOCAL_SRC_FILES := bspatch.cpp imgpatch.cpp utils.cpp
LOCAL_MODULE := libimgpatch
-LOCAL_C_INCLUDES += bootable/recovery
+LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_STATIC_LIBRARIES += libcrypto_static libbz libz
@@ -58,7 +64,7 @@
LOCAL_CLANG := true
LOCAL_SRC_FILES := main.cpp
LOCAL_MODULE := applypatch
-LOCAL_C_INCLUDES += bootable/recovery
+LOCAL_C_INCLUDES += $(RECOVERY_PATH)
LOCAL_STATIC_LIBRARIES += libapplypatch libbase libotafault libmtdutils libcrypto_static libbz \
libedify \
diff --git a/otafault/Android.mk b/otafault/Android.mk
index ba7add8..e8241f4 100644
--- a/otafault/Android.mk
+++ b/otafault/Android.mk
@@ -14,6 +14,12 @@
LOCAL_PATH := $(call my-dir)
+ifdef project-path-for
+ RECOVERY_PATH := $(call project-path-for,recovery)
+else
+ RECOVERY_PATH := bootable/recovery
+endif
+
include $(CLEAR_VARS)
otafault_static_libs := \
@@ -26,7 +32,7 @@
LOCAL_MODULE_TAGS := eng
LOCAL_MODULE := libotafault
LOCAL_CLANG := true
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_C_INCLUDES := $(RECOVERY_PATH)
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_WHOLE_STATIC_LIBRARIES := $(otafault_static_libs)
@@ -38,7 +44,7 @@
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE := otafault_test
LOCAL_STATIC_LIBRARIES := $(otafault_static_libs)
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_C_INCLUDES := $(RECOVERY_PATH)
LOCAL_FORCE_STATIC_EXECUTABLE := true
include $(BUILD_EXECUTABLE)
diff --git a/tests/Android.mk b/tests/Android.mk
index a66991b..4fc92fa 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -16,6 +16,12 @@
LOCAL_PATH := $(call my-dir)
+ifdef project-path-for
+ RECOVERY_PATH := $(call project-path-for,recovery)
+else
+ RECOVERY_PATH := bootable/recovery
+endif
+
# Unit tests
include $(CLEAR_VARS)
LOCAL_CLANG := true
@@ -28,7 +34,7 @@
LOCAL_SRC_FILES := unit/asn1_decoder_test.cpp
LOCAL_SRC_FILES += unit/recovery_test.cpp
LOCAL_SRC_FILES += unit/locale_test.cpp
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_C_INCLUDES := $(RECOVERY_PATH)
LOCAL_SHARED_LIBRARIES := liblog
include $(BUILD_NATIVE_TEST)
@@ -38,7 +44,7 @@
LOCAL_CFLAGS += -Wno-unused-parameter
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_MODULE := recovery_component_test
-LOCAL_C_INCLUDES := bootable/recovery
+LOCAL_C_INCLUDES := $(RECOVERY_PATH)
LOCAL_SRC_FILES := \
component/verifier_test.cpp \
component/applypatch_test.cpp