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
22 CONFIG_PHYSICAL_START ?
= $(CONFIG_MEMORY_START
)
25 suffix-
$(CONFIG_KERNEL_GZIP
) := gz
26 suffix-
$(CONFIG_KERNEL_BZIP2
) := bz2
27 suffix-
$(CONFIG_KERNEL_LZMA
) := lzma
28 suffix-
$(CONFIG_KERNEL_XZ
) := xz
29 suffix-
$(CONFIG_KERNEL_LZO
) := lzo
31 targets
:= zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
32 uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
33 extra-y
+= vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
34 vmlinux.bin.xz vmlinux.bin.lzo
35 subdir-
:= compressed romimage
37 $(obj
)/zImage
: $(obj
)/compressed
/vmlinux FORCE
38 $(call if_changed
,objcopy
)
39 @echo
' Kernel: $@ is ready'
41 $(obj
)/compressed
/vmlinux
: FORCE
42 $(Q
)$(MAKE
) $(build
)=$(obj
)/compressed
$@
44 $(obj
)/romImage
: $(obj
)/romimage
/vmlinux FORCE
45 $(call if_changed
,objcopy
)
46 @echo
' Kernel: $@ is ready'
48 $(obj
)/romimage
/vmlinux
: $(obj
)/zImage FORCE
49 $(Q
)$(MAKE
) $(build
)=$(obj
)/romimage
$@
51 KERNEL_MEMORY
:= $(shell /bin
/bash
-c
'printf "0x%08x" \
52 $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
54 KERNEL_LOAD
:= $(shell /bin
/bash
-c
'printf "0x%08x" \
55 $$[$(CONFIG_PAGE_OFFSET) + \
57 $(CONFIG_ZERO_PAGE_OFFSET)]')
59 KERNEL_ENTRY
:= $(shell /bin
/bash
-c
'printf "0x%08x" \
60 $$[$(CONFIG_PAGE_OFFSET) + \
62 $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
64 quiet_cmd_uimage
= UIMAGE
$@
65 cmd_uimage
= $(CONFIG_SHELL
) $(MKIMAGE
) -A sh
-O linux
-T kernel \
66 -C
$(2) -a
$(KERNEL_LOAD
) -e
$(KERNEL_ENTRY
) \
67 -n
'Linux-$(KERNELRELEASE)' -d
$< $@
69 $(obj
)/vmlinux.bin
: vmlinux FORCE
70 $(call if_changed
,objcopy
)
72 $(obj
)/vmlinux.bin.gz
: $(obj
)/vmlinux.bin FORCE
73 $(call if_changed
,gzip
)
75 $(obj
)/vmlinux.bin.bz2
: $(obj
)/vmlinux.bin FORCE
76 $(call if_changed
,bzip2
)
78 $(obj
)/vmlinux.bin.lzma
: $(obj
)/vmlinux.bin FORCE
79 $(call if_changed
,lzma
)
81 $(obj
)/vmlinux.bin.xz
: $(obj
)/vmlinux.bin FORCE
82 $(call if_changed
,xzkern
)
84 $(obj
)/vmlinux.bin.lzo
: $(obj
)/vmlinux.bin FORCE
85 $(call if_changed
,lzo
)
87 $(obj
)/uImage.bz2
: $(obj
)/vmlinux.bin.bz2
88 $(call if_changed
,uimage
,bzip2
)
90 $(obj
)/uImage.gz
: $(obj
)/vmlinux.bin.gz
91 $(call if_changed
,uimage
,gzip
)
93 $(obj
)/uImage.lzma
: $(obj
)/vmlinux.bin.lzma
94 $(call if_changed
,uimage
,lzma
)
96 $(obj
)/uImage.xz
: $(obj
)/vmlinux.bin.xz
97 $(call if_changed
,uimage
,xz
)
99 $(obj
)/uImage.lzo
: $(obj
)/vmlinux.bin.lzo
100 $(call if_changed
,uimage
,lzo
)
102 $(obj
)/uImage.bin
: $(obj
)/vmlinux.bin
103 $(call if_changed
,uimage
,none
)
105 OBJCOPYFLAGS_vmlinux.srec
:= -I binary
-O srec
106 $(obj
)/vmlinux.srec
: $(obj
)/compressed
/vmlinux
107 $(call if_changed
,objcopy
)
109 OBJCOPYFLAGS_uImage.srec
:= -I binary
-O srec
110 $(obj
)/uImage.srec
: $(obj
)/uImage
111 $(call if_changed
,objcopy
)
113 $(obj
)/uImage
: $(obj
)/uImage.
$(suffix-y
)
114 @ln
-sf
$(notdir $<) $@
115 @echo
' Image $@ is ready'
117 export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
118 CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
119 KERNEL_MEMORY suffix-y