Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
  15. ifdef CONFIG_PHYS_OFFSET
  16. add_hex = $(shell printf 0x%x $$(( $(1) + $(2) )) )
  17. ZRELADDR := $(call add_hex, $(CONFIG_PHYS_OFFSET), $(TEXT_OFFSET))
  18. endif
  19. PHYS_OFFSET := $(CONFIG_PHYS_OFFSET)
  20. export ZRELADDR PARAMS_PHYS PHYS_OFFSET
  21. targets := Image zImage xipImage bootpImage uImage
  22. ifeq ($(CONFIG_XIP_KERNEL),y)
  23. cmd_deflate_xip_data = $(CONFIG_SHELL) -c \
  24. '$(srctree)/$(src)/deflate_xip_data.sh $< $@'
  25. ifeq ($(CONFIG_XIP_DEFLATED_DATA),y)
  26. quiet_cmd_mkxip = XIPZ $@
  27. cmd_mkxip = $(cmd_objcopy) && $(cmd_deflate_xip_data)
  28. else
  29. quiet_cmd_mkxip = $(quiet_cmd_objcopy)
  30. cmd_mkxip = $(cmd_objcopy)
  31. endif
  32. $(obj)/xipImage: vmlinux FORCE
  33. $(call if_changed,mkxip)
  34. @$(kecho) ' Physical Address of xipImage: $(CONFIG_XIP_PHYS_ADDR)'
  35. $(obj)/Image $(obj)/zImage: FORCE
  36. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  37. @echo 'Only the xipImage target is available in this case'
  38. @false
  39. else
  40. $(obj)/xipImage: FORCE
  41. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  42. @false
  43. $(obj)/Image: vmlinux FORCE
  44. $(call if_changed,objcopy)
  45. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  46. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  47. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  48. $(call if_changed,objcopy)
  49. endif
  50. ifneq ($(LOADADDR),)
  51. UIMAGE_LOADADDR=$(LOADADDR)
  52. else
  53. ifeq ($(CONFIG_ZBOOT_ROM),y)
  54. UIMAGE_LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  55. else
  56. UIMAGE_LOADADDR=$(ZRELADDR)
  57. endif
  58. endif
  59. check_for_multiple_loadaddr = \
  60. if [ $(words $(UIMAGE_LOADADDR)) -ne 1 ]; then \
  61. echo 'multiple (or no) load addresses: $(UIMAGE_LOADADDR)'; \
  62. echo 'This is incompatible with uImages'; \
  63. echo 'Specify LOADADDR on the commandline to build an uImage'; \
  64. false; \
  65. fi
  66. $(obj)/uImage: $(obj)/zImage FORCE
  67. @$(check_for_multiple_loadaddr)
  68. $(call if_changed,uimage)
  69. $(obj)/bootp/bootp: $(obj)/zImage FORCE
  70. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  71. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  72. $(call if_changed,objcopy)
  73. subdir- := bootp compressed dts