summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/pathmap.mk30
-rw-r--r--core/qcom_target.mk11
2 files changed, 41 insertions, 0 deletions
diff --git a/core/pathmap.mk b/core/pathmap.mk
index b300ff5..699eac1 100644
--- a/core/pathmap.mk
+++ b/core/pathmap.mk
@@ -63,6 +63,36 @@ define include-path-for
$(foreach n,$(1),$(patsubst $(n):%,%,$(filter $(n):%,$(pathmap_INCL))))
endef
+# Enter project path into pathmap
+#
+# $(1): name
+# $(2): path
+#
+define project-set-path
+$(eval pathmap_PROJ += $(1):$(2))
+endef
+
+# Enter variant project path into pathmap
+#
+# $(1): name
+# $(2): variable to check
+# $(3): base path
+#
+define project-set-path-variant
+ $(call project-set-path,$(1),$(strip \
+ $(if $($(2)), \
+ $(3)-$($(2)), \
+ $(3))))
+endef
+
+# Returns the path to the requested module's include directory,
+# relative to the root of the source tree.
+#
+# $(1): a list of modules (or other named entities) to find the projects for
+define project-path-for
+$(foreach n,$(1),$(patsubst $(n):%,%,$(filter $(n):%,$(pathmap_PROJ))))
+endef
+
#
# Many modules expect to be able to say "#include <jni.h>",
# so make it easy for them to find the correct path.
diff --git a/core/qcom_target.mk b/core/qcom_target.mk
index e65a6fc..ea91257 100644
--- a/core/qcom_target.mk
+++ b/core/qcom_target.mk
@@ -19,3 +19,14 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
endif
endif
endif
+
+# Populate the qcom hardware variants in the project pathmap.
+define qcom-set-path-variant
+$(call project-set-path-variant,qcom-$(2),TARGET_QCOM_$(1)_VARIANT,hardware/qcom/$(2))
+endef
+$(call qcom-set-path-variant,AUDIO,audio)
+$(call qcom-set-path-variant,CAMERA,camera)
+$(call qcom-set-path-variant,DISPLAY,display)
+$(call qcom-set-path-variant,GPS,gps)
+$(call qcom-set-path-variant,MEDIA,media)
+$(call qcom-set-path-variant,SENSORS,sensors)