Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. @$(kecho) ' 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. @$(kecho) ' 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. @$(kecho) ' Kernel: $@ is ready'
  45. endif
  46. ifneq ($(LOADADDR),)
  47. UIMAGE_LOADADDR=$(LOADADDR)
  48. else
  49. ifeq ($(CONFIG_ZBOOT_ROM),y)
  50. UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  51. else
  52. UIMAGE_LOADADDR=$(ZRELADDR)
  53. endif
  54. endif
  55. check_for_multiple_loadaddr = \
  56. if [ $(words $(UIMAGE_LOADADDR)) -gt 1 ]; then \
  57. echo 'multiple load addresses: $(UIMAGE_LOADADDR)'; \
  58. echo 'This is incompatible with uImages'; \
  59. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  60. false; \
  61. fi
  62. $(obj)/uImage: $(obj)/zImage FORCE
  63. @$(check_for_multiple_loadaddr)
  64. $(call if_changed,uimage)
  65. @$(kecho) ' Image $@ is ready'
  66. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  67. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  68. @:
  69. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  70. $(call if_changed,objcopy)
  71. @$(kecho) ' Kernel: $@ is ready'
  72. PHONY += initrd FORCE
  73. initrd:
  74. @test "$(INITRD_PHYS)" != "" || \
  75. (echo This machine does not support INITRD; exit -1)
  76. @test "$(INITRD)" != "" || \
  77. (echo You must specify INITRD; exit -1)
  78. install: $(obj)/Image
  79. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  80. $(obj)/Image System.map "$(INSTALL_PATH)"
  81. zinstall: $(obj)/zImage
  82. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  83. $(obj)/zImage System.map "$(INSTALL_PATH)"
  84. uinstall: $(obj)/uImage
  85. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  86. $(obj)/uImage System.map "$(INSTALL_PATH)"
  87. zi:
  88. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  89. $(obj)/zImage System.map "$(INSTALL_PATH)"
  90. i:
  91. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  92. $(obj)/Image System.map "$(INSTALL_PATH)"
  93. subdir- := bootp compressed