| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # | 
 | 2 | # arch/sh/boot/Makefile | 
 | 3 | # | 
 | 4 | # This file is subject to the terms and conditions of the GNU General Public | 
 | 5 | # License.  See the file "COPYING" in the main directory of this archive | 
 | 6 | # for more details. | 
 | 7 | # | 
 | 8 | # Copyright (C) 1999 Stuart Menefy | 
 | 9 | # | 
 | 10 |  | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 11 | MKIMAGE := $(srctree)/scripts/mkuboot.sh | 
 | 12 |  | 
 | 13 | # | 
 | 14 | # Assign safe dummy values if these variables are not defined, | 
 | 15 | # in order to suppress error message. | 
 | 16 | # | 
 | 17 | CONFIG_PAGE_OFFSET	?= 0x80000000 | 
 | 18 | CONFIG_MEMORY_START	?= 0x0c000000 | 
 | 19 | CONFIG_BOOT_LINK_OFFSET	?= 0x00800000 | 
 | 20 | CONFIG_ZERO_PAGE_OFFSET	?= 0x00001000 | 
| Paul Mundt | d27e085 | 2008-07-29 09:15:01 +0900 | [diff] [blame] | 21 | CONFIG_ENTRY_OFFSET	?= 0x00001000 | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 22 |  | 
 | 23 | export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \ | 
| Paul Mundt | d27e085 | 2008-07-29 09:15:01 +0900 | [diff] [blame] | 24 |        CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 25 |  | 
 | 26 | targets := zImage vmlinux.srec uImage uImage.srec | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | subdir- := compressed | 
 | 28 |  | 
 | 29 | $(obj)/zImage: $(obj)/compressed/vmlinux FORCE | 
 | 30 | 	$(call if_changed,objcopy) | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 31 | 	@echo '  Kernel: $@ is ready' | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 |  | 
 | 33 | $(obj)/compressed/vmlinux: FORCE | 
 | 34 | 	$(Q)$(MAKE) $(build)=$(obj)/compressed $@ | 
 | 35 |  | 
| Yoshihiro Shimoda | 2f47f44 | 2009-03-10 15:49:54 +0900 | [diff] [blame] | 36 | KERNEL_MEMORY := 0x00000000 | 
 | 37 | ifeq ($(CONFIG_PMB_FIXED),y) | 
 | 38 | KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \ | 
 | 39 | 		     $$[$(CONFIG_MEMORY_START) & 0x1fffffff]') | 
| Chris Smith | 664718a | 2008-09-05 16:24:13 +0900 | [diff] [blame] | 40 | endif | 
| Yoshihiro Shimoda | 2f47f44 | 2009-03-10 15:49:54 +0900 | [diff] [blame] | 41 | ifeq ($(CONFIG_29BIT),y) | 
 | 42 | KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \ | 
 | 43 | 		     $$[$(CONFIG_MEMORY_START)]') | 
 | 44 | endif | 
 | 45 |  | 
 | 46 | KERNEL_LOAD	:= $(shell /bin/bash -c 'printf "0x%08x" \ | 
 | 47 | 		     $$[$(CONFIG_PAGE_OFFSET)  + \ | 
 | 48 | 			$(KERNEL_MEMORY) + \ | 
 | 49 | 			$(CONFIG_ZERO_PAGE_OFFSET)]') | 
| Thomas Betker | 453ec9c | 2007-11-30 18:22:10 +0900 | [diff] [blame] | 50 |  | 
| Paul Mundt | 66b5bf4 | 2008-03-14 17:19:38 +0900 | [diff] [blame] | 51 | KERNEL_ENTRY	:= $(shell /bin/bash -c 'printf "0x%08x" \ | 
| Paul Mundt | 6fc5153 | 2007-12-17 16:08:49 +0900 | [diff] [blame] | 52 | 		     $$[$(CONFIG_PAGE_OFFSET)  + \ | 
| Yoshihiro Shimoda | 2f47f44 | 2009-03-10 15:49:54 +0900 | [diff] [blame] | 53 | 			$(KERNEL_MEMORY) + \ | 
| Yoshihiro Shimoda | 82cb1f6 | 2008-07-23 16:49:06 +0900 | [diff] [blame] | 54 | 			$(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]') | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 55 |  | 
 | 56 | quiet_cmd_uimage = UIMAGE  $@ | 
 | 57 |       cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \ | 
| Yoshihiro Shimoda | 26b63e9 | 2008-03-28 15:03:39 +0900 | [diff] [blame] | 58 | 		   -C gzip -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \ | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 59 | 		   -n 'Linux-$(KERNELRELEASE)' -d $< $@ | 
 | 60 |  | 
| Thomas Betker | 453ec9c | 2007-11-30 18:22:10 +0900 | [diff] [blame] | 61 | $(obj)/uImage: $(obj)/vmlinux.bin.gz FORCE | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 62 | 	$(call if_changed,uimage) | 
 | 63 | 	@echo '  Image $@ is ready' | 
 | 64 |  | 
| Thomas Betker | 453ec9c | 2007-11-30 18:22:10 +0900 | [diff] [blame] | 65 | $(obj)/vmlinux.bin: vmlinux FORCE | 
 | 66 | 	$(call if_changed,objcopy) | 
 | 67 |  | 
 | 68 | $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE | 
 | 69 | 	$(call if_changed,gzip) | 
 | 70 |  | 
| Paul Mundt | cf00e20 | 2006-12-07 17:00:32 +0900 | [diff] [blame] | 71 | OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec | 
 | 72 | $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux | 
 | 73 | 	$(call if_changed,objcopy) | 
 | 74 |  | 
 | 75 | OBJCOPYFLAGS_uImage.srec := -I binary -O srec | 
 | 76 | $(obj)/uImage.srec: $(obj)/uImage | 
 | 77 | 	$(call if_changed,objcopy) | 
 | 78 |  | 
| Thomas Betker | 453ec9c | 2007-11-30 18:22:10 +0900 | [diff] [blame] | 79 | clean-files	+= uImage uImage.srec vmlinux.srec \ | 
 | 80 | 		   vmlinux.bin vmlinux.bin.gz |