Skip to content

Commit 50f9dda

Browse files
masahir0yrobherring
authored andcommitted
of: search scripts/dtc/include-prefixes path for both CPP and DTC
Since commit d5d332d ("devicetree: Move include prefixes from arch to separate directory"), cross-arch DT reference works well, but only for CPP style #include directives. It makes as much sense to share DT between different architectures by using DTC's /include/ directives. So, scripts/dtc/include-prefixes should be passed to both CPP and DTC. I refactored Makefile.lib a bit to not repeat the same path. Signed-off-by: Masahiro Yamada <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent 5ffa2ae commit 50f9dda

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

scripts/Makefile.lib

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,10 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
173173

174174
ld_flags = $(LDFLAGS) $(ldflags-y)
175175

176+
DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes
177+
176178
dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \
177-
-I$(srctree)/scripts/dtc/include-prefixes \
179+
$(addprefix -I,$(DTC_INCLUDE)) \
178180
-undef -D__DTS__
179181

180182
# Finds the multi-part object the current object will be linked into
@@ -315,7 +317,7 @@ quiet_cmd_dtc = DTC $@
315317
cmd_dtc = mkdir -p $(dir ${dtc-tmp}) ; \
316318
$(CPP) $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
317319
$(DTC) -O dtb -o $@ -b 0 \
318-
-i $(dir $<) $(DTC_FLAGS) \
320+
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
319321
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
320322
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
321323

0 commit comments

Comments
 (0)