xref: /linux/arch/sh/boot/Makefile (revision 4e70b646bae578bb51c89204b5b81ef499436482)
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 Mundt#
12cf00e204SPaul Mundt# Assign safe dummy values if these variables are not defined,
13cf00e204SPaul Mundt# in order to suppress error message.
14cf00e204SPaul Mundt#
15cf00e204SPaul MundtCONFIG_PAGE_OFFSET	?= 0x80000000
16cf00e204SPaul MundtCONFIG_MEMORY_START	?= 0x0c000000
17cf00e204SPaul MundtCONFIG_BOOT_LINK_OFFSET	?= 0x00800000
18cf00e204SPaul MundtCONFIG_ZERO_PAGE_OFFSET	?= 0x00001000
19d27e0854SPaul MundtCONFIG_ENTRY_OFFSET	?= 0x00001000
20e66ac3f2SSimon HormanCONFIG_PHYSICAL_START	?= $(CONFIG_MEMORY_START)
21cf00e204SPaul Mundt
229e24c7e2SMagnus Dammsuffix-y := bin
23ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_GZIP)	:= gz
24ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_BZIP2)	:= bz2
25ef9b542fSPaul Mundtsuffix-$(CONFIG_KERNEL_LZMA)	:= lzma
2650cfa79dSPaul Mundtsuffix-$(CONFIG_KERNEL_XZ)	:= xz
27c7b16efbSPaul Mundtsuffix-$(CONFIG_KERNEL_LZO)	:= lzo
28ef9b542fSPaul Mundt
29c7b16efbSPaul Mundttargets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
3050cfa79dSPaul Mundt	   uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
31c7b16efbSPaul Mundtextra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
3250cfa79dSPaul Mundt	   vmlinux.bin.xz vmlinux.bin.lzo
333c928320SMagnus Dammsubdir- := compressed romimage
341da177e4SLinus Torvalds
351da177e4SLinus Torvalds$(obj)/zImage: $(obj)/compressed/vmlinux FORCE
361da177e4SLinus Torvalds	$(call if_changed,objcopy)
371da177e4SLinus Torvalds	@echo '  Kernel: $@ is ready'
381da177e4SLinus Torvalds
391da177e4SLinus Torvalds$(obj)/compressed/vmlinux: FORCE
401da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(obj)/compressed $@
411da177e4SLinus Torvalds
423c928320SMagnus Damm$(obj)/romImage: $(obj)/romimage/vmlinux FORCE
433c928320SMagnus Damm	$(call if_changed,objcopy)
443c928320SMagnus Damm	@echo '  Kernel: $@ is ready'
453c928320SMagnus Damm
463c928320SMagnus Damm$(obj)/romimage/vmlinux: $(obj)/zImage FORCE
473c928320SMagnus Damm	$(Q)$(MAKE) $(build)=$(obj)/romimage $@
483c928320SMagnus Damm
492f47f447SYoshihiro ShimodaKERNEL_MEMORY	:= $(shell /bin/bash -c 'printf "0x%08x" \
50e66ac3f2SSimon Horman		     $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
512f47f447SYoshihiro Shimoda
522f47f447SYoshihiro ShimodaKERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \
532f47f447SYoshihiro Shimoda		     $$[$(CONFIG_PAGE_OFFSET)  + \
542f47f447SYoshihiro Shimoda			$(KERNEL_MEMORY) + \
552f47f447SYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET)]')
56453ec9c1SThomas Betker
5766b5bf42SPaul MundtKERNEL_ENTRY	:= $(shell /bin/bash -c 'printf "0x%08x" \
586fc5153aSPaul Mundt		     $$[$(CONFIG_PAGE_OFFSET)  + \
592f47f447SYoshihiro Shimoda			$(KERNEL_MEMORY) + \
6082cb1f6fSYoshihiro Shimoda			$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
61cf00e204SPaul Mundt
62e3393645SStephen WarrenUIMAGE_LOADADDR = $(KERNEL_LOAD)
63e3393645SStephen WarrenUIMAGE_ENTRYADDR = $(KERNEL_ENTRY)
64cf00e204SPaul Mundt
65453ec9c1SThomas Betker$(obj)/vmlinux.bin: vmlinux FORCE
66453ec9c1SThomas Betker	$(call if_changed,objcopy)
67453ec9c1SThomas Betker
68453ec9c1SThomas Betker$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
69453ec9c1SThomas Betker	$(call if_changed,gzip)
70453ec9c1SThomas Betker
71ef9b542fSPaul Mundt$(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
72ef9b542fSPaul Mundt	$(call if_changed,bzip2)
73ef9b542fSPaul Mundt
74ef9b542fSPaul Mundt$(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
75ef9b542fSPaul Mundt	$(call if_changed,lzma)
76ef9b542fSPaul Mundt
7750cfa79dSPaul Mundt$(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
7850cfa79dSPaul Mundt	$(call if_changed,xzkern)
7950cfa79dSPaul Mundt
80c7b16efbSPaul Mundt$(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
81c7b16efbSPaul Mundt	$(call if_changed,lzo)
82c7b16efbSPaul Mundt
83*4e70b646SGeert Uytterhoeven$(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2 FORCE
84ef9b542fSPaul Mundt	$(call if_changed,uimage,bzip2)
85ef9b542fSPaul Mundt
86*4e70b646SGeert Uytterhoeven$(obj)/uImage.gz: $(obj)/vmlinux.bin.gz FORCE
87ef9b542fSPaul Mundt	$(call if_changed,uimage,gzip)
88ef9b542fSPaul Mundt
89*4e70b646SGeert Uytterhoeven$(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma FORCE
90ef9b542fSPaul Mundt	$(call if_changed,uimage,lzma)
91ef9b542fSPaul Mundt
92*4e70b646SGeert Uytterhoeven$(obj)/uImage.xz: $(obj)/vmlinux.bin.xz FORCE
9350cfa79dSPaul Mundt	$(call if_changed,uimage,xz)
9450cfa79dSPaul Mundt
95*4e70b646SGeert Uytterhoeven$(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo FORCE
96c7b16efbSPaul Mundt	$(call if_changed,uimage,lzo)
97c7b16efbSPaul Mundt
98*4e70b646SGeert Uytterhoeven$(obj)/uImage.bin: $(obj)/vmlinux.bin FORCE
999e24c7e2SMagnus Damm	$(call if_changed,uimage,none)
1009e24c7e2SMagnus Damm
101cf00e204SPaul MundtOBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
102*4e70b646SGeert Uytterhoeven$(obj)/vmlinux.srec: $(obj)/compressed/vmlinux FORCE
103cf00e204SPaul Mundt	$(call if_changed,objcopy)
104cf00e204SPaul Mundt
105cf00e204SPaul MundtOBJCOPYFLAGS_uImage.srec := -I binary -O srec
106*4e70b646SGeert Uytterhoeven$(obj)/uImage.srec: $(obj)/uImage FORCE
107cf00e204SPaul Mundt	$(call if_changed,objcopy)
108cf00e204SPaul Mundt
109ef9b542fSPaul Mundt$(obj)/uImage: $(obj)/uImage.$(suffix-y)
110ef9b542fSPaul Mundt	@ln -sf $(notdir $<) $@
111ef9b542fSPaul Mundt	@echo '  Image $@ is ready'
112ef9b542fSPaul Mundt
113ef9b542fSPaul Mundtexport CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
114e66ac3f2SSimon Horman       CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
115e66ac3f2SSimon Horman       KERNEL_MEMORY suffix-y
116