blob: 78fe31a4f503a21fbcb9458652c3b710494375df [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# linux/arch/arm/boot/compressed/Makefile
3#
4# create a compressed vmlinuz image from the original vmlinux
5#
6
Eric Miaoe69edc792010-07-05 15:56:50 +02007AFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
Linus Torvalds1da177e2005-04-16 15:20:36 -07008HEAD = head.o
Russell King5de813b2010-02-25 12:14:40 +00009OBJS = misc.o decompress.o
Russell King4486b862007-06-03 18:54:42 +010010FONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c
Linus Torvalds1da177e2005-04-16 15:20:36 -070011
12#
13# Architecture dependencies
14#
15ifeq ($(CONFIG_ARCH_ACORN),y)
Russell King4486b862007-06-03 18:54:42 +010016OBJS += ll_char_wr.o font.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070017endif
18
19ifeq ($(CONFIG_ARCH_SHARK),y)
20OBJS += head-shark.o ofw-shark.o
21endif
22
Linus Torvalds1da177e2005-04-16 15:20:36 -070023ifeq ($(CONFIG_ARCH_P720T),y)
24# Borrow this code from SA1100
25OBJS += head-sa1100.o
26endif
27
28ifeq ($(CONFIG_ARCH_SA1100),y)
29OBJS += head-sa1100.o
30endif
31
Alexey Charkov21f47fb2010-12-23 13:11:21 +010032ifeq ($(CONFIG_ARCH_VT8500),y)
33OBJS += head-vt8500.o
34endif
35
Linus Torvalds1da177e2005-04-16 15:20:36 -070036ifeq ($(CONFIG_CPU_XSCALE),y)
37OBJS += head-xscale.o
38endif
39
Eric Miao9c3fca22010-06-23 09:27:32 +080040ifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
Linus Torvalds1da177e2005-04-16 15:20:36 -070041OBJS += head-sharpsl.o
42endif
43
Catalin Marinas26584852009-05-30 14:00:18 +010044ifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
Hyok S. Choif12d0d72006-09-26 17:36:37 +090045ifeq ($(CONFIG_CPU_CP15),y)
Linus Torvalds1da177e2005-04-16 15:20:36 -070046OBJS += big-endian.o
Hyok S. Choif12d0d72006-09-26 17:36:37 +090047else
48# The endian should be set by h/w design.
49endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070050endif
51
Kuninori Morimoto9a4af112010-12-01 07:45:00 +010052ifeq ($(CONFIG_ARCH_SHMOBILE),y)
53OBJS += head-shmobile.o
54endif
55
Linus Torvalds1da177e2005-04-16 15:20:36 -070056#
57# We now have a PIC decompressor implementation. Decompressors running
58# from RAM should not define ZTEXTADDR. Decompressors running directly
59# from ROM or Flash must define ZTEXTADDR (preferably via the config)
60# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
61ifeq ($(CONFIG_ZBOOT_ROM),y)
62ZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT)
63ZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS)
64else
65ZTEXTADDR := 0
66ZBSSADDR := ALIGN(4)
67endif
68
69SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
70
Albin Tonnerree7db7b42010-01-08 14:42:43 -080071suffix_$(CONFIG_KERNEL_GZIP) = gzip
72suffix_$(CONFIG_KERNEL_LZO) = lzo
Albin Tonnerre6e8699f2010-04-03 11:40:28 +010073suffix_$(CONFIG_KERNEL_LZMA) = lzma
Albin Tonnerree7db7b42010-01-08 14:42:43 -080074
75targets := vmlinux vmlinux.lds \
76 piggy.$(suffix_y) piggy.$(suffix_y).o \
77 font.o font.c head.o misc.o $(OBJS)
Abhishek Sagar014c2572008-05-31 14:23:50 +053078
Magnus Dammf1b957d2010-07-28 05:46:21 +010079# Make sure files are removed during clean
80extra-y += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
81
Steven Rostedt606576c2008-10-06 19:06:12 -040082ifeq ($(CONFIG_FUNCTION_TRACER),y)
Abhishek Sagar014c2572008-05-31 14:23:50 +053083ORIG_CFLAGS := $(KBUILD_CFLAGS)
84KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
85endif
86
Catalin Marinas48da78b2007-07-11 11:29:28 +010087EXTRA_CFLAGS := -fpic -fno-builtin
Russell King80cec142008-09-09 13:56:45 +010088EXTRA_AFLAGS := -Wa,-march=all
Linus Torvalds1da177e2005-04-16 15:20:36 -070089
Russell King9e84ed62010-09-09 22:39:41 +010090# Supply ZRELADDR to the decompressor via a linker symbol.
91ifneq ($(CONFIG_AUTO_ZRELADDR),y)
92LDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
93endif
Catalin Marinas26584852009-05-30 14:00:18 +010094ifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
95LDFLAGS_vmlinux += --be8
96endif
Albin Tonnerree7db7b42010-01-08 14:42:43 -080097# ?
98LDFLAGS_vmlinux += -p
99# Report unresolved symbol references
100LDFLAGS_vmlinux += --no-undefined
101# Delete all temporary local symbols
102LDFLAGS_vmlinux += -X
103# Next argument is a linker script
104LDFLAGS_vmlinux += -T
105
106# For __aeabi_uidivmod
107lib1funcs = $(obj)/lib1funcs.o
108
109$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
110 $(call cmd,shipped)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700111
Albin Tonnerree7db7b42010-01-08 14:42:43 -0800112$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
113 $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700114 $(call if_changed,ld)
115 @:
116
Albin Tonnerree7db7b42010-01-08 14:42:43 -0800117$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
118 $(call if_changed,$(suffix_y))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119
Albin Tonnerree7db7b42010-01-08 14:42:43 -0800120$(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE
Linus Torvalds1da177e2005-04-16 15:20:36 -0700121
Russell King4486b862007-06-03 18:54:42 +0100122CFLAGS_font.o := -Dstatic=
123
124$(obj)/font.c: $(FONTC)
125 $(call cmd,shipped)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700126
Russell Kingd93c3332010-09-19 16:16:58 +0100127$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700128 @sed "$(SEDFLAGS)" < $< > $@