scripts: Makefile: add support to compile DT overlay blobs

Add support to compile device tree overlay blob.
'dtbo-y' target can be used to specify DT overlay blob.
'<target>-obj'  must be specified to list base and overlay blobs.

CRs-Fixed: 2026435
Change-Id: Ib5036c70ba46374619cc43f9f7b697e1a444aebf
Signed-off-by: Shashank Mittal <mittals@codeaurora.org>
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
diff --git a/scripts/Makefile.dtbo b/scripts/Makefile.dtbo
new file mode 100644
index 0000000..db4a0f4
--- /dev/null
+++ b/scripts/Makefile.dtbo
@@ -0,0 +1,24 @@
+__dtbo := $(sort $(dtbo-y))
+
+dtbo-base	:= $(sort $(foreach m,$(__dtbo),$($(m)-base)))
+dtbo := $(foreach m,$(__dtbo),$(if $($(m)-base),$(m)))
+
+__dtbo     := $(addprefix $(obj)/,$(__dtbo))
+dtbo-base	:= $(addprefix $(obj)/,$(dtbo-base))
+dtbo	:= $(addprefix $(obj)/,$(dtbo))
+
+ifneq ($(DTC_OVERLAY_TEST_EXT),)
+DTC_OVERLAY_TEST = $(DTC_OVERLAY_TEST_EXT)
+quiet_cmd_dtbo_verify	= VERIFY  $@
+cmd_dtbo_verify = $(DTC_OVERLAY_TEST) $(addprefix $(obj)/,$($(@F)-base)) $@ $(dot-target).dtb
+else
+cmd_dtbo_verify = true
+endif
+
+$(obj)/%.dtbo: $(src)/%.dts FORCE
+	$(call if_changed_dep,dtc)
+	$(call if_changed,dtbo_verify)
+
+$(call multi_depend, $(dtbo), , -base)
+
+always +=  $(dtbo)