aboutsummaryrefslogtreecommitdiff
path: root/arch/cris/arch-v10/boot/compressed/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/cris/arch-v10/boot/compressed/Makefile')
-rw-r--r--arch/cris/arch-v10/boot/compressed/Makefile43
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 5f71c2c819e..6584a44820f 100644
--- a/arch/cris/arch-v10/boot/compressed/Makefile
+++ b/arch/cris/arch-v10/boot/compressed/Makefile
@@ -1,40 +1,45 @@
#
-# linux/arch/etrax100/boot/compressed/Makefile
-#
-# create a compressed vmlinux image from the original vmlinux files and romfs
+# create a compressed vmlinuz image from the binary vmlinux.bin file
#
+target = $(target_compressed_dir)
+src = $(src_compressed_dir)
-CC = gcc-cris -melf -I $(TOPDIR)/include
+CC = gcc-cris -melf $(LINUXINCLUDE)
CFLAGS = -O2
LD = ld-cris
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss
-OBJECTS = head.o misc.o
+OBJECTS = $(target)/head.o $(target)/misc.o
# files to compress
-SYSTEM = $(TOPDIR)/vmlinux.bin
+SYSTEM = $(objtree)/vmlinux.bin
-all: vmlinuz
+all: $(target_compressed_dir)/vmlinuz
-decompress.bin: $(OBJECTS)
- $(LD) -T decompress.ld -o decompress.o $(OBJECTS)
- $(OBJCOPY) $(OBJCOPYFLAGS) decompress.o decompress.bin
-# save it for mkprod in the topdir.
- cp decompress.bin $(TOPDIR)
+$(target)/decompress.bin: $(OBJECTS)
+ $(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
+ $(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin
+# Create vmlinuz image in top-level build directory
+$(target_compressed_dir)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
+ @echo " COMPR vmlinux.bin --> vmlinuz"
+ @cat $(target)/decompress.bin piggy.img > $(target_compressed_dir)/vmlinuz
+ @rm -f piggy.img
-vmlinuz: piggy.img decompress.bin
- cat decompress.bin piggy.img > vmlinuz
- rm -f piggy.img
+$(target)/head.o: $(src)/head.S
+ $(CC) -D__ASSEMBLY__ -traditional -c $< -o $@
-head.o: head.S
- $(CC) -D__ASSEMBLY__ -traditional -c head.S -o head.o
+$(target)/misc.o: $(src)/misc.c
+ $(CC) -D__KERNEL__ -c $< -o $@
# gzip the kernel image
piggy.img: $(SYSTEM)
- cat $(SYSTEM) | gzip -f -9 > piggy.img
+ @cat $(SYSTEM) | gzip -f -9 > piggy.img
+
+$(target):
+ mkdir -p $(target)
clean:
- rm -f piggy.img vmlinuz vmlinuz.o
+ rm -f piggy.img $(objtree)/vmlinuz