summaryrefslogtreecommitdiffstats
path: root/arch/arm/boot/compressed/Makefile
blob: e31e8b28810a991c55f2774cb0e4322aa2507f91 (plain)
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
42
43
44
45
46
47
48
#
# linux/arch/arm/boot/compressed/Makefile
#
# create a compressed vmlinuz image from the original vmlinux
#
# With this config, max compressed image size = 640k
# Uncompressed image size = 1.3M (text+data)

SYSTEM	=$(TOPDIR)/vmlinux
HEAD	=$(COMPRESSED_HEAD)
OBJS	=$(HEAD) misc.o $(COMPRESSED_EXTRA)
CFLAGS	=-O2 -DSTDC_HEADERS $(CFLAGS_PROC)
ARFLAGS =rc
FONTC	=$(TOPDIR)/drivers/video/font_acorn_8x8.c

ifeq ($(CONFIG_ARCH_ACORN),y)
OBJS	+= ll_char_wr.o font.o
endif

ifeq ($(NEW_LINKER),y)
BINFMT	:= elf32-littlearm
else
BINFMT	:= elf32-arm
endif


all:		vmlinux

vmlinux:	$(OBJS) piggy.o
		$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJS) piggy.o

$(HEAD): 	$(HEAD:.o=.S)
		$(CC) -traditional -DLOADADDR=$(ZRELADDR) -c $(HEAD:.o=.S)

piggy.o:	$(SYSTEM)
		tmppiggy=_tmp_$$$$piggy; \
		rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk; \
		$(OBJCOPY) $(SYSTEM) $$tmppiggy; \
		gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
		echo "SECTIONS { .data : { input_len = .; LONG(input_data_end - input_data) input_data = .; *(.data) input_data_end = .; }}" > $$tmppiggy.lnk; \
		$(LD) -r -o piggy.o -b binary $$tmppiggy.gz -b $(BINFMT) -T $$tmppiggy.lnk; \
		rm -f $$tmppiggy $$tmppiggy.gz $$tmppiggy.lnk;

font.o:		$(FONTC)
		$(CC) -Dstatic= -c -o $@ $(FONTC)

clean:;		rm -f vmlinux core