Makefile 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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. targets += $(dtb-y)
  48. # Rule to build device tree blobs
  49. $(obj)/%.dtb: $(src)/dts/%.dts FORCE
  50. $(call if_changed_dep,dtc)
  51. $(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
  52. clean-files := *.dtb
  53. quiet_cmd_uimage = UIMAGE $@
  54. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
  55. -C none -a $(LOADADDR) -e $(STARTADDR) \
  56. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  57. ifeq ($(CONFIG_ZBOOT_ROM),y)
  58. $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  59. else
  60. $(obj)/uImage: LOADADDR=$(ZRELADDR)
  61. endif
  62. $(obj)/uImage: STARTADDR=$(LOADADDR)
  63. check_for_multiple_loadaddr = \
  64. if [ $(words $(LOADADDR)) -gt 1 ]; then \
  65. echo 'multiple load addresses: $(LOADADDR)'; \
  66. echo 'This is incompatible with uImages'; \
  67. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  68. false; \
  69. fi
  70. $(obj)/uImage: $(obj)/zImage FORCE
  71. @$(check_for_multiple_loadaddr)
  72. $(call if_changed,uimage)
  73. @echo ' Image $@ is ready'
  74. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  75. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  76. @:
  77. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  78. $(call if_changed,objcopy)
  79. @echo ' Kernel: $@ is ready'
  80. PHONY += initrd FORCE
  81. initrd:
  82. @test "$(INITRD_PHYS)" != "" || \
  83. (echo This machine does not support INITRD; exit -1)
  84. @test "$(INITRD)" != "" || \
  85. (echo You must specify INITRD; exit -1)
  86. install: $(obj)/Image
  87. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  88. $(obj)/Image System.map "$(INSTALL_PATH)"
  89. zinstall: $(obj)/zImage
  90. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  91. $(obj)/zImage System.map "$(INSTALL_PATH)"
  92. uinstall: $(obj)/uImage
  93. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  94. $(obj)/uImage System.map "$(INSTALL_PATH)"
  95. zi:
  96. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  97. $(obj)/zImage System.map "$(INSTALL_PATH)"
  98. i:
  99. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  100. $(obj)/Image System.map "$(INSTALL_PATH)"
  101. subdir- := bootp compressed