blob: 4b3a6f19c3b54e8fcbf1bd03fa92ce727f4d379f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
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
Paul Mundtcf00e202006-12-07 17:00:32 +090011MKIMAGE := $(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
21
22export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
23 CONFIG_ZERO_PAGE_OFFSET
24
25targets := zImage vmlinux.srec uImage uImage.srec
Linus Torvalds1da177e2005-04-16 15:20:36 -070026subdir- := compressed
27
28$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
29 $(call if_changed,objcopy)
Paul Mundtcf00e202006-12-07 17:00:32 +090030 @echo ' Kernel: $@ is ready'
Linus Torvalds1da177e2005-04-16 15:20:36 -070031
32$(obj)/compressed/vmlinux: FORCE
33 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
34
David McCullough1f257562007-07-26 17:43:41 +090035KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%8x" \
36 $$[$(CONFIG_PAGE_OFFSET) + \
37 $(CONFIG_MEMORY_START) + \
Thomas Betker453ec9c2007-11-30 18:22:10 +090038 $(CONFIG_ZERO_PAGE_OFFSET)]')
39
40KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%8x" \
41 $$[$(KERNEL_LOAD)+0x1000]')
42
Paul Mundtcf00e202006-12-07 17:00:32 +090043
44quiet_cmd_uimage = UIMAGE $@
45 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
Thomas Betker453ec9c2007-11-30 18:22:10 +090046 -C none -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
Paul Mundtcf00e202006-12-07 17:00:32 +090047 -n 'Linux-$(KERNELRELEASE)' -d $< $@
48
Thomas Betker453ec9c2007-11-30 18:22:10 +090049$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
Paul Mundtcf00e202006-12-07 17:00:32 +090050 $(call if_changed,uimage)
51 @echo ' Image $@ is ready'
52
Thomas Betker453ec9c2007-11-30 18:22:10 +090053$(obj)/vmlinux.bin: vmlinux FORCE
54 $(call if_changed,objcopy)
55
56$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
57 $(call if_changed,gzip)
58
Paul Mundtcf00e202006-12-07 17:00:32 +090059OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
60$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
61 $(call if_changed,objcopy)
62
63OBJCOPYFLAGS_uImage.srec := -I binary -O srec
64$(obj)/uImage.srec: $(obj)/uImage
65 $(call if_changed,objcopy)
66
Thomas Betker453ec9c2007-11-30 18:22:10 +090067clean-files += uImage uImage.srec vmlinux.srec \
68 vmlinux.bin vmlinux.bin.gz