Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
  21. suffix-y := bin
  22. suffix-$(CONFIG_KERNEL_GZIP) := gz
  23. suffix-$(CONFIG_KERNEL_BZIP2) := bz2
  24. suffix-$(CONFIG_KERNEL_LZMA) := lzma
  25. suffix-$(CONFIG_KERNEL_XZ) := xz
  26. suffix-$(CONFIG_KERNEL_LZO) := lzo
  27. targets := zImage vmlinux.srec romImage uImage uImage.srec uImage.gz \
  28. uImage.bz2 uImage.lzma uImage.xz uImage.lzo uImage.bin
  29. extra-y += vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
  30. vmlinux.bin.xz vmlinux.bin.lzo
  31. subdir- := compressed romimage
  32. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  33. $(call if_changed,objcopy)
  34. @echo ' Kernel: $@ is ready'
  35. $(obj)/compressed/vmlinux: FORCE
  36. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  37. $(obj)/romImage: $(obj)/romimage/vmlinux FORCE
  38. $(call if_changed,objcopy)
  39. @echo ' Kernel: $@ is ready'
  40. $(obj)/romimage/vmlinux: $(obj)/zImage FORCE
  41. $(Q)$(MAKE) $(build)=$(obj)/romimage $@
  42. KERNEL_MEMORY := $(shell /bin/bash -c 'printf "0x%08x" \
  43. $$[$(CONFIG_PHYSICAL_START) & 0x1fffffff]')
  44. KERNEL_LOAD := $(shell /bin/bash -c 'printf "0x%08x" \
  45. $$[$(CONFIG_PAGE_OFFSET) + \
  46. $(KERNEL_MEMORY) + \
  47. $(CONFIG_ZERO_PAGE_OFFSET)]')
  48. KERNEL_ENTRY := $(shell /bin/bash -c 'printf "0x%08x" \
  49. $$[$(CONFIG_PAGE_OFFSET) + \
  50. $(KERNEL_MEMORY) + \
  51. $(CONFIG_ZERO_PAGE_OFFSET) + $(CONFIG_ENTRY_OFFSET)]')
  52. quiet_cmd_uimage = UIMAGE $@
  53. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A sh -O linux -T kernel \
  54. -C $(2) -a $(KERNEL_LOAD) -e $(KERNEL_ENTRY) \
  55. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  56. $(obj)/vmlinux.bin: vmlinux FORCE
  57. $(call if_changed,objcopy)
  58. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  59. $(call if_changed,gzip)
  60. $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
  61. $(call if_changed,bzip2)
  62. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  63. $(call if_changed,lzma)
  64. $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
  65. $(call if_changed,xzkern)
  66. $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
  67. $(call if_changed,lzo)
  68. $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
  69. $(call if_changed,uimage,bzip2)
  70. $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
  71. $(call if_changed,uimage,gzip)
  72. $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
  73. $(call if_changed,uimage,lzma)
  74. $(obj)/uImage.xz: $(obj)/vmlinux.bin.xz
  75. $(call if_changed,uimage,xz)
  76. $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo
  77. $(call if_changed,uimage,lzo)
  78. $(obj)/uImage.bin: $(obj)/vmlinux.bin
  79. $(call if_changed,uimage,none)
  80. OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
  81. $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
  82. $(call if_changed,objcopy)
  83. OBJCOPYFLAGS_uImage.srec := -I binary -O srec
  84. $(obj)/uImage.srec: $(obj)/uImage
  85. $(call if_changed,objcopy)
  86. $(obj)/uImage: $(obj)/uImage.$(suffix-y)
  87. @ln -sf $(notdir $<) $@
  88. @echo ' Image $@ is ready'
  89. export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
  90. CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
  91. KERNEL_MEMORY suffix-y