Makefile 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. #
  11. # Assign safe dummy values if these variables are not defined,
  12. # in order to suppress error message.
  13. #
  14. CONFIG_PAGE_OFFSET ?= 0x80000000
  15. CONFIG_MEMORY_START ?= 0x0c000000
  16. CONFIG_BOOT_LINK_OFFSET ?= 0x00800000
  17. CONFIG_ZERO_PAGE_OFFSET ?= 0x00001000
  18. CONFIG_ENTRY_OFFSET ?= 0x00001000
  19. CONFIG_PHYSICAL_START ?= $(CONFIG_MEMORY_START)
  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_PHYSICAL_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. UIMAGE_LOADADDR = $(KERNEL_LOAD)
  52. UIMAGE_ENTRYADDR = $(KERNEL_ENTRY)
  53. $(obj)/vmlinux.bin: vmlinux FORCE
  54. $(call if_changed,objcopy)
  55. $(obj)/vmlinux.bin.gz: $(obj)/vmlinux.bin FORCE
  56. $(call if_changed,gzip)
  57. $(obj)/vmlinux.bin.bz2: $(obj)/vmlinux.bin FORCE
  58. $(call if_changed,bzip2)
  59. $(obj)/vmlinux.bin.lzma: $(obj)/vmlinux.bin FORCE
  60. $(call if_changed,lzma)
  61. $(obj)/vmlinux.bin.xz: $(obj)/vmlinux.bin FORCE
  62. $(call if_changed,xzkern)
  63. $(obj)/vmlinux.bin.lzo: $(obj)/vmlinux.bin FORCE
  64. $(call if_changed,lzo)
  65. $(obj)/uImage.bz2: $(obj)/vmlinux.bin.bz2
  66. $(call if_changed,uimage,bzip2)
  67. $(obj)/uImage.gz: $(obj)/vmlinux.bin.gz
  68. $(call if_changed,uimage,gzip)
  69. $(obj)/uImage.lzma: $(obj)/vmlinux.bin.lzma
  70. $(call if_changed,uimage,lzma)
  71. $(obj)/uImage.xz: $(obj)/vmlinux.bin.xz
  72. $(call if_changed,uimage,xz)
  73. $(obj)/uImage.lzo: $(obj)/vmlinux.bin.lzo
  74. $(call if_changed,uimage,lzo)
  75. $(obj)/uImage.bin: $(obj)/vmlinux.bin
  76. $(call if_changed,uimage,none)
  77. OBJCOPYFLAGS_vmlinux.srec := -I binary -O srec
  78. $(obj)/vmlinux.srec: $(obj)/compressed/vmlinux
  79. $(call if_changed,objcopy)
  80. OBJCOPYFLAGS_uImage.srec := -I binary -O srec
  81. $(obj)/uImage.srec: $(obj)/uImage
  82. $(call if_changed,objcopy)
  83. $(obj)/uImage: $(obj)/uImage.$(suffix-y)
  84. @ln -sf $(notdir $<) $@
  85. @echo ' Image $@ is ready'
  86. export CONFIG_PAGE_OFFSET CONFIG_MEMORY_START CONFIG_BOOT_LINK_OFFSET \
  87. CONFIG_PHYSICAL_START CONFIG_ZERO_PAGE_OFFSET CONFIG_ENTRY_OFFSET \
  88. KERNEL_MEMORY suffix-y