Skip to content

Commit

Permalink
of: search scripts/dtc/include-prefixes path for both CPP and DTC
Browse files Browse the repository at this point in the history
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 <yamada.masahiro@socionext.com>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Masahiro Yamada authored and Rob Herring committed Aug 21, 2017
1 parent 5ffa2ae commit 50f9dda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/Makefile.lib
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@ cpp_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \

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

DTC_INCLUDE := $(srctree)/scripts/dtc/include-prefixes

dtc_cpp_flags = -Wp,-MD,$(depfile).pre.tmp -nostdinc \
-I$(srctree)/scripts/dtc/include-prefixes \
$(addprefix -I,$(DTC_INCLUDE)) \
-undef -D__DTS__

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

Expand Down

0 comments on commit 50f9dda

Please sign in to comment.