Makefile 2.4 KB

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