diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2007-11-30 10:10:30 -0500 |
---|---|---|
committer | Jesper Nilsson <jesper.nilsson@axis.com> | 2008-02-08 05:06:25 -0500 |
commit | 1333a694836cb7e561b1b70d60ccceb8fabeead2 (patch) | |
tree | 6fbdfc5ba05a94b39d45c3158b6f406381ce029c /arch/cris/arch-v10/boot/compressed | |
parent | 87f5a7f7033ce4bbad082983332bbce43e849c84 (diff) |
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.
Diffstat (limited to 'arch/cris/arch-v10/boot/compressed')
-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..17ba271b226e 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 | EXTRA_CFLAGS = -O2 |
9 | LD = ld-cris | 7 | LD = ld-cris |
8 | LDFLAGS = -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 | ||