Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mfashe...
[pandora-kernel.git] / arch / sh / boot / Makefile
1 #
2 # arch/sh/boot/Makefile
3 #
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License.  See the file "COPYING" in the main directory of this archive
6 # for more details.
7 #
8 # Copyright (C) 1999 Stuart Menefy
9 #
10
11 MKIMAGE := $(srctree)/scripts/mkuboot.sh
12
13 #
14 # Assign safe dummy values if these variables are not defined,
15 # in order to suppress error message.
16 #
17 CONFIG_PAGE_OFFSET      ?= 0x80000000
18 CONFIG_MEMORY_START     ?= 0x0c000000
19 CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
20 CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
21 CONFIG_ENTRY_OFFSET     ?= 0x00001000
22
23 export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
24        CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET
25
26 targets := zImage vmlinux.srec uImage uImage.srec
27 subdir- := compressed
28
29 $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
30         $(call if_changed,objcopy)
31         @echo '  Kernel: $@ is ready'
32
33 $(obj)/compressed/vmlinux: FORCE
34         $(Q)$(MAKE) $(build)=$(obj)/compressed $@
35
36 KERNEL_LOAD     := $(shell /bin/bash -c 'printf "0x%08x" \
37                      $$[$(CONFIG_PAGE_OFFSET)  + \
38                         $(CONFIG_MEMORY_START) + \
39                         $(CONFIG_ZERO_PAGE_OFFSET)]')
40
41 KERNEL_ENTRY    := $(shell /bin/bash -c 'printf "0x%08x" \
42                      $$[$(CONFIG_PAGE_OFFSET)  + \
43                         $(CONFIG_MEMORY_START) + \
44                         $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
45
46 quiet_cmd_uimage = UIMAGE  $@
47       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
48                    -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
49                    -n 'Linux-$(KERNELRELEASE)' -d $< $@
50
51 $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
52         $(call if_changed,uimage)
53         @echo '  Image $@ is ready'
54
55 $(obj)/vmlinux.bin: vmlinux FORCE
56         $(call if_changed,objcopy)
57
58 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
59         $(call if_changed,gzip)
60
61 OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
62 $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
63         $(call if_changed,objcopy)
64
65 OBJCOPYFLAGS_uImage.srec := -I binary -O srec
66 $(obj)/uImage.srec: $(obj)/uImage
67         $(call if_changed,objcopy)
68
69 clean-files     += uImage uImage.srec vmlinux.srec \
70                    vmlinux.bin vmlinux.bin.gz