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 71da177e4SLinus TorvaldsHEAD = head.o 81da177e4SLinus TorvaldsOBJS = misc.o 94486b863SRussell KingFONTC = $(srctree)/drivers/video/console/font_acorn_8x8.c 101da177e4SLinus Torvalds 111da177e4SLinus Torvalds# 121da177e4SLinus Torvalds# Architecture dependencies 131da177e4SLinus Torvalds# 141da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_ACORN),y) 154486b863SRussell KingOBJS += ll_char_wr.o font.o 161da177e4SLinus Torvaldsendif 171da177e4SLinus Torvalds 181da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SHARK),y) 191da177e4SLinus TorvaldsOBJS += head-shark.o ofw-shark.o 201da177e4SLinus Torvaldsendif 211da177e4SLinus Torvalds 221da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_L7200),y) 231da177e4SLinus TorvaldsOBJS += head-l7200.o 241da177e4SLinus Torvaldsendif 251da177e4SLinus Torvalds 261da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_CLPS7500),y) 271da177e4SLinus TorvaldsHEAD = head-clps7500.o 281da177e4SLinus Torvaldsendif 291da177e4SLinus Torvalds 301da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_P720T),y) 311da177e4SLinus Torvalds# Borrow this code from SA1100 321da177e4SLinus TorvaldsOBJS += head-sa1100.o 331da177e4SLinus Torvaldsendif 341da177e4SLinus Torvalds 351da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SA1100),y) 361da177e4SLinus TorvaldsOBJS += head-sa1100.o 371da177e4SLinus Torvaldsendif 381da177e4SLinus Torvalds 391da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_XSCALE),y) 401da177e4SLinus TorvaldsOBJS += head-xscale.o 411da177e4SLinus Torvaldsendif 421da177e4SLinus Torvalds 431da177e4SLinus Torvaldsifeq ($(CONFIG_PXA_SHARPSL),y) 441da177e4SLinus TorvaldsOBJS += head-sharpsl.o 451da177e4SLinus Torvaldsendif 461da177e4SLinus Torvalds 471da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_BIG_ENDIAN),y) 48f12d0d7cSHyok S. Choiifeq ($(CONFIG_CPU_CP15),y) 491da177e4SLinus TorvaldsOBJS += big-endian.o 50f12d0d7cSHyok S. Choielse 51f12d0d7cSHyok S. Choi# The endian should be set by h/w design. 52f12d0d7cSHyok S. Choiendif 531da177e4SLinus Torvaldsendif 541da177e4SLinus Torvalds 551da177e4SLinus Torvalds# 561da177e4SLinus Torvalds# We now have a PIC decompressor implementation. Decompressors running 571da177e4SLinus Torvalds# from RAM should not define ZTEXTADDR. Decompressors running directly 581da177e4SLinus Torvalds# from ROM or Flash must define ZTEXTADDR (preferably via the config) 591da177e4SLinus Torvalds# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK 601da177e4SLinus Torvaldsifeq ($(CONFIG_ZBOOT_ROM),y) 611da177e4SLinus TorvaldsZTEXTADDR := $(CONFIG_ZBOOT_ROM_TEXT) 621da177e4SLinus TorvaldsZBSSADDR := $(CONFIG_ZBOOT_ROM_BSS) 631da177e4SLinus Torvaldselse 641da177e4SLinus TorvaldsZTEXTADDR := 0 651da177e4SLinus TorvaldsZBSSADDR := ALIGN(4) 661da177e4SLinus Torvaldsendif 671da177e4SLinus Torvalds 681da177e4SLinus TorvaldsSEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ 691da177e4SLinus Torvalds 704486b863SRussell Kingtargets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \ 711da177e4SLinus Torvalds head.o misc.o $(OBJS) 72014c257cSAbhishek Sagar 73*606576ceSSteven Rostedtifeq ($(CONFIG_FUNCTION_TRACER),y) 74014c257cSAbhishek SagarORIG_CFLAGS := $(KBUILD_CFLAGS) 75014c257cSAbhishek SagarKBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) 76014c257cSAbhishek Sagarendif 77014c257cSAbhishek Sagar 7848da78bcSCatalin MarinasEXTRA_CFLAGS := -fpic -fno-builtin 7980cec14aSRussell KingEXTRA_AFLAGS := -Wa,-march=all 801da177e4SLinus Torvalds 811da177e4SLinus Torvalds# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via 821da177e4SLinus Torvalds# linker symbols. We only define initrd_phys and params_phys if the 831da177e4SLinus Torvalds# machine class defined the corresponding makefile variable. 841da177e4SLinus TorvaldsLDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR) 851da177e4SLinus Torvaldsifneq ($(INITRD_PHYS),) 861da177e4SLinus TorvaldsLDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS) 871da177e4SLinus Torvaldsendif 881da177e4SLinus Torvaldsifneq ($(PARAMS_PHYS),) 891da177e4SLinus TorvaldsLDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS) 901da177e4SLinus Torvaldsendif 911da177e4SLinus TorvaldsLDFLAGS_vmlinux += -p --no-undefined -X \ 92a0f97e06SSam Ravnborg $(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T 931da177e4SLinus Torvalds 941da177e4SLinus Torvalds# Don't allow any static data in misc.o, which 951da177e4SLinus Torvalds# would otherwise mess up our GOT table 961da177e4SLinus TorvaldsCFLAGS_misc.o := -Dstatic= 971da177e4SLinus Torvalds 981da177e4SLinus Torvalds$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \ 991da177e4SLinus Torvalds $(addprefix $(obj)/, $(OBJS)) FORCE 1001da177e4SLinus Torvalds $(call if_changed,ld) 1011da177e4SLinus Torvalds @: 1021da177e4SLinus Torvalds 1031da177e4SLinus Torvalds$(obj)/piggy.gz: $(obj)/../Image FORCE 1041da177e4SLinus Torvalds $(call if_changed,gzip) 1051da177e4SLinus Torvalds 1061da177e4SLinus Torvalds$(obj)/piggy.o: $(obj)/piggy.gz FORCE 1071da177e4SLinus Torvalds 1084486b863SRussell KingCFLAGS_font.o := -Dstatic= 1094486b863SRussell King 1104486b863SRussell King$(obj)/font.c: $(FONTC) 1114486b863SRussell King $(call cmd,shipped) 1121da177e4SLinus Torvalds 1131da177e4SLinus Torvalds$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config 1141da177e4SLinus Torvalds @sed "$(SEDFLAGS)" < $< > $@ 115