diff --git a/Makefile b/Makefile index 6453e9512eac..2bac775f43ec 100644 --- a/Makefile +++ b/Makefile @@ -1424,7 +1424,9 @@ kselftest-merge: # Devicetree files ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/boot/dts/),) -dtstree := arch/$(SRCARCH)/boot/dts +# ANDROID: allow this to be overridden by the build environment. This allows +# one to compile a device tree that is located out-of-tree. +dtstree ?= arch/$(SRCARCH)/boot/dts endif ifneq ($(dtstree),) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index aa6ab6b0cb1f..0f24f347ead5 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -219,7 +219,9 @@ cpp_flags = -Wp,-MMD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ ld_flags = $(KBUILD_LDFLAGS) $(ldflags-y) $(LDFLAGS_$(@F)) -DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes +# ANDROID: Allow DTC_INCLUDE to be set by the BUILD_CONFIG. This allows one to +# compile an out-of-tree device tree. +DTC_INCLUDE += $(srctree)/scripts/dtc/include-prefixes dtc_cpp_flags = -Wp,-MMD,$(depfile).pre.tmp -nostdinc \ $(addprefix -I,$(DTC_INCLUDE)) \