Makefile 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. MKIMAGE := $(srctree)/scripts/mkuboot.sh
  11. #
  12. # Assign safe dummy values if these variables are not defined,
  13. # in order to suppress error message.
  14. #
  15. CONFIG_PAGE_OFFSET ?= 0x80000000
  16. CONFIG_MEMORY_START ?= 0x0c000000
  17. CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
  18. CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
  19. CONFIG_ENTRY_OFFSET ?= 0x00001000
  20. suffix-$(CONFIG_KERNEL_GZIP) := gz
  21. suffix-$(CONFIG_KERNEL_BZIP2) := bz2
  22. suffix-$(CONFIG_KERNEL_LZMA) := lzma
  23. targets := zImage vmlinux.srec uImage uImage.srec uImage.gz uImage.bz2 uImage.lzma
  24. extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma
  25. subdir- := compressed
  26. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  27. $(call if_changed,objcopy)
  28. @echo ' Kernel: $@ is ready'
  29. $(obj)/compressed/vmlinux: FORCE
  30. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  31. KERNEL_MEMORY := 0x00000000
  32. ifeq ($(CONFIG_PMB_FIXED),y)
  33. KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
  34. $$[$(CONFIG_MEMORY_START) & 0x1fffffff]')
  35. endif
  36. ifeq ($(CONFIG_29BIT),y)
  37. KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
  38. $$[$(CONFIG_MEMORY_START)]')
  39. endif
  40. KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
  41. $$[$(CONFIG_PAGE_OFFSET) + \
  42. $(KERNEL_MEMORY) + \
  43. $(CONFIG_ZERO_PAGE_OFFSET)]')
  44. KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
  45. $$[$(CONFIG_PAGE_OFFSET) + \
  46. $(KERNEL_MEMORY) + \
  47. $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
  48. quiet_cmd_uimage = UIMAGE $@
  49. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
  50. -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
  51. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  52. $(obj)/vmlinux.bin: vmlinux FORCE
  53. $(call if_changed,objcopy)
  54. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  55. $(call if_changed,gzip)
  56. $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
  57. $(call if_changed,bzip2)
  58. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  59. $(call if_changed,lzma)
  60. $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
  61. $(call if_changed,uimage,bzip2)
  62. $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
  63. $(call if_changed,uimage,gzip)
  64. $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
  65. $(call if_changed,uimage,lzma)
  66. OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
  67. $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
  68. $(call if_changed,objcopy)
  69. OBJCOPYFLAGS_uImage.srec := -I binary -O srec
  70. $(obj)/uImage.srec: $(obj)/uImage
  71. $(call if_changed,objcopy)
  72. $(obj)/uImage: $(obj)/uImage.$(suffix-y)
  73. @ln -sf $(notdir $<) $@
  74. @echo ' Image $@ is ready'
  75. export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
  76. CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET KERNEL_MEMORY suffix-y