ar71xx: fix kernel relocate stub parallel build issue
authorFelix Fietkau <nbd@nbd.name>
Tue, 8 Nov 2016 10:50:50 +0000 (11:50 +0100)
committerFelix Fietkau <nbd@nbd.name>
Tue, 8 Nov 2016 10:51:27 +0000 (11:51 +0100)
Use per-kernel directory

Signed-off-by: Felix Fietkau <nbd@nbd.name>
target/linux/ar71xx/image/Makefile

index 26e955840a11c12860b9162d30b94f19f4a07a9e..64221a3d6c56636b3890f59ca5d77093f1437911 100644 (file)
@@ -79,15 +79,16 @@ define Build/loader-okli
 endef
 
 define Build/relocate-kernel
-       rm -rf $(KDIR)/relocate
-       $(CP) ../../generic/image/relocate $(KDIR)
-       $(MAKE) -C $(KDIR)/relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
+       rm -rf $@.relocate
+       $(CP) ../../generic/image/relocate $@.relocate
+       $(MAKE) -j1 -C $@.relocate KERNEL_ADDR=$(KERNEL_LOADADDR) CROSS_COMPILE=$(TARGET_CROSS)
        ( \
-               dd if=$(KDIR)/relocate/loader.bin bs=32 conv=sync && \
+               dd if=$@.relocate/loader.bin bs=32 conv=sync && \
                perl -e '@s = stat("$@"); print pack("N", @s[7])' && \
                cat "$@" \
        ) > "$@.new"
        mv "$@.new" "$@"
+       rm -rf $@.relocate
 endef
 
 define Build/copy-file