Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
[sfrench/cifs-2.6.git] / arch / sh / boot / Makefile
index 4c5ffdcd55b675aead50a32aaffe86c095ce8456..89b408620dcbbfb68d2e3f02a534fc22e86f3a64 100644 (file)
@@ -32,20 +32,31 @@ $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
 $(obj)/compressed/vmlinux: FORCE
        $(Q)$(MAKE) $(build)=$(obj)/compressed $@
 
-KERNEL_LOAD    := $(shell /bin/bash -c 'printf "0x%8x" \
+KERNEL_LOAD    := $(shell /bin/bash -c 'printf "0x%08x" \
+                    $$[$(CONFIG_PAGE_OFFSET)  + \
+                       $(CONFIG_MEMORY_START) + \
+                       $(CONFIG_ZERO_PAGE_OFFSET)]')
+
+KERNEL_ENTRY   := $(shell /bin/bash -c 'printf "0x%08x" \
                     $$[$(CONFIG_PAGE_OFFSET)  + \
                        $(CONFIG_MEMORY_START) + \
                        $(CONFIG_ZERO_PAGE_OFFSET)+0x1000]')
 
 quiet_cmd_uimage = UIMAGE  $@
       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
-                  -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_LOAD) \
+                  -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
                   -n 'Linux-$(KERNELRELEASE)' -d $< $@
 
-$(obj)/uImage: $(obj)/zImage FORCE
+$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
        $(call if_changed,uimage)
        @echo '  Image $@ is ready'
 
+$(obj)/vmlinux.bin: vmlinux FORCE
+       $(call if_changed,objcopy)
+
+$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
+       $(call if_changed,gzip)
+
 OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
 $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
        $(call if_changed,objcopy)
@@ -54,4 +65,5 @@ OBJCOPYFLAGS_uImage.srec := -I binary -O srec
 $(obj)/uImage.srec: $(obj)/uImage
        $(call if_changed,objcopy)
 
-clean-files    += uImage uImage.srec vmlinux.srec
+clean-files    += uImage uImage.srec vmlinux.srec \
+                  vmlinux.bin vmlinux.bin.gz