build: fix arch used during dts compilation
authorFelix Fietkau <nbd@openwrt.org>
Thu, 10 Dec 2015 12:39:32 +0000 (12:39 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 10 Dec 2015 12:39:32 +0000 (12:39 +0000)
Use kernel arch for dts compilation.
Also use Image/BuildDTB to build dts for ramips.

Signed-off-by: Nikolay Martynov <mar.kolya@gmail.com>
SVN-Revision: 47823

include/image.mk
target/linux/ramips/image/Makefile

index fd5e3f4b62a4ca2d092c124fc354c6dcc3661b87..6b2fb1afd86b7093869e1e3c0656bf5f3f235852 100644 (file)
@@ -16,7 +16,7 @@ override NO_TRACE_MAKE:=$(_SINGLE)$(NO_TRACE_MAKE)
 
 KDIR=$(KERNEL_BUILD_DIR)
 KDIR_TMP=$(KDIR)/tmp
-DTS_DIR:=$(LINUX_DIR)/arch/$(ARCH)/boot/dts/
+DTS_DIR:=$(LINUX_DIR)/arch/$(LINUX_KARCH)/boot/dts
 
 IMG_PREFIX:=openwrt-$(if $(CONFIG_VERSION_FILENAMES),$(VERSION_NUMBER)-)$(BOARD)$(if $(SUBTARGET),-$(SUBTARGET))
 
@@ -143,8 +143,8 @@ endef
 # $(4) extra DTC flags
 define Image/BuildDTB
        $(CPP) -nostdinc -x assembler-with-cpp \
-               -I$(LINUX_DIR)/arch/$(ARCH)/boot/dts \
-               -I$(LINUX_DIR)/arch/$(ARCH)/boot/dts/include \
+               -I$(DTS_DIR) \
+               -I$(DTS_DIR)/include \
                -undef -D__DTS__ $(3) \
                -o $(2).tmp $(1)
        $(LINUX_DIR)/scripts/dtc/dtc -O dtb \
index e58d012699033869b0818b774ac0aa879db77edd..01e3fcbf119a6490f4f03debe0df1a92c45396d4 100644 (file)
@@ -39,7 +39,7 @@ define Device/Default
 endef
 
 define Build/patch-dtb
-       $(LINUX_DIR)/scripts/dtc/dtc -O dtb -o $@.dtb ../dts/$(DTS).dts
+       $(call Image/BuildDTB,../dts/$(DTS).dts,$@.dtb)
        $(STAGING_DIR_HOST)/bin/patch-dtb $@ $@.dtb
 endef