kbuild: limit dtc+cpp include path
[firefly-linux-kernel-4.4.55.git] / scripts / Makefile.lib
index 7910229ec6657c93608d44f211ef0a01e2501d1a..07125e697d7a980efdb0f9136ee5741fe8cf0473 100644 (file)
@@ -156,6 +156,11 @@ cpp_flags      = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE)     \
 
 ld_flags       = $(LDFLAGS) $(ldflags-y)
 
+dtc_cpp_flags  = -Wp,-MD,$(depfile) -nostdinc                            \
+                -I$(srctree)/arch/$(SRCARCH)/boot/dts                   \
+                -I$(srctree)/arch/$(SRCARCH)/include/dts                \
+                -undef -D__DTS__
+
 # Finds the multi-part object the current object will be linked into
 modname-multi = $(sort $(foreach m,$(multi-used),\
                $(if $(filter $(subst $(obj)/,,$*.o), $($(m:.o=-objs)) $($(m:.o=-y))),$(m:.o=))))
@@ -272,8 +277,7 @@ $(obj)/%.dtb: $(src)/%.dts FORCE
 dtc-tmp = $(subst $(comma),_,$(dot-target).dts)
 
 quiet_cmd_dtc_cpp = DTC+CPP $@
-cmd_dtc_cpp = $(CPP) $(cpp_flags) -x assembler-with-cpp -undef -D__DTS__  \
-                       -o $(dtc-tmp) $< ; \
+cmd_dtc_cpp = $(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
        $(objtree)/scripts/dtc/dtc -O dtb -o $@ -b 0 $(DTC_FLAGS) $(dtc-tmp)
 
 $(obj)/%.dtb: $(src)/%.dtsp FORCE