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