1#
2# linux/arch/arm/boot/compressed/Makefile
3#
4# create a compressed vmlinuz image from the original vmlinux
5#
6# Note! SYSTEM, ZTEXTADDR, ZBSSADDR and ZRELADDR are now exported
7# from arch/arm/boot/Makefile
8#
9
10HEAD		 = head.o
11OBJS		 = misc.o
12CFLAGS		 = $(CPPFLAGS) -O2 -DSTDC_HEADERS $(CFLAGS_BOOT) -fpic -Uarm
13FONTC		 = $(TOPDIR)/drivers/video/font_acorn_8x8.c
14ZLDFLAGS	 = -p -X -T vmlinux.lds
15
16#
17# Architecture dependencies
18#
19ifeq ($(CONFIG_ARCH_ACORN),y)
20OBJS		+= ll_char_wr.o font.o
21CFLAGS		+= -DPARAMS_PHYS=$(PARAMS_PHYS)
22endif
23
24ifeq ($(CONFIG_ARCH_RISCSTATION),y)
25OBJS		+= ll_char_wr.o font.o
26CFLAGS		+= -DPARAMS_PHYS=$(PARAMS_PHYS)
27endif
28
29ifeq ($(CONFIG_ARCH_NETWINDER),y)
30OBJS		+= head-netwinder.o
31endif
32
33ifeq ($(CONFIG_ARCH_SHARK),y)
34OBJS		+= head-shark.o ofw-shark.o
35endif
36
37ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
38OBJS		+= head-integrator.o
39endif
40
41ifeq ($(CONFIG_ARCH_AT91RM9200),y)
42OBJS		+= head-at91rm9200.o
43endif
44
45ifeq ($(CONFIG_ARCH_MX1ADS),y)
46OBJS		+= head-mx1ads.o
47endif
48
49ifeq ($(CONFIG_ARCH_CAMELOT),y)
50OBJS		+= head-epxa10db.o
51endif
52
53ifeq ($(CONFIG_ARCH_FTVPCI),y)
54OBJS		+= head-ftvpci.o
55endif
56
57ifeq ($(CONFIG_ARCH_L7200),y)
58OBJS		+= head-l7200.o
59endif
60
61ifeq ($(CONFIG_ARCH_CLPS7500),y)
62HEAD		= head-clps7500.o
63endif
64
65ifeq ($(CONFIG_ARCH_P720T),y)
66# Borrow this code from SA1100
67OBJS		+= head-sa1100.o
68endif
69
70ifeq ($(CONFIG_ARCH_SA1100),y)
71OBJS		+= head-sa1100.o
72endif
73
74SEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;s/BSS_START/$(ZBSSADDR)/
75
76LIBGCC		:= $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
77
78all:		vmlinux
79
80vmlinux:	$(HEAD) $(OBJS) piggy.o vmlinux.lds
81		$(LD) $(ZLDFLAGS) $(HEAD) $(OBJS) piggy.o $(LIBGCC) -o vmlinux
82
83$(HEAD): 	$(HEAD:.o=.S) \
84			$(wildcard $(TOPDIR)/include/config/zboot/rom.h) \
85			$(wildcard $(TOPDIR)/include/config/cpu/32.h) \
86			$(wildcard $(TOPDIR)/include/config/cpu/26.h)
87		$(CC) $(AFLAGS) -traditional -c $(HEAD:.o=.S)
88
89piggy.o:	$(SYSTEM)
90		$(OBJCOPY) $(OBJCOPYFLAGS) $(SYSTEM) piggy
91		gzip $(GZFLAGS) < piggy > piggy.gz
92		$(LD) -r -o $@ -b binary piggy.gz
93		rm -f piggy piggy.gz
94
95font.o:		$(FONTC)
96		$(CC) $(CFLAGS) -Dstatic= -c -o $@ $(FONTC)
97
98vmlinux.lds:	vmlinux.lds.in Makefile $(TOPDIR)/arch/$(ARCH)/boot/Makefile $(TOPDIR)/.config
99		@sed "$(SEDFLAGS)" < vmlinux.lds.in > $@
100
101clean:;		rm -f vmlinux core piggy* vmlinux.lds
102
103.PHONY:	clean
104
105misc.o: misc.c $(TOPDIR)/include/asm/arch/uncompress.h $(TOPDIR)/lib/inflate.c
106
107%.o: %.S
108	$(CC) $(AFLAGS) $(EXTRA_AFLAGS) $(AFLAGS_$@) -c -o $@ $<
109