xref: /linux/arch/arm/boot/compressed/Makefile (revision d93c333dc867d04111c9dcebdbcaa9ae8b2d5c2d)
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
481da177e4SLinus Torvalds#
491da177e4SLinus Torvalds# We now have a PIC decompressor implementation.  Decompressors running
501da177e4SLinus Torvalds# from RAM should not define ZTEXTADDR.  Decompressors running directly
511da177e4SLinus Torvalds# from ROM or Flash must define ZTEXTADDR (preferably via the config)
521da177e4SLinus Torvalds# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
531da177e4SLinus Torvaldsifeq ($(CONFIG_ZBOOT_ROM),y)
541da177e4SLinus TorvaldsZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
551da177e4SLinus TorvaldsZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
561da177e4SLinus Torvaldselse
571da177e4SLinus TorvaldsZTEXTADDR	:= 0
581da177e4SLinus TorvaldsZBSSADDR	:= ALIGN(4)
591da177e4SLinus Torvaldsendif
601da177e4SLinus Torvalds
611da177e4SLinus TorvaldsSEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
621da177e4SLinus Torvalds
63e7db7b42SAlbin Tonnerresuffix_$(CONFIG_KERNEL_GZIP) = gzip
64e7db7b42SAlbin Tonnerresuffix_$(CONFIG_KERNEL_LZO)  = lzo
656e8699f7SAlbin Tonnerresuffix_$(CONFIG_KERNEL_LZMA) = lzma
66e7db7b42SAlbin Tonnerre
67e7db7b42SAlbin Tonnerretargets       := vmlinux vmlinux.lds \
68e7db7b42SAlbin Tonnerre		 piggy.$(suffix_y) piggy.$(suffix_y).o \
69e7db7b42SAlbin Tonnerre		 font.o font.c head.o misc.o $(OBJS)
70014c257cSAbhishek Sagar
71f1b957d3SMagnus Damm# Make sure files are removed during clean
72f1b957d3SMagnus Dammextra-y       += piggy.gzip piggy.lzo piggy.lzma lib1funcs.S
73f1b957d3SMagnus Damm
74606576ceSSteven Rostedtifeq ($(CONFIG_FUNCTION_TRACER),y)
75014c257cSAbhishek SagarORIG_CFLAGS := $(KBUILD_CFLAGS)
76014c257cSAbhishek SagarKBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
77014c257cSAbhishek Sagarendif
78014c257cSAbhishek Sagar
7948da78bcSCatalin MarinasEXTRA_CFLAGS  := -fpic -fno-builtin
8080cec14aSRussell KingEXTRA_AFLAGS  := -Wa,-march=all
811da177e4SLinus Torvalds
829e84ed63SRussell King# Supply ZRELADDR to the decompressor via a linker symbol.
839e84ed63SRussell Kingifneq ($(CONFIG_AUTO_ZRELADDR),y)
849e84ed63SRussell KingLDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
859e84ed63SRussell Kingendif
8626584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE8),y)
8726584853SCatalin MarinasLDFLAGS_vmlinux += --be8
8826584853SCatalin Marinasendif
89e7db7b42SAlbin Tonnerre# ?
90e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -p
91e7db7b42SAlbin Tonnerre# Report unresolved symbol references
92e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += --no-undefined
93e7db7b42SAlbin Tonnerre# Delete all temporary local symbols
94e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -X
95e7db7b42SAlbin Tonnerre# Next argument is a linker script
96e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -T
97e7db7b42SAlbin Tonnerre
98e7db7b42SAlbin Tonnerre# For __aeabi_uidivmod
99e7db7b42SAlbin Tonnerrelib1funcs = $(obj)/lib1funcs.o
100e7db7b42SAlbin Tonnerre
101e7db7b42SAlbin Tonnerre$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE
102e7db7b42SAlbin Tonnerre	$(call cmd,shipped)
1031da177e4SLinus Torvalds
104e7db7b42SAlbin Tonnerre$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \
105e7db7b42SAlbin Tonnerre	 	$(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE
1061da177e4SLinus Torvalds	$(call if_changed,ld)
1071da177e4SLinus Torvalds	@:
1081da177e4SLinus Torvalds
109e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE
110e7db7b42SAlbin Tonnerre	$(call if_changed,$(suffix_y))
1111da177e4SLinus Torvalds
112e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y).o:  $(obj)/piggy.$(suffix_y) FORCE
1131da177e4SLinus Torvalds
1144486b863SRussell KingCFLAGS_font.o := -Dstatic=
1154486b863SRussell King
1164486b863SRussell King$(obj)/font.c: $(FONTC)
1174486b863SRussell King	$(call cmd,shipped)
1181da177e4SLinus Torvalds
119*d93c333dSRussell King$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG)
1201da177e4SLinus Torvalds	@sed "$(SEDFLAGS)" < $< > $@
121