xref: /linux/arch/sh/boot/Makefile (revision 664718a34348a9ef6f966c3977e8df927a378134)
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
22cf00e204SPaul Mundt
23cf00e204SPaul Mundtexport CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
24d27e0854SPaul Mundt       CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET
25cf00e204SPaul Mundt
26cf00e204SPaul Mundttargets := zImage vmlinux.srec uImage uImage.srec
271da177e4SLinus Torvaldssubdir- := compressed
281da177e4SLinus Torvalds
291da177e4SLinus Torvalds$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
301da177e4SLinus Torvalds	$(call if_changed,objcopy)
311da177e4SLinus Torvalds	@echo '  Kernel: $@ is ready'
321da177e4SLinus Torvalds
331da177e4SLinus Torvalds$(obj)/compressed/vmlinux: FORCE
341da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
351da177e4SLinus Torvalds
36*664718a3SChris Smithifeq ($(CONFIG_32BIT),y)
37*664718a3SChris SmithKERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \
38*664718a3SChris Smith		     $$[$(CONFIG_PAGE_OFFSET)  + \
39*664718a3SChris Smith			$(CONFIG_ZERO_PAGE_OFFSET)]')
40*664718a3SChris Smithelse
4166b5bf42SPaul MundtKERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \
421f25756aSDavid McCullough		     $$[$(CONFIG_PAGE_OFFSET)  + \
43cf00e204SPaul Mundt			$(CONFIG_MEMORY_START) + \
44453ec9c1SThomas Betker			$(CONFIG_ZERO_PAGE_OFFSET)]')
45*664718a3SChris Smithendif
46453ec9c1SThomas Betker
4766b5bf42SPaul MundtKERNEL_ENTRY	:= $(shell /bin/bash -c 'printf "0x%08x" \
486fc5153aSPaul Mundt		     $$[$(CONFIG_PAGE_OFFSET)  + \
496fc5153aSPaul Mundt			$(CONFIG_MEMORY_START) + \
5082cb1f6fSYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
51cf00e204SPaul Mundt
52cf00e204SPaul Mundtquiet_cmd_uimage = UIMAGE  $@
53cf00e204SPaul Mundt      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
5426b63e99SYoshihiro Shimoda		   -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
55cf00e204SPaul Mundt		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
56cf00e204SPaul Mundt
57453ec9c1SThomas Betker$(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE
58cf00e204SPaul Mundt	$(call if_changed,uimage)
59cf00e204SPaul Mundt	@echo '  Image $@ is ready'
60cf00e204SPaul Mundt
61453ec9c1SThomas Betker$(obj)/vmlinux.bin: vmlinux FORCE
62453ec9c1SThomas Betker	$(call if_changed,objcopy)
63453ec9c1SThomas Betker
64453ec9c1SThomas Betker$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
65453ec9c1SThomas Betker	$(call if_changed,gzip)
66453ec9c1SThomas Betker
67cf00e204SPaul MundtOBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
68cf00e204SPaul Mundt$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
69cf00e204SPaul Mundt	$(call if_changed,objcopy)
70cf00e204SPaul Mundt
71cf00e204SPaul MundtOBJCOPYFLAGS_uImage.srec := -I binary -O srec
72cf00e204SPaul Mundt$(obj)/uImage.srec: $(obj)/uImage
73cf00e204SPaul Mundt	$(call if_changed,objcopy)
74cf00e204SPaul Mundt
75453ec9c1SThomas Betkerclean-files	+= uImage uImage.srec vmlinux.srec \
76453ec9c1SThomas Betker		   vmlinux.bin vmlinux.bin.gz
77