xref: /linux/arch/arm/boot/compressed/Makefile (revision f12d0d7c7786af39435ef6ae9defe47fb58f6091)
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
91da177e4SLinus TorvaldsFONTC	= drivers/video/console/font_acorn_8x8.c
101da177e4SLinus Torvalds
111da177e4SLinus TorvaldsFONT = $(addprefix ../../../../drivers/video/console/, font_acorn_8x8.o)
121da177e4SLinus Torvalds
131da177e4SLinus Torvalds#
141da177e4SLinus Torvalds# Architecture dependencies
151da177e4SLinus Torvalds#
161da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_ACORN),y)
171da177e4SLinus TorvaldsOBJS		+= ll_char_wr.o $(FONT)
181da177e4SLinus Torvaldsendif
191da177e4SLinus Torvalds
201da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SHARK),y)
211da177e4SLinus TorvaldsOBJS		+= head-shark.o ofw-shark.o
221da177e4SLinus Torvaldsendif
231da177e4SLinus Torvalds
241da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_L7200),y)
251da177e4SLinus TorvaldsOBJS		+= head-l7200.o
261da177e4SLinus Torvaldsendif
271da177e4SLinus Torvalds
281da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_CLPS7500),y)
291da177e4SLinus TorvaldsHEAD		= head-clps7500.o
301da177e4SLinus Torvaldsendif
311da177e4SLinus Torvalds
321da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_P720T),y)
331da177e4SLinus Torvalds# Borrow this code from SA1100
341da177e4SLinus TorvaldsOBJS		+= head-sa1100.o
351da177e4SLinus Torvaldsendif
361da177e4SLinus Torvalds
371da177e4SLinus Torvaldsifeq ($(CONFIG_ARCH_SA1100),y)
381da177e4SLinus TorvaldsOBJS		+= head-sa1100.o
391da177e4SLinus Torvaldsendif
401da177e4SLinus Torvalds
411da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_XSCALE),y)
421da177e4SLinus TorvaldsOBJS		+= head-xscale.o
431da177e4SLinus Torvaldsendif
441da177e4SLinus Torvalds
451da177e4SLinus Torvaldsifeq ($(CONFIG_PXA_SHARPSL),y)
461da177e4SLinus TorvaldsOBJS		+= head-sharpsl.o
471da177e4SLinus Torvaldsendif
481da177e4SLinus Torvalds
4973a59c1cSSAN Peopleifeq ($(CONFIG_ARCH_AT91RM9200),y)
5073a59c1cSSAN PeopleOBJS		+= head-at91rm9200.o
5173a59c1cSSAN Peopleendif
5273a59c1cSSAN People
531da177e4SLinus Torvaldsifeq ($(CONFIG_CPU_BIG_ENDIAN),y)
54*f12d0d7cSHyok S. Choiifeq ($(CONFIG_CPU_CP15),y)
551da177e4SLinus TorvaldsOBJS		+= big-endian.o
56*f12d0d7cSHyok S. Choielse
57*f12d0d7cSHyok S. Choi# The endian should be set by h/w design.
58*f12d0d7cSHyok S. Choiendif
591da177e4SLinus Torvaldsendif
601da177e4SLinus Torvalds
611da177e4SLinus Torvalds#
621da177e4SLinus Torvalds# We now have a PIC decompressor implementation.  Decompressors running
631da177e4SLinus Torvalds# from RAM should not define ZTEXTADDR.  Decompressors running directly
641da177e4SLinus Torvalds# from ROM or Flash must define ZTEXTADDR (preferably via the config)
651da177e4SLinus Torvalds# FIXME: Previous assignment to ztextaddr-y is lost here. See SHARK
661da177e4SLinus Torvaldsifeq ($(CONFIG_ZBOOT_ROM),y)
671da177e4SLinus TorvaldsZTEXTADDR	:= $(CONFIG_ZBOOT_ROM_TEXT)
681da177e4SLinus TorvaldsZBSSADDR	:= $(CONFIG_ZBOOT_ROM_BSS)
691da177e4SLinus Torvaldselse
701da177e4SLinus TorvaldsZTEXTADDR	:= 0
711da177e4SLinus TorvaldsZBSSADDR	:= ALIGN(4)
721da177e4SLinus Torvaldsendif
731da177e4SLinus Torvalds
741da177e4SLinus TorvaldsSEDFLAGS	= s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/
751da177e4SLinus Torvalds
761da177e4SLinus Torvaldstargets       := vmlinux vmlinux.lds piggy.gz piggy.o $(FONT) \
771da177e4SLinus Torvalds		 head.o misc.o $(OBJS)
781da177e4SLinus TorvaldsEXTRA_CFLAGS  := -fpic
791da177e4SLinus TorvaldsEXTRA_AFLAGS  :=
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 \
921da177e4SLinus Torvalds	$(shell $(CC) $(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
1081da177e4SLinus TorvaldsCFLAGS_font_acorn_8x8.o := -Dstatic=
1091da177e4SLinus Torvalds
1101da177e4SLinus Torvalds$(obj)/vmlinux.lds: $(obj)/vmlinux.lds.in arch/arm/boot/Makefile .config
1111da177e4SLinus Torvalds	@sed "$(SEDFLAGS)" < $< > $@
1121da177e4SLinus Torvalds
1131da177e4SLinus Torvalds$(obj)/misc.o: $(obj)/misc.c include/asm/arch/uncompress.h lib/inflate.c
1141da177e4SLinus Torvalds
115