Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
[linux-2.6-block.git] / arch / sh / boot / Makefile
CommitLineData
1da177e4
LT
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
cf00e204
PM
11MKIMAGE := $(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#
17CONFIG_PAGE_OFFSET ?= 0x80000000
18CONFIG_MEMORY_START ?= 0x0c000000
19CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
20CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
d27e0854 21CONFIG_ENTRY_OFFSET ?= 0x00001000
cf00e204 22
cf00e204 23targets := zImage vmlinux.srec uImage uImage.srec
1da177e4
LT
24subdir- := compressed
25
26$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
27 $(call if_changed,objcopy)
cf00e204 28 @echo ' Kernel: $@ is ready'
1da177e4
LT
29
30$(obj)/compressed/vmlinux: FORCE
31 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
32
2f47f447
YS
33KERNEL_MEMORY := 0x00000000
34ifeq ($(CONFIG_PMB_FIXED),y)
35KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
36 $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
37endif
38ifeq ($(CONFIG_29BIT),y)
39KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
40 $$[$(CONFIG_MEMORY_START)]')
41endif
42
b2088356
PM
43export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
44 CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY
45
66b5bf42 46KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
1f25756a 47 $$[$(CONFIG_PAGE_OFFSET) + \
2f47f447 48 $(KERNEL_MEMORY) + \
453ec9c1
TB
49 $(CONFIG_ZERO_PAGE_OFFSET)]')
50
66b5bf42 51KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
6fc5153a 52 $$[$(CONFIG_PAGE_OFFSET) + \
2f47f447 53 $(KERNEL_MEMORY) + \
82cb1f6f 54 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
cf00e204
PM
55
56quiet_cmd_uimage = UIMAGE $@
57 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
26b63e99 58 -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
cf00e204
PM
59 -n 'Linux-$(KERNELRELEASE)' -d $< $@
60
453ec9c1 61$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
cf00e204
PM
62 $(call if_changed,uimage)
63 @echo ' Image $@ is ready'
64
453ec9c1
TB
65$(obj)/vmlinux.bin: vmlinux FORCE
66 $(call if_changed,objcopy)
67
68$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
69 $(call if_changed,gzip)
70
cf00e204
PM
71OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
72$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
73 $(call if_changed,objcopy)
74
75OBJCOPYFLAGS_uImage.srec := -I binary -O srec
76$(obj)/uImage.srec: $(obj)/uImage
77 $(call if_changed,objcopy)
78
453ec9c1
TB
79clean-files += uImage uImage.srec vmlinux.srec \
80 vmlinux.bin vmlinux.bin.gz