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 489a4af112SKuninori Morimotoifeq ($(CONFIG_ARCH_SHMOBILE),y) 499a4af112SKuninori MorimotoOBJS += head-shmobile.o 509a4af112SKuninori Morimotoendif 519a4af112SKuninori 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 86d239b1dcSNicolas Pitre# Provide size of uncompressed kernel to the decompressor via a linker symbol. 87*1cf7cf06SNicolas PitreLDFLAGS_vmlinux = --defsym _image_size=$(shell stat -c "%s" $(obj)/../Image) 889e84ed63SRussell King# Supply ZRELADDR to the decompressor via a linker symbol. 899e84ed63SRussell Kingifneq ($(CONFIG_AUTO_ZRELADDR),y) 90d239b1dcSNicolas PitreLDFLAGS_vmlinux += --defsym zreladdr=$(ZRELADDR) 919e84ed63SRussell Kingendif 9226584853SCatalin Marinasifeq ($(CONFIG_CPU_ENDIAN_BE8),y) 9326584853SCatalin MarinasLDFLAGS_vmlinux += --be8 9426584853SCatalin Marinasendif 95e7db7b42SAlbin Tonnerre# ? 96e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -p 97e7db7b42SAlbin Tonnerre# Report unresolved symbol references 98e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += --no-undefined 99e7db7b42SAlbin Tonnerre# Delete all temporary local symbols 100e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -X 101e7db7b42SAlbin Tonnerre# Next argument is a linker script 102e7db7b42SAlbin TonnerreLDFLAGS_vmlinux += -T 103e7db7b42SAlbin Tonnerre 104e7db7b42SAlbin Tonnerre# For __aeabi_uidivmod 105e7db7b42SAlbin Tonnerrelib1funcs = $(obj)/lib1funcs.o 106e7db7b42SAlbin Tonnerre 107e7db7b42SAlbin Tonnerre$(obj)/lib1funcs.S: $(srctree)/arch/$(SRCARCH)/lib/lib1funcs.S FORCE 108e7db7b42SAlbin Tonnerre $(call cmd,shipped) 1091da177e4SLinus Torvalds 110e7db7b42SAlbin Tonnerre$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.$(suffix_y).o \ 111e7db7b42SAlbin Tonnerre $(addprefix $(obj)/, $(OBJS)) $(lib1funcs) FORCE 1121da177e4SLinus Torvalds $(call if_changed,ld) 1131da177e4SLinus Torvalds @: 1141da177e4SLinus Torvalds 115e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y): $(obj)/../Image FORCE 116e7db7b42SAlbin Tonnerre $(call if_changed,$(suffix_y)) 1171da177e4SLinus Torvalds 118e7db7b42SAlbin Tonnerre$(obj)/piggy.$(suffix_y).o: $(obj)/piggy.$(suffix_y) FORCE 1191da177e4SLinus Torvalds 1204486b863SRussell KingCFLAGS_font.o := -Dstatic= 1214486b863SRussell King 1224486b863SRussell King$(obj)/font.c: $(FONTC) 1234486b863SRussell King $(call cmd,shipped) 1241da177e4SLinus Torvalds 125d93c333dSRussell King$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile $(KCONFIG_CONFIG) 1261da177e4SLinus Torvalds @sed "$(SEDFLAGS)" < $< > $@ 127