summaryrefslogtreecommitdiffstats
path: root/core/qcom_target.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/qcom_target.mk')
-rw-r--r--core/qcom_target.mk128
1 files changed, 128 insertions, 0 deletions
diff --git a/core/qcom_target.mk b/core/qcom_target.mk
new file mode 100644
index 0000000..3c8e68b
--- /dev/null
+++ b/core/qcom_target.mk
@@ -0,0 +1,128 @@
+# Target-specific configuration
+
+# Populate the qcom hardware variants in the project pathmap.
+define ril-set-path-variant
+$(call project-set-path-variant,ril,TARGET_RIL_VARIANT,hardware/$(1))
+endef
+define wlan-set-path-variant
+$(call project-set-path-variant,wlan,TARGET_WLAN_VARIANT,hardware/qcom/$(1))
+endef
+define bt-vendor-set-path-variant
+$(call project-set-path-variant,bt-vendor,TARGET_BT_VENDOR_VARIANT,hardware/qcom/$(1))
+endef
+
+# Set device-specific HALs into project pathmap
+define set-device-specific-path
+$(if $(USE_DEVICE_SPECIFIC_$(1)), \
+ $(if $(DEVICE_SPECIFIC_$(1)_PATH), \
+ $(eval path := $(DEVICE_SPECIFIC_$(1)_PATH)), \
+ $(eval path := $(TARGET_DEVICE_DIR)/$(2))), \
+ $(eval path := $(3))) \
+$(call project-set-path,qcom-$(2),$(strip $(path)))
+endef
+
+ifeq ($(BOARD_USES_QCOM_HARDWARE),true)
+
+ qcom_flags := -DQCOM_HARDWARE
+ qcom_flags += -DQCOM_BSP
+ qcom_flags += -DQTI_BSP
+
+ TARGET_USES_QCOM_BSP := true
+
+ # Tell HALs that we're compiling an AOSP build with an in-line kernel
+ TARGET_COMPILE_WITH_MSM_KERNEL := true
+
+ ifneq ($(filter msm7x30 msm8660 msm8960,$(TARGET_BOARD_PLATFORM)),)
+ # Enable legacy graphics functions
+ qcom_flags += -DQCOM_BSP_LEGACY
+ # Enable legacy audio functions
+ ifeq ($(BOARD_USES_LEGACY_ALSA_AUDIO),true)
+ USE_CUSTOM_AUDIO_POLICY := 1
+ qcom_flags += -DLEGACY_ALSA_AUDIO
+ endif
+ endif
+
+ TARGET_GLOBAL_CFLAGS += $(qcom_flags)
+ TARGET_GLOBAL_CPPFLAGS += $(qcom_flags)
+ CLANG_TARGET_GLOBAL_CFLAGS += $(qcom_flags)
+ CLANG_TARGET_GLOBAL_CPPFLAGS += $(qcom_flags)
+
+ # Multiarch needs these too..
+ 2ND_TARGET_GLOBAL_CFLAGS += $(qcom_flags)
+ 2ND_TARGET_GLOBAL_CPPFLAGS += $(qcom_flags)
+ 2ND_CLANG_TARGET_GLOBAL_CFLAGS += $(qcom_flags)
+ 2ND_CLANG_TARGET_GLOBAL_CPPFLAGS += $(qcom_flags)
+
+ ifeq ($(QCOM_HARDWARE_VARIANT),)
+ ifneq ($(filter msm8610 msm8226 msm8974,$(TARGET_BOARD_PLATFORM)),)
+ QCOM_HARDWARE_VARIANT := msm8974
+ else
+ ifneq ($(filter msm8909 msm8916,$(TARGET_BOARD_PLATFORM)),)
+ QCOM_HARDWARE_VARIANT := msm8916
+ else
+ ifneq ($(filter msm8953 msm8937,$(TARGET_BOARD_PLATFORM)),)
+ QCOM_HARDWARE_VARIANT := msm8937
+ else
+ ifneq ($(filter msm8992 msm8994,$(TARGET_BOARD_PLATFORM)),)
+ QCOM_HARDWARE_VARIANT := msm8994
+ else
+ QCOM_HARDWARE_VARIANT := $(TARGET_BOARD_PLATFORM)
+ endif
+ endif
+ endif
+ endif
+ endif
+
+# HACK: check to see if build uses standard QC HAL paths by checking for CM path structure
+AOSP_VARIANT_MAKEFILE := $(wildcard hardware/qcom/audio/default/Android.mk)
+ifeq ("$(AOSP_VARIANT_MAKEFILE)","")
+$(call project-set-path,qcom-audio,hardware/qcom/audio)
+$(call project-set-path,qcom-display,hardware/qcom/display)
+$(call project-set-path,qcom-media,hardware/qcom/media)
+$(call set-device-specific-path,CAMERA,camera,hardware/qcom/camera)
+$(call set-device-specific-path,GPS,gps,hardware/qcom/gps)
+$(call set-device-specific-path,SENSORS,sensors,hardware/qcom/sensors)
+$(call set-device-specific-path,LOC_API,loc-api,vendor/qcom/opensource/location)
+$(call set-device-specific-path,DATASERVICES,dataservices,vendor/qcom/opensource/dataservices)
+$(call project-set-path,ril,hardware/ril)
+$(call project-set-path,wlan,hardware/qcom/wlan)
+$(call project-set-path,bt-vendor,hardware/qcom/bt)
+else
+$(call project-set-path,qcom-audio,hardware/qcom/audio-caf/$(QCOM_HARDWARE_VARIANT))
+
+ifeq ($(SONY_BF64_KERNEL_VARIANT),true)
+$(call project-set-path,qcom-display,hardware/qcom/display-caf/sony)
+$(call project-set-path,qcom-media,hardware/qcom/media-caf/sony)
+else
+$(call project-set-path,qcom-display,hardware/qcom/display-caf/$(QCOM_HARDWARE_VARIANT))
+$(call project-set-path,qcom-media,hardware/qcom/media-caf/$(QCOM_HARDWARE_VARIANT))
+endif
+
+$(call set-device-specific-path,CAMERA,camera,hardware/qcom/camera)
+$(call set-device-specific-path,GPS,gps,hardware/qcom/gps)
+$(call set-device-specific-path,SENSORS,sensors,hardware/qcom/sensors)
+$(call set-device-specific-path,LOC_API,loc-api,vendor/qcom/opensource/location)
+$(call set-device-specific-path,DATASERVICES,dataservices,vendor/qcom/opensource/dataservices)
+
+$(call ril-set-path-variant,ril)
+$(call wlan-set-path-variant,wlan-caf)
+$(call bt-vendor-set-path-variant,bt-caf)
+endif # AOSP_VARIANT_MAKEFILE
+
+else
+
+$(call project-set-path,qcom-audio,hardware/qcom/audio/default)
+$(call project-set-path,qcom-display,hardware/qcom/display/$(TARGET_BOARD_PLATFORM))
+$(call project-set-path,qcom-media,hardware/qcom/media/default)
+
+$(call project-set-path,qcom-camera,hardware/qcom/camera)
+$(call project-set-path,qcom-gps,hardware/qcom/gps)
+$(call project-set-path,qcom-sensors,hardware/qcom/sensors)
+$(call project-set-path,qcom-loc-api,vendor/qcom/opensource/location)
+$(call project-set-path,qcom-dataservices,$(TARGET_DEVICE_DIR)/dataservices)
+
+$(call ril-set-path-variant,ril)
+$(call wlan-set-path-variant,wlan)
+$(call bt-vendor-set-path-variant,bt)
+
+endif