import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / cris / boot / compressed / Makefile
1 #
2 # linux/arch/etrax100/boot/compressed/Makefile
3 #
4 # create a compressed vmlinux image from the original vmlinux files and romfs
5 #
6
7 ifndef TOPDIR
8 TOPDIR = ../../../..
9 HPATH = $(TOPDIR)/include
10 export HPATH
11 endif
12
13
14 CC = gcc-cris -melf -I $(TOPDIR)/include
15 CFLAGS = -O2
16 LD = ld-cris
17 OBJCOPY = objcopy-cris
18
19 OBJECTS = head.o misc.o
20
21 # files to compress
22 SYSTEM = $(TOPDIR)/vmlinux.bin
23
24 all: vmlinuz
25
26 decompress.bin: $(OBJECTS)
27         $(LD) -T decompress.ld -o decompress.o $(OBJECTS)
28         $(OBJCOPY) -O binary --remove-section=.bss decompress.o decompress.bin
29 # save it for mkprod in the topdir.
30         cp decompress.bin $(TOPDIR)
31
32
33 vmlinuz: piggy.img decompress.bin
34         cat decompress.bin piggy.img > vmlinuz
35         rm -f piggy.img
36
37 head.o: head.S
38         $(CC) -D__ASSEMBLY__ -traditional -c head.S -o head.o
39
40 # gzip the kernel image
41
42 piggy.img: $(SYSTEM)
43         cat $(SYSTEM) | gzip -f -9 > piggy.img
44
45 clean:
46         rm -f piggy.img vmlinuz vmlinuz.o
47
48 depend:
49         $(CC) -M *.S *.c > .depend
50
51 -include .depend
52
53