import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / arm / boot / compressed / Makefile
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
10 HEAD             = head.o
11 OBJS             = misc.o
12 CFLAGS           = $(CPPFLAGS) -O2 -DSTDC_HEADERS $(CFLAGS_BOOT) -fpic -Uarm
13 FONTC            = $(TOPDIR)/drivers/video/font_acorn_8x8.c
14 ZLDFLAGS         = -p -X -T vmlinux.lds
15
16 #
17 # Architecture dependencies
18 #
19 ifeq ($(CONFIG_ARCH_ACORN),y)
20 OBJS            += ll_char_wr.o font.o
21 CFLAGS          += -DPARAMS_PHYS=$(PARAMS_PHYS)
22 endif
23
24 ifeq ($(CONFIG_ARCH_RISCSTATION),y)
25 OBJS            += ll_char_wr.o font.o
26 CFLAGS          += -DPARAMS_PHYS=$(PARAMS_PHYS)
27 endif
28
29 ifeq ($(CONFIG_ARCH_NETWINDER),y)
30 OBJS            += head-netwinder.o
31 endif
32
33 ifeq ($(CONFIG_ARCH_SHARK),y)
34 OBJS            += head-shark.o ofw-shark.o
35 endif
36
37 ifeq ($(CONFIG_ARCH_INTEGRATOR),y)
38 OBJS            += head-integrator.o
39 endif
40
41 ifeq ($(CONFIG_ARCH_AT91RM9200),y)
42 OBJS            += head-at91rm9200.o
43 endif
44
45 ifeq ($(CONFIG_ARCH_MX1ADS),y)
46 OBJS            += head-mx1ads.o
47 endif
48
49 ifeq ($(CONFIG_ARCH_CAMELOT),y)
50 OBJS            += head-epxa10db.o
51 endif
52
53 ifeq ($(CONFIG_ARCH_FTVPCI),y)
54 OBJS            += head-ftvpci.o
55 endif
56
57 ifeq ($(CONFIG_ARCH_L7200),y)
58 OBJS            += head-l7200.o
59 endif
60
61 ifeq ($(CONFIG_ARCH_CLPS7500),y)
62 HEAD            = head-clps7500.o
63 endif
64
65 ifeq ($(CONFIG_ARCH_P720T),y)
66 # Borrow this code from SA1100
67 OBJS            += head-sa1100.o
68 endif
69
70 ifeq ($(CONFIG_ARCH_SA1100),y)
71 OBJS            += head-sa1100.o
72 endif
73
74 SEDFLAGS        = s/TEXT_START/$(ZTEXTADDR)/;s/LOAD_ADDR/$(ZRELADDR)/;s/BSS_START/$(ZBSSADDR)/
75
76 LIBGCC          := $(shell $(CC) $(CFLAGS) --print-libgcc-file-name)
77
78 all:            vmlinux
79
80 vmlinux:        $(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
89 piggy.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
95 font.o:         $(FONTC)
96                 $(CC) $(CFLAGS) -Dstatic= -c -o $@ $(FONTC)
97
98 vmlinux.lds:    vmlinux.lds.in Makefile $(TOPDIR)/arch/$(ARCH)/boot/Makefile $(TOPDIR)/.config
99                 @sed "$(SEDFLAGS)" < vmlinux.lds.in > $@
100
101 clean:;         rm -f vmlinux core piggy* vmlinux.lds
102
103 .PHONY: clean
104
105 misc.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 $@ $<