]> nv-tegra.nvidia Code Review - linux-3.10.git/blobdiff - arch/ppc/boot/images/Makefile
[PATCH] ppc32: make -j12 all fails in uImage target
[linux-3.10.git] / arch / ppc / boot / images / Makefile
index f850fb0fb5118be47d976291ee028697fbdeb688..532e7ef1edb6229405496e85dbd5cb3f12301f07 100644 (file)
@@ -6,12 +6,17 @@ MKIMAGE               := $(srctree)/scripts/mkuboot.sh
 
 extra-y                := vmlinux.bin vmlinux.gz
 
+# two make processes may write to vmlinux.gz at the same time with make -j
+quiet_cmd_mygzip = GZIP    $@
+cmd_mygzip = gzip -f -9 < $< > $@.$$$$ && mv $@.$$$$ $@
+
+
 OBJCOPYFLAGS_vmlinux.bin := -O binary
 $(obj)/vmlinux.bin: vmlinux FORCE
        $(call if_changed,objcopy)
 
 $(obj)/vmlinux.gz: $(obj)/vmlinux.bin FORCE
-       $(call if_changed,gzip)
+       $(call if_changed,mygzip)
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A ppc -O linux -T kernel \
@@ -22,7 +27,8 @@ targets += uImage
 $(obj)/uImage: $(obj)/vmlinux.gz
        $(Q)rm -f $@
        $(call if_changed,uimage)
-       @echo '  Image: $@' $(if $(wildcard $@),'is ready','not made')
+       @echo -n '  Image: $@ '
+       @if [ -f $@ ]; then echo 'is ready' ; else echo 'not made'; fi
 
 # Files generated that shall be removed upon make clean
 clean-files    := sImage vmapus vmlinux* miboot* zImage* uImage