xref: /linux/arch/sh/boot/compressed/Makefile (revision d4f7e513234019a005c4d33477189f2a4e53bb9c)
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 \
950cfa79dSPaul Mundt		   vmlinux.bin.xz vmlinux.bin.lzo \
1059f00296SPaul Mundt		   head_$(BITS).o misc.o piggy.o
111eca133cSPaul Mundt
1259f00296SPaul MundtOBJECTS = $(obj)/head_$(BITS).o $(obj)/misc.o $(obj)/cache.o
131eca133cSPaul Mundt
14*d4f7e513SChris SmithGCOV_PROFILE := n
15*d4f7e513SChris Smith
161eca133cSPaul Mundt#
171eca133cSPaul Mundt# IMAGE_OFFSET is the load offset of the compression loader
181eca133cSPaul Mundt#
199c3d9363SMatt Flemingifeq ($(CONFIG_32BIT),y)
209c3d9363SMatt FlemingIMAGE_OFFSET	:= $(shell /bin/bash -c 'printf "0x%08x" \
219c3d9363SMatt Fleming		     $$[$(CONFIG_MEMORY_START)  + \
229c3d9363SMatt Fleming			$(CONFIG_BOOT_LINK_OFFSET)]')
239c3d9363SMatt Flemingelse
241eca133cSPaul MundtIMAGE_OFFSET	:= $(shell /bin/bash -c 'printf "0x%08x" \
251eca133cSPaul Mundt		     $$[$(CONFIG_PAGE_OFFSET)  + \
261eca133cSPaul Mundt			$(KERNEL_MEMORY) + \
271eca133cSPaul Mundt			$(CONFIG_BOOT_LINK_OFFSET)]')
289c3d9363SMatt Flemingendif
291eca133cSPaul Mundt
301eca133cSPaul MundtLIBGCC	:= $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
311eca133cSPaul Mundt
32473d1cf4SPaul Mundtifeq ($(CONFIG_MCOUNT),y)
331eca133cSPaul MundtORIG_CFLAGS := $(KBUILD_CFLAGS)
341eca133cSPaul MundtKBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS))
351eca133cSPaul Mundtendif
361eca133cSPaul Mundt
371eca133cSPaul MundtLDFLAGS_vmlinux := --oformat $(ld-bfd) -Ttext $(IMAGE_OFFSET) -e startup \
381eca133cSPaul Mundt		   -T $(obj)/../../kernel/vmlinux.lds
391eca133cSPaul Mundt
401eca133cSPaul Mundt$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE
411eca133cSPaul Mundt	$(call if_changed,ld)
421eca133cSPaul Mundt	@:
431eca133cSPaul Mundt
441eca133cSPaul Mundt$(obj)/vmlinux.bin: vmlinux FORCE
451eca133cSPaul Mundt	$(call if_changed,objcopy)
461eca133cSPaul Mundt
4707e88e1bSPaul Mundtvmlinux.bin.all-y := $(obj)/vmlinux.bin
4807e88e1bSPaul Mundt
4907e88e1bSPaul Mundt$(obj)/vmlinux.bin.gz: $(vmlinux.bin.all-y) FORCE
501eca133cSPaul Mundt	$(call if_changed,gzip)
5107e88e1bSPaul Mundt$(obj)/vmlinux.bin.bz2: $(vmlinux.bin.all-y) FORCE
5207e88e1bSPaul Mundt	$(call if_changed,bzip2)
5307e88e1bSPaul Mundt$(obj)/vmlinux.bin.lzma: $(vmlinux.bin.all-y) FORCE
5407e88e1bSPaul Mundt	$(call if_changed,lzma)
5550cfa79dSPaul Mundt$(obj)/vmlinux.bin.xz: $(vmlinux.bin.all-y) FORCE
5650cfa79dSPaul Mundt	$(call if_changed,xzkern)
57c7b16efbSPaul Mundt$(obj)/vmlinux.bin.lzo: $(vmlinux.bin.all-y) FORCE
58c7b16efbSPaul Mundt	$(call if_changed,lzo)
5907e88e1bSPaul Mundt
601eca133cSPaul MundtOBJCOPYFLAGS += -R .empty_zero_page
611eca133cSPaul Mundt
6207e88e1bSPaul MundtLDFLAGS_piggy.o := -r --format binary --oformat $(ld-bfd) -T
6307e88e1bSPaul Mundt
6407e88e1bSPaul Mundt$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.$(suffix-y) FORCE
6507e88e1bSPaul Mundt	$(call if_changed,ld)
66