2 # arch/m68k/boot/Makefile
4 # Based on arch/sh/boot/Makefile by Stuart Menefy
6 # Copyright (c) 2008 Freescale Semiconductor, Inc. All Rights Reserved.
7 # by Kurt Mahan <kmahan@freescale.com>
9 # This file is subject to the terms and conditions of the GNU General Public
10 # License. See the file "COPYING" in the main directory of this archive
14 MKIMAGE
:= $(srctree
)/scripts
/mkuboot.sh
17 # Assign safe dummy values if these variables are not defined,
18 # in order to suppress error message.
20 CONFIG_SDRAM_BASE ?
= 0x40000000
21 CONFIG_IMG_START ?
= 0x00020000
23 export CONFIG_SDRAM_BASE CONFIG_IMG_START
25 targets
:= zImage zImage.srec vmlinux.srec uImage uImage.srec
27 $(obj
)/zImage
: $(obj
)/vmlinux.bin FORCE
28 $(call if_changed
,gzip
)
29 @echo
' Image $@ is ready'
31 OBJCOPYFLAGS_zImage.srec
:= -I binary
-O srec
32 $(obj
)/zImage.srec
: $(obj
)/zImage
33 $(call if_changed
,objcopy
)
35 KERNEL_LOAD
:= $(shell /bin
/bash
-c
'printf "0x%08x" \
36 $$[$(CONFIG_SDRAM_BASE) + \
37 $(CONFIG_IMG_START)]')
39 KERNEL_ENTRY
:= $(shell /bin
/bash
-c
'printf "0x%08x" \
40 $$[$(CONFIG_SDRAM_BASE) + \
41 $(CONFIG_IMG_START)]')
43 quiet_cmd_uimage
= UIMAGE
$@
44 cmd_uimage
= $(CONFIG_SHELL
) $(MKIMAGE
) -A m68k
-O linux
-T kernel \
45 -C gzip
-a
$(KERNEL_LOAD
) -e
$(KERNEL_ENTRY
) \
46 -n
'Linux-$(KERNELRELEASE)' -d
$< $@
48 $(obj
)/uImage
: $(obj
)/vmlinux.bin.gz FORCE
49 $(call if_changed
,uimage
)
50 @echo
' Image $@ is ready'
52 $(obj
)/vmlinux.bin
: vmlinux FORCE
53 $(call if_changed
,objcopy
)
55 $(obj
)/vmlinux.bin.gz
: $(obj
)/vmlinux.bin FORCE
56 $(call if_changed
,gzip
)
58 OBJCOPYFLAGS_vmlinux.srec
:= -I binary
-O srec
59 $(obj
)/vmlinux.srec
: $(obj
)/vmlinux.bin
60 $(call if_changed
,objcopy
)
62 OBJCOPYFLAGS_uImage.srec
:= -I binary
-O srec
63 $(obj
)/uImage.srec
: $(obj
)/uImage
64 $(call if_changed
,objcopy
)
66 clean-files
+= uImage uImage.srec \
68 vmlinux.srec vmlinux.bin vmlinux.bin.gz