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. 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. cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
  28. '$(srctree)/$(src)/deflate_xip_data.sh $< $@ || { rm -f $@; false; }'
  29. ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
  30. quiet_cmd_mkxip = XIPZ $@
  31. cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xip_data)
  32. else
  33. quiet_cmd_mkxip = $(quiet_cmd_objcopy)
  34. cmd_mkxip = $(cmd_objcopy)
  35. endif
  36. $(obj)/xipImage: vmlinux FORCE
  37. $(call if_changed,mkxip)
  38. @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)'
  39. $(obj)/Image $(obj)/zImage: FORCE
  40. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  41. @echo 'Only the xipImage target is available in this case'
  42. @false
  43. else
  44. $(obj)/xipImage: FORCE
  45. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  46. @false
  47. $(obj)/Image: vmlinux FORCE
  48. $(call if_changed,objcopy)
  49. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  50. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  51. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  52. $(call if_changed,objcopy)
  53. endif
  54. ifneq ($(LOADADDR),)
  55. UIMAGE_LOADADDR=$(LOADADDR)
  56. else
  57. ifeq ($(CONFIG_ZBOOT_ROM),y)
  58. UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  59. else
  60. UIMAGE_LOADADDR=$(ZRELADDR)
  61. endif
  62. endif
  63. check_for_multiple_loadaddr = \
  64. if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
  65. echo 'multiple (or no) load addresses: $(UIMAGE_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. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  74. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  75. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  76. $(call if_changed,objcopy)
  77. PHONY += initrd install zinstall uinstall
  78. initrd:
  79. @test "$(INITRD_PHYS)" != "" || \
  80. (echo This machine does not support INITRD; exit -1)
  81. @test "$(INITRD)" != "" || \
  82. (echo You must specify INITRD; exit -1)
  83. install:
  84. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  85. $(obj)/Image System.map "$(INSTALL_PATH)"
  86. zinstall:
  87. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  88. $(obj)/zImage System.map "$(INSTALL_PATH)"
  89. uinstall:
  90. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh "$(KERNELRELEASE)" \
  91. $(obj)/uImage System.map "$(INSTALL_PATH)"
  92. subdir- := bootp compressed dts