Merge git://git.infradead.org/iommu-2.6
[pandora-kernel.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
7 AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
8 HEAD    = head.o
9 OBJS    = misc.o decompress.o
10 FONTC   = $(srctree)/drivers/video/console/font_acorn_8x8.c
11
12 #
13 # Architecture dependencies
14 #
15 ifeq ($(CONFIG_ARCH_ACORN),y)
16 OBJS            += ll_char_wr.o font.o
17 endif
18
19 ifeq ($(CONFIG_ARCH_SHARK),y)
20 OBJS            += head-shark.o ofw-shark.o
21 endif
22
23 ifeq ($(CONFIG_ARCH_P720T),y)
24 # Borrow this code from SA1100
25 OBJS            += head-sa1100.o
26 endif
27
28 ifeq ($(CONFIG_ARCH_SA1100),y)
29 OBJS            += head-sa1100.o
30 endif
31
32 ifeq ($(CONFIG_CPU_XSCALE),y)
33 OBJS            += head-xscale.o
34 endif
35
36 ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
37 OBJS            += head-sharpsl.o
38 endif
39
40 ifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
41 ifeq ($(CONFIG_CPU_CP15),y)
42 OBJS            += big-endian.o
43 else
44 # The endian should be set by h/w design.
45 endif
46 endif
47
48 #
49 # We now have a PIC decompressor implementation.  Decompressors running
50 # from RAM should not define ZTEXTADDR.  Decompressors running directly
51 # from ROM or Flash must define ZTEXTADDR (preferably via the config)
52 # FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
53 ifeq ($(CONFIG_ZBOOT_ROM),y)
54 ZTEXTADDR       := $(CONFIG_ZBOOT_ROM_TEXT)
55 ZBSSADDR        := $(CONFIG_ZBOOT_ROM_BSS)
56 else
57 ZTEXTADDR       := 0
58 ZBSSADDR        := ALIGN(4)
59 endif
60
61 SEDFLAGS        = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
62
63 suffix_$(CONFIG_KERNEL_GZIP) = gzip
64 suffix_$(CONFIG_KERNEL_LZO)  = lzo
65 suffix_$(CONFIG_KERNEL_LZMA) = lzma
66
67 targets       := vmlinux vmlinux.lds \
68                  piggy.$(suffix_y) piggy.$(suffix_y).o \
69                  font.o font.c head.o misc.o $(OBJS)
70
71 # Make sure files are removed during clean
72 extra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
73
74 ifeq ($(CONFIG_FUNCTION_TRACER),y)
75 ORIG_CFLAGS := $(KBUILD_CFLAGS)
76 KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
77 endif
78
79 EXTRA_CFLAGS  := -fpic -fno-builtin
80 EXTRA_AFLAGS  := -Wa,-march=all
81
82 ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
83 LDFLAGS_vmlinux += --be8
84 endif
85 # ?
86 LDFLAGS_vmlinux += -p
87 # Report unresolved symbol references
88 LDFLAGS_vmlinux += --no-undefined
89 # Delete all temporary local symbols
90 LDFLAGS_vmlinux += -X
91 # Next argument is a linker script
92 LDFLAGS_vmlinux += -T
93
94 # For __aeabi_uidivmod
95 lib1funcs = $(obj)/lib1funcs.o
96
97 $(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
98         $(call cmd,shipped)
99
100 $(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
101                 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
102         $(call if_changed,ld)
103         @:
104
105 $(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
106         $(call if_changed,$(suffix_y))
107
108 $(obj)/piggy.$(suffix_y).o:  $(obj)/piggy.$(suffix_y) FORCE
109
110 CFLAGS_font.o := -Dstatic=
111
112 $(obj)/font.c: $(FONTC)
113         $(call cmd,shipped)
114
115 $(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
116         @sed "$(SEDFLAGS)" < $< > $@