Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. #
  2. # arch/arm/boot/Makefile
  3. #
  4. # This file is included by the global makefile so that you can add your own
  5. # architecture-specific flags and dependencies.
  6. #
  7. # This file is subject to the terms and conditions of the GNU General Public
  8. # License. See the file "COPYING" in the main directory of this archive
  9. # for more details.
  10. #
  11. # Copyright (C) 1995-2002 Russell King
  12. #
  13. ifneq ($(MACHINE),)
  14. include $(srctree)/$(MACHINE)/Makefile.boot
  15. endif
  16. include $(srctree)/arch/arm/boot/dts/Makefile
  17. # Note: the following conditions must always be true:
  18. # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
  19. # PARAMS_PHYS must be within 4MB of ZRELADDR
  20. # INITRD_PHYS must be in RAM
  21. ZRELADDR := $(zreladdr-y)
  22. PARAMS_PHYS := $(params_phys-y)
  23. INITRD_PHYS := $(initrd_phys-y)
  24. export ZRELADDR INITRD_PHYS PARAMS_PHYS
  25. targets := Image zImage xipImage bootpImage uImage
  26. DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
  27. ifneq ($(DTB_NAMES),)
  28. DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
  29. else
  30. DTB_LIST := $(dtb-y)
  31. endif
  32. DTB_OBJS := $(addprefix $(obj)/dts/,$(DTB_LIST))
  33. ifeq ($(CONFIG_XIP_KERNEL),y)
  34. $(obj)/xipImage: vmlinux FORCE
  35. $(call if_changed,objcopy)
  36. @$(kecho) ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
  37. $(obj)/Image $(obj)/zImage: FORCE
  38. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  39. @echo 'Only the xipImage target is available in this case'
  40. @false
  41. else
  42. $(obj)/xipImage: FORCE
  43. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  44. @false
  45. $(obj)/Image: vmlinux FORCE
  46. $(call if_changed,objcopy)
  47. @$(kecho) ' Kernel: $@ is ready'
  48. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  49. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  50. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  51. $(call if_changed,objcopy)
  52. @$(kecho) ' Kernel: $@ is ready'
  53. $(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS) FORCE
  54. $(call if_changed,cat)
  55. @echo ' Kernel: $@ is ready'
  56. endif
  57. ifneq ($(LOADADDR),)
  58. UIMAGE_LOADADDR=$(LOADADDR)
  59. else
  60. ifeq ($(CONFIG_ZBOOT_ROM),y)
  61. UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  62. else
  63. UIMAGE_LOADADDR=$(ZRELADDR)
  64. endif
  65. endif
  66. check_for_multiple_loadaddr = \
  67. if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
  68. echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
  69. echo 'This is incompatible with uImages'; \
  70. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  71. false; \
  72. fi
  73. $(obj)/uImage: $(obj)/zImage FORCE
  74. @$(check_for_multiple_loadaddr)
  75. $(call if_changed,uimage)
  76. @$(kecho) ' Image $@ is ready'
  77. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  78. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  79. @:
  80. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  81. $(call if_changed,objcopy)
  82. @$(kecho) ' Kernel: $@ is ready'
  83. PHONY += initrd FORCE
  84. initrd:
  85. @test "$(INITRD_PHYS)" != "" || \
  86. (echo This machine does not support INITRD; exit -1)
  87. @test "$(INITRD)" != "" || \
  88. (echo You must specify INITRD; exit -1)
  89. install:
  90. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  91. $(obj)/Image System.map "$(INSTALL_PATH)"
  92. zinstall:
  93. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  94. $(obj)/zImage System.map "$(INSTALL_PATH)"
  95. uinstall:
  96. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  97. $(obj)/uImage System.map "$(INSTALL_PATH)"
  98. zi:
  99. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  100. $(obj)/zImage System.map "$(INSTALL_PATH)"
  101. i:
  102. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  103. $(obj)/Image System.map "$(INSTALL_PATH)"
  104. subdir- := bootp compressed dts