2005-04-17 02:20:36 +04:00
# Makefile for the Sparc boot stuff.
#
# Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
# Copyright (C) 1997,1998 Jakub Jelinek (jj@ultra.linux.cz)
ROOT_IMG := /usr/src/root.img
ELFTOAOUT := elftoaout
2012-05-14 21:35:50 +04:00
hostprogs-y := piggyback
targets := tftpboot.img image zImage vmlinux.aout
2008-11-30 08:53:26 +03:00
clean-files := System.map
2005-04-17 02:20:36 +04:00
quiet_cmd_elftoaout = ELFTOAOUT $@
cmd_elftoaout = $( ELFTOAOUT) $( obj) /image -o $@
2011-01-04 14:39:17 +03:00
quiet_cmd_piggy = PIGGY $@
cmd_piggy = $( obj) /piggyback $( BITS) $@ System.map $( ROOT_IMG)
2011-01-04 14:39:18 +03:00
quiet_cmd_strip = STRIP $@
cmd_strip = $( STRIP) -R .comment -R .note -K sun4u_init -K _end -K _start $< -o $@
2008-12-03 14:14:26 +03:00
i f e q ( $( CONFIG_SPARC 64) , y )
# Actual linking
2009-08-17 05:21:47 +04:00
$(obj)/zImage : $( obj ) /image
$( call if_changed,gzip)
2011-01-04 14:39:18 +03:00
@echo ' kernel: $@ is ready'
2009-08-17 05:21:47 +04:00
2008-12-03 14:14:26 +03:00
$(obj)/vmlinux.aout : vmlinux FORCE
$( call if_changed,elftoaout)
@echo ' kernel: $@ is ready'
2011-01-26 09:36:35 +03:00
e l s e
2012-05-14 21:35:50 +04:00
$(obj)/zImage : $( obj ) /image
$( call if_changed,strip)
@echo ' kernel: $@ is ready'
2011-01-26 09:36:35 +03:00
# The following lines make a readable image for U-Boot.
# uImage - Binary file read by U-boot
# uImage.o - object file of uImage for loading with a
# flash programmer understanding ELF.
OBJCOPYFLAGS_image.bin := -S -O binary -R .note -R .comment
$(obj)/image.bin : $( obj ) /image FORCE
$( call if_changed,objcopy)
$(obj)/image.gz : $( obj ) /image .bin
$( call if_changed,gzip)
2012-03-17 01:03:55 +04:00
UIMAGE_LOADADDR = $( CONFIG_UBOOT_LOAD_ADDR)
UIMAGE_ENTRYADDR = $( CONFIG_UBOOT_ENTRY_ADDR)
UIMAGE_COMPRESSION = gzip
2011-01-26 09:36:35 +03:00
quiet_cmd_uimage.o = UIMAGE.O $@
cmd_uimage.o = $( LD) -Tdata $( CONFIG_UBOOT_FLASH_ADDR) \
-r -b binary $@ -o $@ .o
targets += uImage
$(obj)/uImage : $( obj ) /image .gz
$( call if_changed,uimage)
$( call if_changed,uimage.o)
@echo ' Image $@ is ready'
2008-12-03 14:14:26 +03:00
e n d i f
2012-05-14 21:35:50 +04:00
$(obj)/image : vmlinux FORCE
$( call if_changed,strip)
@echo ' kernel: $@ is ready'
2011-01-04 14:39:17 +03:00
$(obj)/tftpboot.img : $( obj ) /image $( obj ) /piggyback System .map $( ROOT_IMG ) FORCE
$( call if_changed,elftoaout)
$( call if_changed,piggy)