Commit 28bf739b authored by Jesper Nilsson's avatar Jesper Nilsson

CRIS v32: Update boot compressed Kbuild makefile.

- Remove old specific targets, use more generic ones instead.
- Use if_changed to avoid creating new images when no change.
- Use KBUILD_CFLAGS instead of CFLAGS.
parent 3d6f7871
# #
# lx25/arch/cris/arch-v32/boot/compressed/Makefile # arch/cris/arch-v32/boot/compressed/Makefile
# #
# create a compressed vmlinux image from the original vmlinux files and romfs
#
target = $(target_compressed_dir)
src = $(src_compressed_dir)
CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE) CC = gcc-cris -mlinux -march=v32 $(LINUXINCLUDE)
CFLAGS = -O2 AFLAGS += -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch
KBUILD_CFLAGS += -O2 -I $(srctree)/include/asm/mach/ -I $(srctree)/include/asm/arch
LD = gcc-cris -mlinux -march=v32 -nostdlib LD = gcc-cris -mlinux -march=v32 -nostdlib
LDFLAGS = -T $(obj)/decompress.ld
obj-y = head.o misc.o
OBJECTS = $(obj)/head.o $(obj)/misc.o
OBJCOPY = objcopy-cris OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss OBJCOPYFLAGS = -O binary --remove-section=.bss
OBJECTS = $(target)/head.o $(target)/misc.o
# files to compress
SYSTEM = $(objtree)/vmlinux.bin
all: vmlinuz
$(target)/decompress.bin: $(OBJECTS)
$(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
$(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
$(objtree)/vmlinuz: $(target) piggy.img $(target)/decompress.bin quiet_cmd_image = BUILD $@
cat $(target)/decompress.bin piggy.img > $(objtree)/vmlinuz cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
rm -f piggy.img
cp $(objtree)/vmlinuz $(src)
$(target)/head.o: $(src)/head.S targets := vmlinux piggy.gz decompress.o decompress.bin
$(CC) -D__ASSEMBLY__ -c $< -o $@
# gzip the kernel image $(obj)/decompress.o: $(OBJECTS) FORCE
$(call if_changed,ld)
piggy.img: $(SYSTEM) $(obj)/decompress.bin: $(obj)/decompress.o FORCE
cat $(SYSTEM) | gzip -f -9 > piggy.img $(call if_changed,objcopy)
clean: $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
rm -f piggy.img $(objtree)/vmlinuz vmlinuz.o decompress.o decompress.bin $(OBJECTS) $(call if_changed,image)
$(obj)/piggy.gz: $(obj)/../Image FORCE
$(call if_changed,gzip)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment