Makefile 3.1 KB

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