diff options
Diffstat (limited to 'arch/cris/arch-v10/boot/compressed/Makefile')
-rw-r--r-- | arch/cris/arch-v10/boot/compressed/Makefile | 48 |
1 files changed, 19 insertions, 29 deletions
diff --git a/arch/cris/arch-v10/boot/compressed/Makefile b/arch/cris/arch-v10/boot/compressed/Makefile index 6584a44820f4..4a031cb27eb9 100644 --- a/arch/cris/arch-v10/boot/compressed/Makefile +++ b/arch/cris/arch-v10/boot/compressed/Makefile | |||
@@ -1,45 +1,35 @@ | |||
1 | # | 1 | # |
2 | # create a compressed vmlinuz image from the binary vmlinux.bin file | 2 | # arch/cris/arch-v10/boot/compressed/Makefile |
3 | # | 3 | # |
4 | target = $(target_compressed_dir) | ||
5 | src = $(src_compressed_dir) | ||
6 | 4 | ||
7 | CC = gcc-cris -melf $(LINUXINCLUDE) | 5 | CC = gcc-cris -melf $(LINUXINCLUDE) |
8 | CFLAGS = -O2 | 6 | ccflags-y += -O2 |
9 | LD = ld-cris | 7 | LD = ld-cris |
8 | ldflags-y += -T $(obj)/decompress.ld | ||
9 | OBJECTS = $(obj)/head.o $(obj)/misc.o | ||
10 | OBJCOPY = objcopy-cris | 10 | OBJCOPY = objcopy-cris |
11 | OBJCOPYFLAGS = -O binary --remove-section=.bss | 11 | OBJCOPYFLAGS = -O binary --remove-section=.bss |
12 | OBJECTS = $(target)/head.o $(target)/misc.o | ||
13 | 12 | ||
14 | # files to compress | 13 | quiet_cmd_image = BUILD $@ |
15 | SYSTEM = $(objtree)/vmlinux.bin | 14 | cmd_image = cat $(obj)/decompress.bin $(obj)/piggy.gz > $@ |
16 | 15 | ||
17 | all: $(target_compressed_dir)/vmlinuz | 16 | targets := vmlinux piggy.gz decompress.o decompress.bin |
18 | 17 | ||
19 | $(target)/decompress.bin: $(OBJECTS) | 18 | $(obj)/decompress.o: $(OBJECTS) FORCE |
20 | $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS) | 19 | $(call if_changed,ld) |
21 | $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin | ||
22 | 20 | ||
23 | # Create vmlinuz image in top-level build directory | 21 | $(obj)/decompress.bin: $(obj)/decompress.o FORCE |
24 | $(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin | 22 | $(call if_changed,objcopy) |
25 | @echo " COMPR vmlinux.bin --> vmlinuz" | ||
26 | @cat $(target)/decompress.bin piggy.img > $(target_compressed_dir)/vmlinuz | ||
27 | @rm -f piggy.img | ||
28 | 23 | ||
29 | $(target)/head.o: $(src)/head.S | 24 | $(obj)/head.o: $(obj)/head.S .config |
30 | $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@ | 25 | @$(CC) -D__ASSEMBLY__ -traditional -c $< -o $@ |
31 | 26 | ||
32 | $(target)/misc.o: $(src)/misc.c | 27 | $(obj)/misc.o: $(obj)/misc.c .config |
33 | $(CC) -D__KERNEL__ -c $< -o $@ | 28 | @$(CC) -D__KERNEL__ -c $< -o $@ |
34 | 29 | ||
35 | # gzip the kernel image | 30 | $(obj)/vmlinux: $(obj)/piggy.gz $(obj)/decompress.bin FORCE |
31 | $(call if_changed,image) | ||
36 | 32 | ||
37 | piggy.img: $(SYSTEM) | 33 | $(obj)/piggy.gz: $(obj)/../Image FORCE |
38 | @cat $(SYSTEM) | gzip -f -9 > piggy.img | 34 | $(call if_changed,gzip) |
39 | |||
40 | $(target): | ||
41 | mkdir -p $(target) | ||
42 | |||
43 | clean: | ||
44 | rm -f piggy.img $(objtree)/vmlinuz | ||
45 | 35 | ||