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

Commit bdf7dc0e authored by Tom Marshall's avatar Tom Marshall
Browse files

build: qcom: Set QCOM_*_PATH variables for hardware/qcom-* projects

This consolidates a bunch of one-off logic scattered throughout the
code base.  Usage in Android.mk files is trivial:

At top level, use e.g. "ifeq ($(call my-dir),$(QCOM_AUDIO_PATH))".
This works for all variants, including non-variants (i.e. AOSP).

Within subdirs, use e.g. hardware/qcom/audio => $(QCOM_AUDIO_PATH)

Change-Id: Iee2497ea9a7efeb4ae9e861b84c532b19da7b69d
parent f363df8d
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -18,4 +18,23 @@ ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
            TARGET_GLOBAL_CPPFLAGS += -DQCOM_DIRECTTRACK
        endif
    endif

    # This is the list of all supported QCOM variants.
    qcom_variant_list := audio camera display gps media sensors

    # Set the QCOM_*_PATH variables for each variant.
    #   $1 = Upper case name for variable name
    #   $2 = Lower case name for variable value (pathname)
    define qcom_variant_path
    $(strip \
        $(if $(TARGET_QCOM_$(1)_VARIANT), \
            hardware/qcom/$(2)-$(TARGET_QCOM_$(1)_VARIANT), \
            hardware/qcom/$(2)))
    endef
    $(foreach variant, \
        $(qcom_variant_list), \
        $(eval ln:=$(shell echo $(variant) | tr [A-Z] [a-z])) \
        $(eval un:=$(shell echo $(variant) | tr [a-z] [A-Z])) \
        $(eval QCOM_$(un)_PATH:=$(call qcom_variant_path,$(un),$(ln))))

endif