2005-04-16 15:20:36 -07:00
#
2005-07-27 11:44:30 -07:00
# create a compressed vmlinuz image from the binary vmlinux.bin file
2005-04-16 15:20:36 -07:00
#
2005-07-27 11:44:30 -07:00
target = $( target_compressed_dir)
src = $( src_compressed_dir)
2005-04-16 15:20:36 -07:00
2005-07-27 11:44:30 -07:00
CC = gcc-cris -melf $( LINUXINCLUDE)
2005-04-16 15:20:36 -07:00
CFLAGS = -O2
LD = ld-cris
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section= .bss
2005-07-27 11:44:30 -07:00
OBJECTS = $( target) /head.o $( target) /misc.o
2005-04-16 15:20:36 -07:00
# files to compress
2005-07-27 11:44:30 -07:00
SYSTEM = $( objtree) /vmlinux.bin
2005-04-16 15:20:36 -07:00
2005-07-27 11:44:30 -07:00
all : $( target_compressed_dir ) /vmlinuz
2005-04-16 15:20:36 -07:00
2005-07-27 11:44:30 -07:00
$(target)/decompress.bin : $( OBJECTS )
$( LD) -T $( src) /decompress.ld -o $( target) /decompress.o $( OBJECTS)
$( OBJCOPY) $( OBJCOPYFLAGS) $( target) /decompress.o $( target) /decompress.bin
2005-04-16 15:20:36 -07:00
2005-07-27 11:44:30 -07:00
# Create vmlinuz image in top-level build directory
$(target_compressed_dir)/vmlinuz : $( target ) piggy .img $( target ) /decompress .bin
@echo " COMPR vmlinux.bin --> vmlinuz"
@cat $( target) /decompress.bin piggy.img > $( target_compressed_dir) /vmlinuz
@rm -f piggy.img
2005-04-16 15:20:36 -07:00
2005-07-27 11:44:30 -07:00
$(target)/head.o : $( src ) /head .S
$( CC) -D__ASSEMBLY__ -traditional -c $< -o $@
2005-04-16 15:20:36 -07:00
2005-07-27 11:44:30 -07:00
$(target)/misc.o : $( src ) /misc .c
$( CC) -D__KERNEL__ -c $< -o $@
2005-04-16 15:20:36 -07:00
# gzip the kernel image
piggy.img : $( SYSTEM )
2005-07-27 11:44:30 -07:00
@cat $( SYSTEM) | gzip -f -9 > piggy.img
$(target) :
mkdir -p $( target)
2005-04-16 15:20:36 -07:00
clean :
2005-07-27 11:44:30 -07:00
rm -f piggy.img $( objtree) /vmlinuz
2005-04-16 15:20:36 -07:00