CRIS v10: 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 EXTRA_CFLAGS instead of CFLAGS.
This commit is contained in:
parent
87f5a7f703
commit
1333a69483
@ -1,45 +1,35 @@
|
|||||||
#
|
#
|
||||||
# create a compressed vmlinuz image from the binary vmlinux.bin file
|
# arch/cris/arch-v10/boot/compressed/Makefile
|
||||||
#
|
#
|
||||||
target = $(target_compressed_dir)
|
|
||||||
src = $(src_compressed_dir)
|
|
||||||
|
|
||||||
CC = gcc-cris -melf $(LINUXINCLUDE)
|
CC = gcc-cris -melf $(LINUXINCLUDE)
|
||||||
CFLAGS = -O2
|
EXTRA_CFLAGS = -O2
|
||||||
LD = ld-cris
|
LD = ld-cris
|
||||||
|
LDFLAGS = -T $(obj)/decompress.ld
|
||||||
|
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
|
quiet_cmd_image = BUILD $@
|
||||||
SYSTEM = $(objtree)/vmlinux.bin
|
cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@
|
||||||
|
|
||||||
all: $(target_compressed_dir)/vmlinuz
|
targets := vmlinux piggy.gz decompress.o decompress.bin
|
||||||
|
|
||||||
$(target)/decompress.bin: $(OBJECTS)
|
$(obj)/decompress.o: $(OBJECTS) FORCE
|
||||||
$(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
|
$(call if_changed,ld)
|
||||||
$(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
|
|
||||||
|
|
||||||
# Create vmlinuz image in top-level build directory
|
$(obj)/decompress.bin: $(obj)/decompress.o FORCE
|
||||||
$(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
|
$(call if_changed,objcopy)
|
||||||
@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
|
$(obj)/head.o: $(obj)/head.S .config
|
||||||
$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
|
@$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
|
||||||
|
|
||||||
$(target)/misc.o: $(src)/misc.c
|
$(obj)/misc.o: $(obj)/misc.c .config
|
||||||
$(CC) -D__KERNEL__ -c $< -o $@
|
@$(CC) -D__KERNEL__ -c $< -o $@
|
||||||
|
|
||||||
# gzip the kernel image
|
$(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE
|
||||||
|
$(call if_changed,image)
|
||||||
|
|
||||||
piggy.img: $(SYSTEM)
|
$(obj)/piggy.gz: $(obj)/../Image FORCE
|
||||||
@cat $(SYSTEM) | gzip -f -9 > piggy.img
|
$(call if_changed,gzip)
|
||||||
|
|
||||||
$(target):
|
|
||||||
mkdir -p $(target)
|
|
||||||
|
|
||||||
clean:
|
|
||||||
rm -f piggy.img $(objtree)/vmlinuz
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user