summaryrefslogtreecommitdiff
path: root/dts
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2011-06-08 18:31:59 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:39:19 -0700
commit5e285a53c7e0a8922a7f46071f0a9708ff48b305 (patch)
tree0a2ee0018d4a5c5fcb256ecebc68ac30fbd9f6f4 /dts
parent0501cc8d71a840c5b8ab44c1522f7f61a4718c13 (diff)
Fix device tree compilation for out of tree builds.
The device tree compiler output should be placed in the $(obj) rooted tree. Since $(OBJCOPY) insists on adding the path to the generated symbol names, to ensure consistency it should be invoked from the directory where the .dtb file is located and given the input file name without the path. BUG=chromium-os:13082 TEST=build the image for seaboard out of tree (using the O=/tmp/dir make parameter) Change-Id: I8aabae757072c937a42c4dd85e43fdc1309f3dc3 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/2371 Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'dts')
-rw-r--r--dts/Makefile10
1 files changed, 6 insertions, 4 deletions
diff --git a/dts/Makefile b/dts/Makefile
index 986a6b3ee3..9e4cc841e6 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -27,12 +27,14 @@ LIB = $(obj)libdts.o
# Use a constant name for this so we can access it from C code.
# objcopy doesn't seem to allow us to set the symbol name independently of
# the filename.
-DT_BIN := dt.dtb
+DT_BIN := $(obj)dt.dtb
# TODO: get arch properly for objcopy line.
-dt.o: $(TOPDIR)/board/$(BOARDDIR)/$(DEVICE_TREE).dts
- $(DTC) -R 4 -p 0x1000 -O dtb -o $(DT_BIN) $<
- $(OBJCOPY) -B armv5te -I binary -O elf32-littlearm $(DT_BIN) dt.o
+$(obj)dt.o: $(TOPDIR)/board/$(BOARDDIR)/$(DEVICE_TREE).dts
+ $(DTC) -R 4 -p 0x1000 -O dtb -o ${DT_BIN} $<
+ cd $(dir ${DT_BIN}) && \
+ $(OBJCOPY) -B armv5te -I binary -O elf32-littlearm \
+ $(notdir ${DT_BIN}) $@
rm $(DT_BIN)
OBJS := dt.o