Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. MKIMAGE := $(srctree)/scripts/mkuboot.sh
  14. ifneq ($(MACHINE),)
  15. -include $(srctree)/$(MACHINE)/Makefile.boot
  16. endif
  17. # Note: the following conditions must always be true:
  18. # PARAMS_PHYS must be within 4MB of ZRELADDR
  19. # INITRD_PHYS must be in RAM
  20. PARAMS_PHYS := $(params_phys-y)
  21. INITRD_PHYS := $(initrd_phys-y)
  22. export INITRD_PHYS PARAMS_PHYS
  23. targets := Image zImage xipImage bootpImage uImage
  24. ifeq ($(CONFIG_XIP_KERNEL),y)
  25. $(obj)/xipImage: vmlinux FORCE
  26. $(call if_changed,objcopy)
  27. @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
  28. $(obj)/Image $(obj)/zImage: FORCE
  29. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  30. @echo 'Only the xipImage target is available in this case'
  31. @false
  32. else
  33. $(obj)/xipImage: FORCE
  34. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  35. @false
  36. $(obj)/Image: vmlinux FORCE
  37. $(call if_changed,objcopy)
  38. @echo ' Kernel: $@ is ready'
  39. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  40. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  41. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  42. $(call if_changed,objcopy)
  43. @echo ' Kernel: $@ is ready'
  44. endif
  45. quiet_cmd_uimage = UIMAGE $@
  46. cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
  47. -C none -a $(LOADADDR) -e $(STARTADDR) \
  48. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  49. ifeq ($(CONFIG_ZBOOT_ROM),y)
  50. $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  51. else
  52. $(obj)/uImage: LOADADDR=$(CONFIG_ZRELADDR)
  53. endif
  54. ifeq ($(CONFIG_THUMB2_KERNEL),y)
  55. # Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode
  56. $(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
  57. else
  58. $(obj)/uImage: STARTADDR=$(LOADADDR)
  59. endif
  60. $(obj)/uImage: $(obj)/zImage FORCE
  61. $(call if_changed,uimage)
  62. @echo ' Image $@ is ready'
  63. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  64. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  65. @:
  66. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  67. $(call if_changed,objcopy)
  68. @echo ' Kernel: $@ is ready'
  69. PHONY += initrd FORCE
  70. initrd:
  71. @test "$(INITRD_PHYS)" != "" || \
  72. (echo This machine does not support INITRD; exit -1)
  73. @test "$(INITRD)" != "" || \
  74. (echo You must specify INITRD; exit -1)
  75. install: $(obj)/Image
  76. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  77. $(obj)/Image System.map "$(INSTALL_PATH)"
  78. zinstall: $(obj)/zImage
  79. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  80. $(obj)/zImage System.map "$(INSTALL_PATH)"
  81. zi:
  82. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  83. $(obj)/zImage System.map "$(INSTALL_PATH)"
  84. i:
  85. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  86. $(obj)/Image System.map "$(INSTALL_PATH)"
  87. subdir- := bootp compressed