Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # |
| 2 | # linux/arch/sh/boot/compressed/Makefile |
| 3 | # |
| 4 | # create a compressed vmlinux image from the original vmlinux |
| 5 | # |
| 6 | |
| 7 | targets := vmlinux vmlinux.bin vmlinux.bin.gz head.o misc.o piggy.o |
| 8 | EXTRA_AFLAGS := -traditional |
| 9 | |
| 10 | OBJECTS = $(obj)/head.o $(obj)/misc.o |
| 11 | |
| 12 | ifdef CONFIG_SH_STANDARD_BIOS |
| 13 | OBJECTS += $(obj)/../../kernel/sh_bios.o |
| 14 | endif |
| 15 | |
| 16 | # |
| 17 | # IMAGE_OFFSET is the load offset of the compression loader |
| 18 | # Assign dummy values if these 2 variables are not defined, |
| 19 | # in order to suppress error message. |
| 20 | # |
Paul Mundt | e7f93a3 | 2006-09-27 17:19:13 +0900 | [diff] [blame] | 21 | CONFIG_PAGE_OFFSET ?= 0x80000000 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | CONFIG_MEMORY_START ?= 0x0c000000 |
| 23 | CONFIG_BOOT_LINK_OFFSET ?= 0x00800000 |
Yoshinori Sato | e96636c | 2006-09-27 17:21:02 +0900 | [diff] [blame] | 24 | |
Yoshinori Sato | a2d1a5f | 2006-09-27 17:25:07 +0900 | [diff] [blame] | 25 | IMAGE_OFFSET := $(shell printf "0x%08x" $$[$(CONFIG_PAGE_OFFSET) + \ |
| 26 | $(CONFIG_MEMORY_START) + \ |
| 27 | $(CONFIG_BOOT_LINK_OFFSET)]) |
Yoshinori Sato | e96636c | 2006-09-27 17:21:02 +0900 | [diff] [blame] | 28 | |
| 29 | LIBGCC := $(shell $(CC) $(CFLAGS) -print-libgcc-file-name) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | LDFLAGS_vmlinux := -Ttext $(IMAGE_OFFSET) -e startup -T $(obj)/../../kernel/vmlinux.lds |
| 32 | |
Yoshinori Sato | e96636c | 2006-09-27 17:21:02 +0900 | [diff] [blame] | 33 | |
| 34 | $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o $(LIBGCC) FORCE |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | $(call if_changed,ld) |
| 36 | @: |
| 37 | |
| 38 | $(obj)/vmlinux.bin: vmlinux FORCE |
| 39 | $(call if_changed,objcopy) |
| 40 | |
| 41 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE |
| 42 | $(call if_changed,gzip) |
| 43 | |
| 44 | LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh-linux -T |
| 45 | OBJCOPYFLAGS += -R .empty_zero_page |
| 46 | |
| 47 | $(obj)/piggy.o: $(obj)/vmlinux.scr $(obj)/vmlinux.bin.gz FORCE |
| 48 | $(call if_changed,ld) |