[BACK]Return to Makefile CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / arch / cris / arch-v10 / boot / compressed

File: [Development] / linux-2.6-xfs / arch / cris / arch-v10 / boot / compressed / Makefile (download)

Revision 1.2, Mon Aug 29 15:50:38 2005 UTC (12 years, 1 month ago) by nathans.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.1: +24 -19 lines

Merge up to 2.6.13.
Merge of 2.6.x-xfs-melb:linux:23660a by kenmcd.

#
# create a compressed vmlinuz image from the binary vmlinux.bin file
#
target = $(target_compressed_dir)
src    = $(src_compressed_dir)

CC = gcc-cris -melf $(LINUXINCLUDE)
CFLAGS = -O2
LD = ld-cris
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss
OBJECTS = $(target)/head.o $(target)/misc.o

# files to compress
SYSTEM = $(objtree)/vmlinux.bin

all: $(target_compressed_dir)/vmlinuz

$(target)/decompress.bin: $(OBJECTS)
	$(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
	$(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin

# 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

$(target)/head.o: $(src)/head.S
	$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@

$(target)/misc.o: $(src)/misc.c
	$(CC) -D__KERNEL__ -c $< -o $@

# gzip the kernel image

piggy.img: $(SYSTEM)
	@cat $(SYSTEM) | gzip -f -9 > piggy.img

$(target):
	mkdir -p $(target)

clean:
	rm -f piggy.img $(objtree)/vmlinuz