1# 2# lx25/arch/cris/arch-v32/boot/compressed/Makefile 3# 4# create a compressed vmlinux image from the original vmlinux files and romfs 5# 6 7target = $(target_compressed_dir) 8src = $(src_compressed_dir) 9 10CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include 11CFLAGS = -O2 12LD = gcc-cris -mlinux -march=v32 -nostdlib 13OBJCOPY = objcopy-cris 14OBJCOPYFLAGS = -O binary --remove-section=.bss 15OBJECTS = $(target)/head.o $(target)/misc.o 16 17# files to compress 18SYSTEM = $(objtree)/vmlinux.bin 19 20all: vmlinuz 21 22$(target)/decompress.bin: $(OBJECTS) 23 $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS) 24 $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin 25 26$(objtree)/vmlinuz: $(target) piggy.img $(target)/decompress.bin 27 cat $(target)/decompress.bin piggy.img > $(objtree)/vmlinuz 28 rm -f piggy.img 29 cp $(objtree)/vmlinuz $(src) 30 31$(target)/head.o: $(src)/head.S 32 $(CC) -D__ASSEMBLY__ -c $< -o $@ 33 34# gzip the kernel image 35 36piggy.img: $(SYSTEM) 37 cat $(SYSTEM) | gzip -f -9 > piggy.img 38 39clean: 40 rm -f piggy.img $(objtree)/vmlinuz vmlinuz.o decompress.o decompress.bin $(OBJECTS) 41