1# 2# linux/arch/sh/boot/compressed/Makefile 3# 4# create a compressed vmlinux image from the original vmlinux 5# 6 7targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o 8EXTRA_AFLAGS := -traditional 9 10OBJECTS = $(obj)/head.o $(obj)/misc.o 11 12ifdef CONFIG_SH_STANDARD_BIOS 13OBJECTS += $(obj)/../../kernel/sh_bios.o 14endif 15 16# 17# IMAGE_OFFSET is the load offset of the compression loader 18# 19IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_PAGE_OFFSET) + \ 20 $(CONFIG_MEMORY_START) + \ 21 $(CONFIG_BOOT_LINK_OFFSET)]) 22 23LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) 24 25LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds 26 27 28$(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE 29 $(call if_changed,ld) 30 @: 31 32$(obj)/vmlinux.bin: vmlinux FORCE 33 $(call if_changed,objcopy) 34 35$(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE 36 $(call if_changed,gzip) 37 38LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T 39OBJCOPYFLAGS += -R .empty_zero_page 40 41$(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE 42 $(call if_changed,ld) 43