Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. OBJCOPYFLAGS :=-O binary -R .comment -S
  14. ifneq ($(MACHINE),)
  15. include $(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. @$(kecho) ' Physical Address of xipImage: $(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. $(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. endif
  45. ifneq ($(LOADADDR),)
  46. UIMAGE_LOADADDR=$(LOADADDR)
  47. else
  48. ifeq ($(CONFIG_ZBOOT_ROM),y)
  49. UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  50. else
  51. UIMAGE_LOADADDR=$(ZRELADDR)
  52. endif
  53. endif
  54. check_for_multiple_loadaddr = \
  55. if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
  56. echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
  57. echo 'This is incompatible with uImages'; \
  58. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  59. false; \
  60. fi
  61. $(obj)/uImage: $(obj)/zImage FORCE
  62. @$(check_for_multiple_loadaddr)
  63. $(call if_changed,uimage)
  64. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  65. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  66. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  67. $(call if_changed,objcopy)
  68. PHONY += initrd install zinstall uinstall
  69. initrd:
  70. @test "$(INITRD_PHYS)" != "" || \
  71. (echo This machine does not support INITRD; exit -1)
  72. @test "$(INITRD)" != "" || \
  73. (echo You must specify INITRD; exit -1)
  74. install:
  75. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  76. $(obj)/Image System.map "$(INSTALL_PATH)"
  77. zinstall:
  78. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  79. $(obj)/zImage System.map "$(INSTALL_PATH)"
  80. uinstall:
  81. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  82. $(obj)/uImage System.map "$(INSTALL_PATH)"
  83. subdir- := bootp compressed dts