From 7a8380a81df1fe256eb284b3d535f1b50284fb62 Mon Sep 17 00:00:00 2001 From: David Brown Date: Thu, 25 May 2017 10:17:33 -0600 Subject: [PATCH] dts: Allow override of dts overlay directory Instead of requiring the dts overlay files to be at the top level directory (where make is invoked), allow this default to be overridden by setting DTS_OVERLAY_DIR. This is a directory where the overlays themselves (which are still named $(BOARD_NAME).overlay) will live. Change-Id: Ie9796afbd27971650b7636a36149c0d1f8e2b9fb Signed-off-by: David Brown --- scripts/Makefile.lib | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 2becb903ee4..7b25349c53c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -264,6 +264,9 @@ cmd_gzip = (cat $(filter-out FORCE,$^) | gzip -n -f -9 > $@) || \ # DTC # --------------------------------------------------------------------------- +DTC_OVERLAY_DIR ?= $(PROJECT_BASE) +DTC_OVERLAY_FILE = $(abspath $(DTC_OVERLAY_DIR)/$(BOARD_NAME).overlay) + # Generate an assembly file to wrap the output of the device tree compiler quiet_cmd_dt_S_dtb= DTB $@ cmd_dt_S_dtb= \ @@ -282,12 +285,10 @@ cmd_dt_S_dtb= \ $(obj)/%.dtb.S: $(obj)/%.dtb $(call cmd,dt_S_dtb) -DTS_OVERLAY ?= $(PROJECT_BASE)/$(BOARD_NAME).overlay - quiet_cmd_dtc = DTC $@ cmd_dtc = echo '\#include "$(notdir $<)"' > dts/$(ARCH)/$(notdir $<)_pre_compiled ; \ - if test -e $(DTS_OVERLAY); then \ - echo '\#include "$(BOARD_NAME).overlay"' >> dts/$(ARCH)/$(notdir $<)_pre_compiled ; \ + if test -e $(DTC_OVERLAY_FILE); then \ + echo '\#include "$(DTC_OVERLAY_FILE)"' >> dts/$(ARCH)/$(notdir $<)_pre_compiled ; \ fi ; \ $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) dts/$(ARCH)/$(notdir $<)_pre_compiled ; \ $(DTC) -O dts -o $@ -b 0 \ @@ -298,7 +299,7 @@ cmd_dtc = echo '\#include "$(notdir $<)"' > dts/$(ARCH)/$(notdir $<)_pre_compile $(obj)/%.dtb: $(src)/%.dts FORCE $(call if_changed_dep,dtc) -$(obj)/%.dts_compiled: $(src)/%.dts $(DTS_OVERLAY) FORCE +$(obj)/%.dts_compiled: $(src)/%.dts $(wildcard $(DTC_OVERLAY_FILE)) FORCE $(call if_changed_dep,dtc) dtc-tmp = $(subst $(comma),_,$(dot-target).dts.tmp)