xref: /linux/arch/sh/boot/compressed/Makefile (revision 59f002964f4e6668a0132cd796b82f7f8a4803f0)
11eca133cSPaul Mundt#
21eca133cSPaul Mundt# linux/arch/sh/boot/compressed/Makefile
31eca133cSPaul Mundt#
41eca133cSPaul Mundt# create a compressed vmlinux image from the original vmlinux
51eca133cSPaul Mundt#
61eca133cSPaul Mundt
71eca133cSPaul Mundttargets		:= vmlinux vmlinux.bin vmlinux.bin.gz \
807e88e1bSPaul Mundt		   vmlinux.bin.bz2 vmlinux.bin.lzma \
9*59f00296SPaul Mundt		   head_$(BITS).o misc.o piggy.o
101eca133cSPaul Mundt
11*59f00296SPaul MundtOBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
121eca133cSPaul Mundt
131eca133cSPaul Mundtifdef CONFIG_SH_STANDARD_BIOS
141eca133cSPaul MundtOBJECTS += $(obj)/../../kernel/sh_bios.o
151eca133cSPaul Mundtendif
161eca133cSPaul Mundt
171eca133cSPaul Mundt#
181eca133cSPaul Mundt# IMAGE_OFFSET is the load offset of the compression loader
191eca133cSPaul Mundt#
201eca133cSPaul MundtIMAGE_OFFSET	:= $(shell /bin/bash -c 'printf "0x%08x" \
211eca133cSPaul Mundt		     $$[$(CONFIG_PAGE_OFFSET)  + \
221eca133cSPaul Mundt			$(KERNEL_MEMORY) + \
231eca133cSPaul Mundt			$(CONFIG_BOOT_LINK_OFFSET)]')
241eca133cSPaul Mundt
251eca133cSPaul MundtLIBGCC	:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
261eca133cSPaul Mundt
271eca133cSPaul Mundtifeq ($(CONFIG_FUNCTION_TRACER),y)
281eca133cSPaul MundtORIG_CFLAGS := $(KBUILD_CFLAGS)
291eca133cSPaul MundtKBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
301eca133cSPaul Mundtendif
311eca133cSPaul Mundt
321eca133cSPaul MundtLDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
331eca133cSPaul Mundt		   -T $(obj)/../../kernel/vmlinux.lds
341eca133cSPaul Mundt
351eca133cSPaul Mundt$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
361eca133cSPaul Mundt	$(call if_changed,ld)
371eca133cSPaul Mundt	@:
381eca133cSPaul Mundt
391eca133cSPaul Mundt$(obj)/vmlinux.bin: vmlinux FORCE
401eca133cSPaul Mundt	$(call if_changed,objcopy)
411eca133cSPaul Mundt
4207e88e1bSPaul Mundtvmlinux.bin.all-y := $(obj)/vmlinux.bin
4307e88e1bSPaul Mundt
4407e88e1bSPaul Mundt$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
451eca133cSPaul Mundt	$(call if_changed,gzip)
4607e88e1bSPaul Mundt$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
4707e88e1bSPaul Mundt	$(call if_changed,bzip2)
4807e88e1bSPaul Mundt$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
4907e88e1bSPaul Mundt	$(call if_changed,lzma)
5007e88e1bSPaul Mundt
5107e88e1bSPaul Mundtsuffix-$(CONFIG_KERNEL_GZIP)	:= gz
5207e88e1bSPaul Mundtsuffix-$(CONFIG_KERNEL_BZIP2)	:= bz2
5307e88e1bSPaul Mundtsuffix-$(CONFIG_KERNEL_LZMA)	:= lzma
541eca133cSPaul Mundt
551eca133cSPaul MundtOBJCOPYFLAGS += -R .empty_zero_page
561eca133cSPaul Mundt
5707e88e1bSPaul MundtLDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
5807e88e1bSPaul Mundt
5907e88e1bSPaul Mundt$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
6007e88e1bSPaul Mundt	$(call if_changed,ld)
61