xref: /linux/arch/arm/boot/compressed/Makefile (revision a0f97e06a43cf524e616f09e6af3398e1e9c1c5b)
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
4773a59c1cSSAN Peopleifeq ($(CONFIG_ARCH_AT91RM9200),y)
4873a59c1cSSAN PeopleOBJS		+= head-at91rm9200.o
4973a59c1cSSAN Peopleendif
5073a59c1cSSAN People
511da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
52f12d0d7cSHyok S. Choiifeq ($(CONFIG_CPU_CP15),y)
531da177e4SLinus TorvaldsOBJS		+= big-endian.o
54f12d0d7cSHyok S. Choielse
55f12d0d7cSHyok S. Choi# The endian should be set by h/w design.
56f12d0d7cSHyok S. Choiendif
571da177e4SLinus Torvaldsendif
581da177e4SLinus Torvalds
591da177e4SLinus Torvalds#
601da177e4SLinus Torvalds# We now have a PIC decompressor implementation.  Decompressors running
611da177e4SLinus Torvalds# from RAM should not define ZTEXTADDR.  Decompressors running directly
621da177e4SLinus Torvalds# from ROM or Flash must define ZTEXTADDR (preferably via the config)
631da177e4SLinus Torvalds# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
641da177e4SLinus Torvaldsifeq ($(CONFIG_ZBOOT_ROM),y)
651da177e4SLinus TorvaldsZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
661da177e4SLinus TorvaldsZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
671da177e4SLinus Torvaldselse
681da177e4SLinus TorvaldsZTEXTADDR	:= 0
691da177e4SLinus TorvaldsZBSSADDR	:= ALIGN(4)
701da177e4SLinus Torvaldsendif
711da177e4SLinus Torvalds
721da177e4SLinus TorvaldsSEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
731da177e4SLinus Torvalds
744486b863SRussell Kingtargets       := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \
751da177e4SLinus Torvalds		 head.o misc.o $(OBJS)
7648da78bcSCatalin MarinasEXTRA_CFLAGS  := -fpic -fno-builtin
771da177e4SLinus TorvaldsEXTRA_AFLAGS  :=
781da177e4SLinus Torvalds
791da177e4SLinus Torvalds# Supply ZRELADDR, INITRD_PHYS and PARAMS_PHYS to the decompressor via
801da177e4SLinus Torvalds# linker symbols.  We only define initrd_phys and params_phys if the
811da177e4SLinus Torvalds# machine class defined the corresponding makefile variable.
821da177e4SLinus TorvaldsLDFLAGS_vmlinux := --defsym zreladdr=$(ZRELADDR)
831da177e4SLinus Torvaldsifneq ($(INITRD_PHYS),)
841da177e4SLinus TorvaldsLDFLAGS_vmlinux += --defsym initrd_phys=$(INITRD_PHYS)
851da177e4SLinus Torvaldsendif
861da177e4SLinus Torvaldsifneq ($(PARAMS_PHYS),)
871da177e4SLinus TorvaldsLDFLAGS_vmlinux += --defsym params_phys=$(PARAMS_PHYS)
881da177e4SLinus Torvaldsendif
891da177e4SLinus TorvaldsLDFLAGS_vmlinux += -p --no-undefined -X \
90*a0f97e06SSam Ravnborg	$(shell $(CC) $(KBUILD_CFLAGS) --print-libgcc-file-name) -T
911da177e4SLinus Torvalds
921da177e4SLinus Torvalds# Don't allow any static data in misc.o, which
931da177e4SLinus Torvalds# would otherwise mess up our GOT table
941da177e4SLinus TorvaldsCFLAGS_misc.o := -Dstatic=
951da177e4SLinus Torvalds
961da177e4SLinus Torvalds$(obj)/vmlinux: $(obj)/vmlinux.lds $(obj)/$(HEAD) $(obj)/piggy.o \
971da177e4SLinus Torvalds	 	$(addprefix $(obj)/, $(OBJS)) FORCE
981da177e4SLinus Torvalds	$(call if_changed,ld)
991da177e4SLinus Torvalds	@:
1001da177e4SLinus Torvalds
1011da177e4SLinus Torvalds$(obj)/piggy.gz: $(obj)/../Image FORCE
1021da177e4SLinus Torvalds	$(call if_changed,gzip)
1031da177e4SLinus Torvalds
1041da177e4SLinus Torvalds$(obj)/piggy.o:  $(obj)/piggy.gz FORCE
1051da177e4SLinus Torvalds
1064486b863SRussell KingCFLAGS_font.o := -Dstatic=
1074486b863SRussell King
1084486b863SRussell King$(obj)/font.c: $(FONTC)
1094486b863SRussell King	$(call cmd,shipped)
1101da177e4SLinus Torvalds
1111da177e4SLinus Torvalds$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
1121da177e4SLinus Torvalds	@sed "$(SEDFLAGS)" < $< > $@
1131da177e4SLinus Torvalds
1141da177e4SLinus Torvalds$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
1151da177e4SLinus Torvalds
116