Makefile 3.3 KB

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