xref: /linux/arch/sh/boot/Makefile (revision ef9b542fce00dafc6bb1d9097b045a777f4a2382)
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
23*ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_GZIP)  := gz
24*ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_BZIP2) := bz2
25*ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_LZMA)  := lzma
26*ef9b542fSPaul Mundt
27*ef9b542fSPaul Mundttargets := zImage vmlinux.srec uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma
28*ef9b542fSPaul Mundtextra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
291da177e4SLinus Torvaldssubdir- := compressed
301da177e4SLinus Torvalds
311da177e4SLinus Torvalds$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
321da177e4SLinus Torvalds	$(call if_changed,objcopy)
331da177e4SLinus Torvalds	@echo '  Kernel: $@ is ready'
341da177e4SLinus Torvalds
351da177e4SLinus Torvalds$(obj)/compressed/vmlinux: FORCE
361da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
371da177e4SLinus Torvalds
382f47f447SYoshihiro ShimodaKERNEL_MEMORY := 0x00000000
392f47f447SYoshihiro Shimodaifeq ($(CONFIG_PMB_FIXED),y)
402f47f447SYoshihiro ShimodaKERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
412f47f447SYoshihiro Shimoda		     $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
42664718a3SChris Smithendif
432f47f447SYoshihiro Shimodaifeq ($(CONFIG_29BIT),y)
442f47f447SYoshihiro ShimodaKERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
452f47f447SYoshihiro Shimoda		     $$[$(CONFIG_MEMORY_START)]')
462f47f447SYoshihiro Shimodaendif
472f47f447SYoshihiro Shimoda
482f47f447SYoshihiro ShimodaKERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \
492f47f447SYoshihiro Shimoda		     $$[$(CONFIG_PAGE_OFFSET)  + \
502f47f447SYoshihiro Shimoda			$(KERNEL_MEMORY) + \
512f47f447SYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET)]')
52453ec9c1SThomas Betker
5366b5bf42SPaul MundtKERNEL_ENTRY	:= $(shell /bin/bash -c 'printf "0x%08x" \
546fc5153aSPaul Mundt		     $$[$(CONFIG_PAGE_OFFSET)  + \
552f47f447SYoshihiro Shimoda			$(KERNEL_MEMORY) + \
5682cb1f6fSYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
57cf00e204SPaul Mundt
58cf00e204SPaul Mundtquiet_cmd_uimage = UIMAGE  $@
59cf00e204SPaul Mundt      cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
60*ef9b542fSPaul Mundt		   -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
61cf00e204SPaul Mundt		   -n 'Linux-$(KERNELRELEASE)' -d $< $@
62cf00e204SPaul Mundt
63453ec9c1SThomas Betker$(obj)/vmlinux.bin: vmlinux FORCE
64453ec9c1SThomas Betker	$(call if_changed,objcopy)
65453ec9c1SThomas Betker
66453ec9c1SThomas Betker$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
67453ec9c1SThomas Betker	$(call if_changed,gzip)
68453ec9c1SThomas Betker
69*ef9b542fSPaul Mundt$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
70*ef9b542fSPaul Mundt	$(call if_changed,bzip2)
71*ef9b542fSPaul Mundt
72*ef9b542fSPaul Mundt$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
73*ef9b542fSPaul Mundt	$(call if_changed,lzma)
74*ef9b542fSPaul Mundt
75*ef9b542fSPaul Mundt$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
76*ef9b542fSPaul Mundt	$(call if_changed,uimage,bzip2)
77*ef9b542fSPaul Mundt
78*ef9b542fSPaul Mundt$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
79*ef9b542fSPaul Mundt	$(call if_changed,uimage,gzip)
80*ef9b542fSPaul Mundt
81*ef9b542fSPaul Mundt$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
82*ef9b542fSPaul Mundt	$(call if_changed,uimage,lzma)
83*ef9b542fSPaul Mundt
84cf00e204SPaul MundtOBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
85cf00e204SPaul Mundt$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
86cf00e204SPaul Mundt	$(call if_changed,objcopy)
87cf00e204SPaul Mundt
88cf00e204SPaul MundtOBJCOPYFLAGS_uImage.srec := -I binary -O srec
89cf00e204SPaul Mundt$(obj)/uImage.srec: $(obj)/uImage
90cf00e204SPaul Mundt	$(call if_changed,objcopy)
91cf00e204SPaul Mundt
92*ef9b542fSPaul Mundt$(obj)/uImage: $(obj)/uImage.$(suffix-y)
93*ef9b542fSPaul Mundt	@ln -sf $(notdir $<) $@
94*ef9b542fSPaul Mundt	@echo '  Image $@ is ready'
95*ef9b542fSPaul Mundt
96*ef9b542fSPaul Mundtexport CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
97*ef9b542fSPaul Mundt       CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y
98