Makefile 3.3 KB

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