From fd881362c4830a48904d086e286306fe496fd87f Mon Sep 17 00:00:00 2001 From: Puja Gupta Date: Fri, 10 Feb 2017 15:15:23 -0800 Subject: [PATCH] scripts: Makefile: add support to use external DTC Add support to use external DTC to compile device tree blobs. Change-Id: I268d2332d5328c3b0050b35c96f91e8ef9e1f6f8 Signed-off-by: Shashank Mittal Signed-off-by: Puja Gupta --- scripts/Makefile.lib | 6 ++++++ scripts/dtc/Makefile | 2 ++ 2 files changed, 8 insertions(+) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 22667fe49a22..9bc4dc290dab 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -292,6 +292,12 @@ cmd_dt_S_dtb= \ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE $(call if_changed,dt_S_dtb) +ifneq ($(DTC_EXT),) +DTC = $(DTC_EXT) +else +DTC = $(objtree)/scripts/dtc/dtc +endif + quiet_cmd_dtc = DTC $@ cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \ $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \ diff --git a/scripts/dtc/Makefile b/scripts/dtc/Makefile index 1c943e03eaf2..28631ed596ab 100644 --- a/scripts/dtc/Makefile +++ b/scripts/dtc/Makefile @@ -2,7 +2,9 @@ # scripts/dtc makefile hostprogs-y := dtc +ifeq ($(DTC_EXT),) always := $(hostprogs-y) +endif dtc-objs := dtc.o flattree.o fstree.o data.o livetree.o treesource.o \ srcpos.o checks.o util.o