197a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato#
297a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato# linux/arch/sh/boot/compressed/Makefile
397a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato#
497a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato# create a compressed vmlinux image from the original vmlinux
597a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato#
697a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
797a572b3b877173e284c687be34d8ae81b826160Yoshinori Satotargets		:= vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o
86ae8f8b8c50f6929fa99a662f6636a63ba76f93ematt mooneyasflags-y	:= -traditional
997a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
1097a572b3b877173e284c687be34d8ae81b826160Yoshinori SatoOBJECTS = $(obj)/head.o $(obj)/misc.o
1197a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
1297a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato#
1397a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato# IMAGE_OFFSET is the load offset of the compression loader
1497a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato# Assign dummy values if these 2 variables are not defined,
1597a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato# in order to suppress error message.
1697a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato#
1797a572b3b877173e284c687be34d8ae81b826160Yoshinori SatoCONFIG_MEMORY_START     ?= 0x00400000
1886277d594926f3ae4f50ac0fcd9e2fa3cc28a774Yoshinori SatoCONFIG_BOOT_LINK_OFFSET ?= 0x00140000
1997a572b3b877173e284c687be34d8ae81b826160Yoshinori SatoIMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_MEMORY_START)+$(CONFIG_BOOT_LINK_OFFSET)])
2097a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
2186277d594926f3ae4f50ac0fcd9e2fa3cc28a774Yoshinori SatoLDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -estartup $(obj)/vmlinux.lds
2297a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
2397a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE
2497a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato	$(call if_changed,ld)
2597a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato	@:
2697a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
2797a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato$(obj)/vmlinux.bin: vmlinux FORCE
2897a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato	$(call if_changed,objcopy)
2997a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
3097a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
3197a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato	$(call if_changed,gzip)
3297a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
3397a572b3b877173e284c687be34d8ae81b826160Yoshinori SatoLDFLAGS_piggy.o := -r --format binary --oformat elf32-h8300 -T
3497a572b3b877173e284c687be34d8ae81b826160Yoshinori SatoOBJCOPYFLAGS := -O binary
3597a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato
3697a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE
3797a572b3b877173e284c687be34d8ae81b826160Yoshinori Sato	$(call if_changed,ld)
38