2 # arch/sh/boot/Makefile
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
8 # Copyright (C) 1999 Stuart Menefy
11 MKIMAGE := $(srctree)/scripts/mkuboot.sh
14 # Assign safe dummy values if these variables are not defined,
15 # in order to suppress error message.
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
23 targets := zImage vmlinux.srec uImage uImage.srec
26 $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
27 $(call if_changed,objcopy)
28 @echo ' Kernel: $@ is ready'
30 $(obj)/compressed/vmlinux: FORCE
31 $(Q)$(MAKE) $(build)=$(obj)/compressed $@
33 KERNEL_MEMORY := 0x00000000
34 ifeq ($(CONFIG_PMB_FIXED),y)
35 KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
36 $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
38 ifeq ($(CONFIG_29BIT),y)
39 KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
40 $$[$(CONFIG_MEMORY_START)]')
43 export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
44 CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY
46 KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
47 $$[$(CONFIG_PAGE_OFFSET) + \
49 $(CONFIG_ZERO_PAGE_OFFSET)]')
51 KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
52 $$[$(CONFIG_PAGE_OFFSET) + \
54 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
56 quiet_cmd_uimage = UIMAGE $@
57 cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
58 -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
59 -n 'Linux-$(KERNELRELEASE)' -d $< $@
61 $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
62 $(call if_changed,uimage)
63 @echo ' Image $@ is ready'
65 $(obj)/vmlinux.bin: vmlinux FORCE
66 $(call if_changed,objcopy)
68 $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
69 $(call if_changed,gzip)
71 OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
72 $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
73 $(call if_changed,objcopy)
75 OBJCOPYFLAGS_uImage.srec := -I binary -O srec
76 $(obj)/uImage.srec: $(obj)/uImage
77 $(call if_changed,objcopy)
79 clean-files += uImage uImage.srec vmlinux.srec \
80 vmlinux.bin vmlinux.bin.gz