Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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. ifeq ($(CONFIG_CRYPTO_FIPS_OLD_INTEGRITY_CHECK),y)
  14. MKFIPS := $(srctree)/scripts/mk_fipsbinary.sh
  15. endif
  16. ifneq ($(MACHINE),)
  17. include $(srctree)/$(MACHINE)/Makefile.boot
  18. endif
  19. # Note: the following conditions must always be true:
  20. # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
  21. # PARAMS_PHYS must be within 4MB of ZRELADDR
  22. # INITRD_PHYS must be in RAM
  23. ZRELADDR := $(zreladdr-y)
  24. PARAMS_PHYS := $(params_phys-y)
  25. INITRD_PHYS := $(initrd_phys-y)
  26. export ZRELADDR INITRD_PHYS PARAMS_PHYS
  27. targets := Image zImage xipImage bootpImage uImage
  28. DTB_NAMES := $(subst $\",,$(CONFIG_BUILD_ARM_APPENDED_DTB_IMAGE_NAMES))
  29. ifneq ($(DTB_NAMES),)
  30. DTB_LIST := $(addsuffix .dtb,$(DTB_NAMES))
  31. else
  32. DTB_LIST := $(dtb-y)
  33. endif
  34. DTB_OBJS := $(addprefix $(obj)/,$(DTB_LIST))
  35. ifeq ($(CONFIG_XIP_KERNEL),y)
  36. $(obj)/xipImage: vmlinux FORCE
  37. $(call if_changed,objcopy)
  38. @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
  39. $(obj)/Image $(obj)/zImage: FORCE
  40. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  41. @echo 'Only the xipImage target is available in this case'
  42. @false
  43. else
  44. $(obj)/xipImage: FORCE
  45. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  46. @false
  47. $(obj)/Image: vmlinux FORCE
  48. $(call if_changed,objcopy)
  49. @echo ' Kernel: $@ is ready'
  50. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  51. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  52. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  53. $(call if_changed,objcopy)
  54. ifeq ($(CONFIG_CRYPTO_FIPS_OLD_INTEGRITY_CHECK),y)
  55. $(MKFIPS) $(obj)/zImage
  56. endif
  57. @echo ' Kernel: $@ is ready'
  58. $(obj)/zImage-dtb: $(obj)/zImage $(DTB_OBJS) FORCE
  59. $(call if_changed,cat)
  60. @echo ' Kernel: $@ is ready'
  61. endif
  62. targets += $(DTB_LIST)
  63. # Rule to build device tree blobs
  64. ifeq ($(CONFIG_ARCH_MSM8226),y)
  65. $(obj)/%.dtb: $(src)/dts/msm8226/%.dts FORCE
  66. $(call if_changed_dep,dtc)
  67. endif
  68. ifeq ($(CONFIG_ARCH_MSM8610),y)
  69. $(obj)/%.dtb: $(src)/dts/msm8610/%.dts FORCE
  70. $(call if_changed_dep,dtc)
  71. endif
  72. ifeq ($(CONFIG_ARCH_MSM8974PRO),y)
  73. $(obj)/%.dtb: $(src)/dts/msm8974pro/%.dts FORCE
  74. $(call if_changed_dep,dtc)
  75. else
  76. $(obj)/%.dtb: $(src)/dts/msm8974/%.dts FORCE
  77. $(call if_changed_dep,dtc)
  78. endif
  79. $(obj)/dtbs: $(DTB_OBJS)
  80. clean-files := *.dtb
  81. ifneq ($(LOADADDR),)
  82. UIMAGE_LOADADDR=$(LOADADDR)
  83. else
  84. ifeq ($(CONFIG_ZBOOT_ROM),y)
  85. UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  86. else
  87. UIMAGE_LOADADDR=$(ZRELADDR)
  88. endif
  89. endif
  90. check_for_multiple_loadaddr = \
  91. if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \
  92. echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \
  93. echo 'This is incompatible with uImages'; \
  94. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  95. false; \
  96. fi
  97. $(obj)/uImage: $(obj)/zImage FORCE
  98. @$(check_for_multiple_loadaddr)
  99. $(call if_changed,uimage)
  100. @echo ' Image $@ is ready'
  101. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  102. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  103. @:
  104. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  105. $(call if_changed,objcopy)
  106. @echo ' Kernel: $@ is ready'
  107. PHONY += initrd FORCE
  108. initrd:
  109. @test "$(INITRD_PHYS)" != "" || \
  110. (echo This machine does not support INITRD; exit -1)
  111. @test "$(INITRD)" != "" || \
  112. (echo You must specify INITRD; exit -1)
  113. install: $(obj)/Image
  114. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  115. $(obj)/Image System.map "$(INSTALL_PATH)"
  116. zinstall: $(obj)/zImage
  117. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  118. $(obj)/zImage System.map "$(INSTALL_PATH)"
  119. uinstall: $(obj)/uImage
  120. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  121. $(obj)/uImage System.map "$(INSTALL_PATH)"
  122. zi:
  123. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  124. $(obj)/zImage System.map "$(INSTALL_PATH)"
  125. i:
  126. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  127. $(obj)/Image System.map "$(INSTALL_PATH)"
  128. subdir- := bootp compressed