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. MKIMAGE := $(srctree)/scripts/mkuboot.sh
  14. ifneq ($(MACHINE),)
  15. include $(srctree)/$(MACHINE)/Makefile.boot
  16. endif
  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. ifeq ($(CONFIG_XIP_KERNEL),y)
  27. $(obj)/xipImage: vmlinux FORCE
  28. $(call if_changed,objcopy)
  29. @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
  30. $(obj)/Image $(obj)/zImage: FORCE
  31. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  32. @echo 'Only the xipImage target is available in this case'
  33. @false
  34. else
  35. $(obj)/xipImage: FORCE
  36. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  37. @false
  38. $(obj)/Image: vmlinux FORCE
  39. $(call if_changed,objcopy)
  40. @echo ' Kernel: $@ is ready'
  41. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  42. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  43. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  44. $(call if_changed,objcopy)
  45. @echo ' Kernel: $@ is ready'
  46. endif
  47. # Rule to build device tree blobs
  48. $(obj)/%.dtb: $(src)/dts/%.dts
  49. $(call cmd,dtc)
  50. $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
  51. clean-files := *.dtb
  52. quiet_cmd_uimage = UIMAGE $@
  53. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
  54. -C none -a $(LOADADDR) -e $(STARTADDR) \
  55. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  56. ifeq ($(CONFIG_ZBOOT_ROM),y)
  57. $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  58. else
  59. $(obj)/uImage: LOADADDR=$(ZRELADDR)
  60. endif
  61. $(obj)/uImage: STARTADDR=$(LOADADDR)
  62. check_for_multiple_loadaddr = \
  63. if [ $(words $(LOADADDR)) -gt 1 ]; then \
  64. echo 'multiple load addresses: $(LOADADDR)'; \
  65. echo 'This is incompatible with uImages'; \
  66. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  67. false; \
  68. fi
  69. $(obj)/uImage: $(obj)/zImage FORCE
  70. @$(check_for_multiple_loadaddr)
  71. $(call if_changed,uimage)
  72. @echo ' Image $@ is ready'
  73. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  74. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  75. @:
  76. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  77. $(call if_changed,objcopy)
  78. @echo ' Kernel: $@ is ready'
  79. PHONY += initrd FORCE
  80. initrd:
  81. @test "$(INITRD_PHYS)" != "" || \
  82. (echo This machine does not support INITRD; exit -1)
  83. @test "$(INITRD)" != "" || \
  84. (echo You must specify INITRD; exit -1)
  85. install: $(obj)/Image
  86. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  87. $(obj)/Image System.map "$(INSTALL_PATH)"
  88. zinstall: $(obj)/zImage
  89. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  90. $(obj)/zImage System.map "$(INSTALL_PATH)"
  91. uinstall: $(obj)/uImage
  92. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  93. $(obj)/uImage System.map "$(INSTALL_PATH)"
  94. zi:
  95. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  96. $(obj)/zImage System.map "$(INSTALL_PATH)"
  97. i:
  98. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  99. $(obj)/Image System.map "$(INSTALL_PATH)"
  100. subdir- := bootp compressed