xref: /linux/arch/arm/boot/compressed/Makefile (revision 9a4af112bd252be801a433fc3bef793b7b487c3c)
11da177e4SLinus Torvalds#
21da177e4SLinus Torvalds# linux/arch/arm/boot/compressed/Makefile
31da177e4SLinus Torvalds#
41da177e4SLinus Torvalds# create a compressed vmlinuz image from the original vmlinux
51da177e4SLinus Torvalds#
61da177e4SLinus Torvalds
7e69edc79SEric MiaoAFLAGS_head.o += -DTEXT_OFFSET=$(TEXT_OFFSET)
81da177e4SLinus TorvaldsHEAD	= head.o
95de813b6SRussell KingOBJS	= misc.o decompress.o
104486b863SRussell KingFONTC	= $(srctree)/drivers/video/console/font_acorn_8x8.c
111da177e4SLinus Torvalds
121da177e4SLinus Torvalds#
131da177e4SLinus Torvalds# Architecture dependencies
141da177e4SLinus Torvalds#
151da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_ACORN),y)
164486b863SRussell KingOBJS		+= ll_char_wr.o font.o
171da177e4SLinus Torvaldsendif
181da177e4SLinus Torvalds
191da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SHARK),y)
201da177e4SLinus TorvaldsOBJS		+= head-shark.o ofw-shark.o
211da177e4SLinus Torvaldsendif
221da177e4SLinus Torvalds
231da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_P720T),y)
241da177e4SLinus Torvalds# Borrow this code from SA1100
251da177e4SLinus TorvaldsOBJS		+= head-sa1100.o
261da177e4SLinus Torvaldsendif
271da177e4SLinus Torvalds
281da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SA1100),y)
291da177e4SLinus TorvaldsOBJS		+= head-sa1100.o
301da177e4SLinus Torvaldsendif
311da177e4SLinus Torvalds
321da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_XSCALE),y)
331da177e4SLinus TorvaldsOBJS		+= head-xscale.o
341da177e4SLinus Torvaldsendif
351da177e4SLinus Torvalds
369c3fca2eSEric Miaoifeq ($(CONFIG_PXA_SHARPSL_DETECT_MACH_ID),y)
371da177e4SLinus TorvaldsOBJS		+= head-sharpsl.o
381da177e4SLinus Torvaldsendif
391da177e4SLinus Torvalds
4026584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE32),y)
41f12d0d7cSHyok S. Choiifeq ($(CONFIG_CPU_CP15),y)
421da177e4SLinus TorvaldsOBJS		+= big-endian.o
43f12d0d7cSHyok S. Choielse
44f12d0d7cSHyok S. Choi# The endian should be set by h/w design.
45f12d0d7cSHyok S. Choiendif
461da177e4SLinus Torvaldsendif
471da177e4SLinus Torvalds
48*9a4af112SKuninori Morimotoifeq ($(CONFIG_ARCH_SHMOBILE),y)
49*9a4af112SKuninori MorimotoOBJS		+= head-shmobile.o
50*9a4af112SKuninori Morimotoendif
51*9a4af112SKuninori Morimoto
521da177e4SLinus Torvalds#
531da177e4SLinus Torvalds# We now have a PIC decompressor implementation.  Decompressors running
541da177e4SLinus Torvalds# from RAM should not define ZTEXTADDR.  Decompressors running directly
551da177e4SLinus Torvalds# from ROM or Flash must define ZTEXTADDR (preferably via the config)
561da177e4SLinus Torvalds# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
571da177e4SLinus Torvaldsifeq ($(CONFIG_ZBOOT_ROM),y)
581da177e4SLinus TorvaldsZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
591da177e4SLinus TorvaldsZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
601da177e4SLinus Torvaldselse
611da177e4SLinus TorvaldsZTEXTADDR	:= 0
621da177e4SLinus TorvaldsZBSSADDR	:= ALIGN(4)
631da177e4SLinus Torvaldsendif
641da177e4SLinus Torvalds
651da177e4SLinus TorvaldsSEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
661da177e4SLinus Torvalds
67e7db7b42SAlbin Tonnerresuffix_$(CONFIG_KERNEL_GZIP) = gzip
68e7db7b42SAlbin Tonnerresuffix_$(CONFIG_KERNEL_LZO)  = lzo
696e8699f7SAlbin Tonnerresuffix_$(CONFIG_KERNEL_LZMA) = lzma
70e7db7b42SAlbin Tonnerre
71e7db7b42SAlbin Tonnerretargets       := vmlinux vmlinux.lds \
72e7db7b42SAlbin Tonnerre		 piggy.$(suffix_y) piggy.$(suffix_y).o \
73e7db7b42SAlbin Tonnerre		 font.o font.c head.o misc.o $(OBJS)
74014c257cSAbhishek Sagar
75f1b957d3SMagnus Damm# Make sure files are removed during clean
76f1b957d3SMagnus Dammextra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
77f1b957d3SMagnus Damm
78606576ceSSteven Rostedtifeq ($(CONFIG_FUNCTION_TRACER),y)
79014c257cSAbhishek SagarORIG_CFLAGS := $(KBUILD_CFLAGS)
80014c257cSAbhishek SagarKBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
81014c257cSAbhishek Sagarendif
82014c257cSAbhishek Sagar
8348da78bcSCatalin MarinasEXTRA_CFLAGS  := -fpic -fno-builtin
8480cec14aSRussell KingEXTRA_AFLAGS  := -Wa,-march=all
851da177e4SLinus Torvalds
869e84ed63SRussell King# Supply ZRELADDR to the decompressor via a linker symbol.
879e84ed63SRussell Kingifneq ($(CONFIG_AUTO_ZRELADDR),y)
889e84ed63SRussell KingLDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
899e84ed63SRussell Kingendif
9026584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
9126584853SCatalin MarinasLDFLAGS_vmlinux += --be8
9226584853SCatalin Marinasendif
93e7db7b42SAlbin Tonnerre# ?
94e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -p
95e7db7b42SAlbin Tonnerre# Report unresolved symbol references
96e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += --no-undefined
97e7db7b42SAlbin Tonnerre# Delete all temporary local symbols
98e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -X
99e7db7b42SAlbin Tonnerre# Next argument is a linker script
100e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -T
101e7db7b42SAlbin Tonnerre
102e7db7b42SAlbin Tonnerre# For __aeabi_uidivmod
103e7db7b42SAlbin Tonnerrelib1funcs = $(obj)/lib1funcs.o
104e7db7b42SAlbin Tonnerre
105e7db7b42SAlbin Tonnerre$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
106e7db7b42SAlbin Tonnerre	$(call cmd,shipped)
1071da177e4SLinus Torvalds
108e7db7b42SAlbin Tonnerre$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
109e7db7b42SAlbin Tonnerre	 	$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
1101da177e4SLinus Torvalds	$(call if_changed,ld)
1111da177e4SLinus Torvalds	@:
1121da177e4SLinus Torvalds
113e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
114e7db7b42SAlbin Tonnerre	$(call if_changed,$(suffix_y))
1151da177e4SLinus Torvalds
116e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y).o:  $(obj)/piggy.$(suffix_y) FORCE
1171da177e4SLinus Torvalds
1184486b863SRussell KingCFLAGS_font.o := -Dstatic=
1194486b863SRussell King
1204486b863SRussell King$(obj)/font.c: $(FONTC)
1214486b863SRussell King	$(call cmd,shipped)
1221da177e4SLinus Torvalds
123d93c333dSRussell King$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG)
1241da177e4SLinus Torvalds	@sed "$(SEDFLAGS)" < $< > $@
125