aboutsummaryrefslogtreecommitdiffstats
path: root/arch/cris/arch-v32/boot/compressed/Makefile
blob: 9f77eda914ba7448a9f38d515876566d0f338f29 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#
# lx25/arch/cris/arch-v32/boot/compressed/Makefile
#
# create a compressed vmlinux image from the original vmlinux files and romfs
#

target = $(target_compressed_dir)
src    = $(src_compressed_dir)

CC = gcc-cris -mlinux -march=v32 -I $(TOPDIR)/include
CFLAGS = -O2
LD = gcc-cris -mlinux -march=v32 -nostdlib
OBJCOPY = objcopy-cris
OBJCOPYFLAGS = -O binary --remove-section=.bss
OBJECTS = $(target)/head.o $(target)/misc.o

# files to compress
SYSTEM = $(objtree)/vmlinux.bin

all: vmlinuz

$(target)/decompress.bin: $(OBJECTS)
	$(LD) -T $(src)/decompress.ld -o $(target)/decompress.o $(OBJECTS)
	$(OBJCOPY) $(OBJCOPYFLAGS) $(target)/decompress.o $(target)/decompress.bin

$(objtree)/vmlinuz: $(target) piggy.img $(target)/decompress.bin
	cat $(target)/decompress.bin piggy.img > $(objtree)/vmlinuz
	rm -f piggy.img
	cp $(objtree)/vmlinuz $(src)

$(target)/head.o: $(src)/head.S
	$(CC) -D__ASSEMBLY__ -c $< -o $@

# gzip the kernel image

piggy.img: $(SYSTEM)
	cat $(SYSTEM) | gzip -f -9 > piggy.img

clean:
	rm -f piggy.img $(objtree)/vmlinuz vmlinuz.o decompress.o decompress.bin $(OBJECTS)