11da177e4SLinus Torvalds# 21da177e4SLinus Torvalds# arch/sh/boot/Makefile 31da177e4SLinus Torvalds# 41da177e4SLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public 51da177e4SLinus Torvalds# License. See the file "COPYING" in the main directory of this archive 61da177e4SLinus Torvalds# for more details. 71da177e4SLinus Torvalds# 81da177e4SLinus Torvalds# Copyright (C) 1999 Stuart Menefy 91da177e4SLinus Torvalds# 101da177e4SLinus Torvalds 11cf00e204SPaul MundtMKIMAGE := $(srctree)/scripts/mkuboot.sh 12cf00e204SPaul Mundt 13cf00e204SPaul Mundt# 14cf00e204SPaul Mundt# Assign safe dummy values if these variables are not defined, 15cf00e204SPaul Mundt# in order to suppress error message. 16cf00e204SPaul Mundt# 17cf00e204SPaul MundtCONFIG_PAGE_OFFSET ?= 0x80000000 18cf00e204SPaul MundtCONFIG_MEMORY_START ?= 0x0c000000 19cf00e204SPaul MundtCONFIG_BOOT_LINK_OFFSET ?= 0x00800000 20cf00e204SPaul MundtCONFIG_ZERO_PAGE_OFFSET ?= 0x00001000 21d27e0854SPaul MundtCONFIG_ENTRY_OFFSET ?= 0x00001000 22e66ac3f2SSimon HormanCONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START) 23cf00e204SPaul Mundt 249e24c7e2SMagnus Dammsuffix-y := bin 25ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_GZIP) := gz 26ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_BZIP2) := bz2 27ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_LZMA) := lzma 2850cfa79dSPaul Mundtsuffix-$(CONFIG_KERNEL_XZ) := xz 29c7b16efbSPaul Mundtsuffix-$(CONFIG_KERNEL_LZO) := lzo 30ef9b542fSPaul Mundt 31c7b16efbSPaul Mundttargets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \ 3250cfa79dSPaul Mundt uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin 33c7b16efbSPaul Mundtextra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \ 3450cfa79dSPaul Mundt vmlinux.bin.xz vmlinux.bin.lzo 353c928320SMagnus Dammsubdir- := compressed romimage 361da177e4SLinus Torvalds 371da177e4SLinus Torvalds$(obj)/zImage: $(obj)/compressed/vmlinux FORCE 381da177e4SLinus Torvalds $(call if_changed,objcopy) 391da177e4SLinus Torvalds @echo ' Kernel: $@ is ready' 401da177e4SLinus Torvalds 411da177e4SLinus Torvalds$(obj)/compressed/vmlinux: FORCE 421da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(obj)/compressed $@ 431da177e4SLinus Torvalds 443c928320SMagnus Damm$(obj)/romImage: $(obj)/romimage/vmlinux FORCE 453c928320SMagnus Damm $(call if_changed,objcopy) 463c928320SMagnus Damm @echo ' Kernel: $@ is ready' 473c928320SMagnus Damm 483c928320SMagnus Damm$(obj)/romimage/vmlinux: $(obj)/zImage FORCE 493c928320SMagnus Damm $(Q)$(MAKE) $(build)=$(obj)/romimage $@ 503c928320SMagnus Damm 512f47f447SYoshihiro ShimodaKERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \ 52e66ac3f2SSimon Horman $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]') 532f47f447SYoshihiro Shimoda 542f47f447SYoshihiro ShimodaKERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \ 552f47f447SYoshihiro Shimoda $$[$(CONFIG_PAGE_OFFSET) + \ 562f47f447SYoshihiro Shimoda $(KERNEL_MEMORY) + \ 572f47f447SYoshihiro Shimoda $(CONFIG_ZERO_PAGE_OFFSET)]') 58453ec9c1SThomas Betker 5966b5bf42SPaul MundtKERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \ 606fc5153aSPaul Mundt $$[$(CONFIG_PAGE_OFFSET) + \ 612f47f447SYoshihiro Shimoda $(KERNEL_MEMORY) + \ 6282cb1f6fSYoshihiro Shimoda $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') 63cf00e204SPaul Mundt 64cf00e204SPaul Mundtquiet_cmd_uimage = UIMAGE $@ 65cf00e204SPaul Mundt cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ 66ef9b542fSPaul Mundt -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \ 67cf00e204SPaul Mundt -n 'Linux-$(KERNELRELEASE)' -d $< $@ 68cf00e204SPaul Mundt 69453ec9c1SThomas Betker$(obj)/vmlinux.bin: vmlinux FORCE 70453ec9c1SThomas Betker $(call if_changed,objcopy) 71453ec9c1SThomas Betker 72453ec9c1SThomas Betker$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 73453ec9c1SThomas Betker $(call if_changed,gzip) 74453ec9c1SThomas Betker 75ef9b542fSPaul Mundt$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE 76ef9b542fSPaul Mundt $(call if_changed,bzip2) 77ef9b542fSPaul Mundt 78ef9b542fSPaul Mundt$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE 79ef9b542fSPaul Mundt $(call if_changed,lzma) 80ef9b542fSPaul Mundt 8150cfa79dSPaul Mundt$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE 8250cfa79dSPaul Mundt $(call if_changed,xzkern) 8350cfa79dSPaul Mundt 84c7b16efbSPaul Mundt$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE 85c7b16efbSPaul Mundt $(call if_changed,lzo) 86c7b16efbSPaul Mundt 87ef9b542fSPaul Mundt$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 88ef9b542fSPaul Mundt $(call if_changed,uimage,bzip2) 89ef9b542fSPaul Mundt 90ef9b542fSPaul Mundt$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz 91ef9b542fSPaul Mundt $(call if_changed,uimage,gzip) 92ef9b542fSPaul Mundt 93ef9b542fSPaul Mundt$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma 94ef9b542fSPaul Mundt $(call if_changed,uimage,lzma) 95ef9b542fSPaul Mundt 9650cfa79dSPaul Mundt$(obj)/uImage.xz: $(obj)/vmlinux.bin.xz 9750cfa79dSPaul Mundt $(call if_changed,uimage,xz) 9850cfa79dSPaul Mundt 99c7b16efbSPaul Mundt$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo 100c7b16efbSPaul Mundt $(call if_changed,uimage,lzo) 101c7b16efbSPaul Mundt 1029e24c7e2SMagnus Damm$(obj)/uImage.bin: $(obj)/vmlinux.bin 1039e24c7e2SMagnus Damm $(call if_changed,uimage,none) 1049e24c7e2SMagnus Damm 105cf00e204SPaul MundtOBJCOPYFLAGS_vmlinux.srec := -I binary -O srec 106cf00e204SPaul Mundt$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux 107cf00e204SPaul Mundt $(call if_changed,objcopy) 108cf00e204SPaul Mundt 109cf00e204SPaul MundtOBJCOPYFLAGS_uImage.srec := -I binary -O srec 110cf00e204SPaul Mundt$(obj)/uImage.srec: $(obj)/uImage 111cf00e204SPaul Mundt $(call if_changed,objcopy) 112cf00e204SPaul Mundt 113ef9b542fSPaul Mundt$(obj)/uImage: $(obj)/uImage.$(suffix-y) 114ef9b542fSPaul Mundt @ln -sf $(notdir $<) $@ 115ef9b542fSPaul Mundt @echo ' Image $@ is ready' 116ef9b542fSPaul Mundt 117ef9b542fSPaul Mundtexport CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \ 118e66ac3f2SSimon Horman CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \ 119e66ac3f2SSimon Horman KERNEL_MEMORY suffix-y 120