Makefile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. MKIMAGE ?= $(srctree)/arch/arm/boot/mkimage
  15. ifneq ($(MACHINE),)
  16. include $(srctree)/$(MACHINE)/Makefile.boot
  17. endif
  18. # Note: the following conditions must always be true:
  19. # ZRELADDR == virt_to_phys(PAGE_OFFSET + TEXT_OFFSET)
  20. # PARAMS_PHYS must be within 4MB of ZRELADDR
  21. # INITRD_PHYS must be in RAM
  22. ZRELADDR := $(zreladdr-y)
  23. PARAMS_PHYS := $(params_phys-y)
  24. INITRD_PHYS := $(initrd_phys-y)
  25. export ZRELADDR INITRD_PHYS PARAMS_PHYS
  26. targets := Image zImage xipImage bootpImage uImage uzImage ugImage eclipseinfo
  27. ifeq ($(CONFIG_XIP_KERNEL),y)
  28. $(obj)/xipImage: vmlinux FORCE
  29. $(call if_changed,objcopy)
  30. @echo ' Kernel: $@ is ready (physical address: $(CONFIG_XIP_PHYS_ADDR))'
  31. $(obj)/Image $(obj)/zImage: FORCE
  32. @echo 'Kernel configured for XIP (CONFIG_XIP_KERNEL=y)'
  33. @echo 'Only the xipImage target is available in this case'
  34. @false
  35. else
  36. $(obj)/xipImage: FORCE
  37. @echo 'Kernel not configured for XIP (CONFIG_XIP_KERNEL!=y)'
  38. @false
  39. $(obj)/Image: vmlinux FORCE
  40. $(call if_changed,objcopy)
  41. @echo ' Kernel: $@ is ready'
  42. $(obj)/compressed/vmlinux: $(obj)/Image FORCE
  43. $(Q)$(MAKE) $(build)=$(obj)/compressed $@
  44. $(obj)/zImage: $(obj)/compressed/vmlinux FORCE
  45. $(call if_changed,objcopy)
  46. @echo ' Kernel: $@ is ready'
  47. endif
  48. #quiet_cmd_uimage = UIMAGE $@
  49. # cmd_uimage = $(CONFIG_SHELL) $(MKIMAGE) -A arm -O linux -T kernel \
  50. # -C none -a $(LOADADDR) -e $(STARTADDR) \
  51. # -n 'Linux-$(KERNELRELEASE)' -d $< $@
  52. #
  53. quiet_cmd_uImage = UIMAGE $@
  54. cmd_uImage = $(MKIMAGE) -A arm -O linux -T kernel \
  55. -C lzma -a $(LOADADDR) -e $(STARTADDR) \
  56. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  57. quiet_cmd_uzImage = UZIMAGE $@
  58. cmd_uzImage = $(MKIMAGE) -A arm -O linux -T kernel \
  59. -C none -a 0x84000000 -e 0x84000000 \
  60. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  61. quiet_cmd_ugImage = ugIMAGE $@
  62. cmd_ugImage = $(MKIMAGE) -A arm -O linux -T kernel \
  63. -C gzip -a $(LOADADDR) -e $(STARTADDR) \
  64. -n 'Linux-$(KERNELRELEASE)' -d $< $@
  65. ifeq ($(CONFIG_ZBOOT_ROM),y)
  66. $(obj)/uImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  67. $(obj)/ugImage: LOADADDR=$(CONFIG_ZBOOT_ROM_TEXT)
  68. else
  69. $(obj)/uImage: LOADADDR=$(ZRELADDR)
  70. $(obj)/ugImage: LOADADDR=$(ZRELADDR)
  71. endif
  72. ifeq ($(CONFIG_THUMB2_KERNEL),y)
  73. # Set bit 0 to 1 so that "mov pc, rx" switches to Thumb-2 mode
  74. $(obj)/uImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
  75. $(obj)/ugImage: STARTADDR=$(shell echo $(LOADADDR) | sed -e "s/.$$/1/")
  76. else
  77. $(obj)/uImage: STARTADDR=$(LOADADDR)
  78. $(obj)/ugImage: STARTADDR=$(LOADADDR)
  79. endif
  80. $(obj)/ccImage: vmlinux FORCE
  81. $(call if_changed,objcopy)
  82. @echo ' Kernel: $@ is ready'
  83. $(obj)/ccImageg: vmlinux FORCE
  84. $(call if_changed,objcopy)
  85. @echo ' Kernel: $@ is ready'
  86. $(obj)/ccImageg.gz:$(obj)/ccImageg FORCE
  87. @-rm -rf $(obj)/ccImageg.gz
  88. @gzip $(obj)/ccImageg
  89. @echo ' Image $@ is ready'
  90. $(obj)/ccImage.lzma:$(obj)/ccImage FORCE
  91. @-rm -rf $(obj)/ccImage.lzma
  92. @lzma -z -S .lzma $(obj)/ccImage
  93. @echo ' Image $@ is ready'
  94. $(obj)/uImage: $(obj)/ccImage.lzma FORCE
  95. $(call if_changed,uImage)
  96. @echo ' Image $@ is ready'
  97. $(obj)/eclipseinfo: FORCE
  98. $(Q)touch $(obj)/.tmp.c
  99. $(Q)$(CC) -E -P -v -dD $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \
  100. $(__c_flags) $(modkern_cflags) $(obj)/.tmp.c
  101. $(Q)rm -f $(obj)/.tmp.c
  102. $(obj)/uzImage: $(obj)/zImage FORCE
  103. $(call if_changed,uzImage)
  104. @echo ' Image $@ is ready'
  105. $(obj)/ugImage: $(obj)/ccImageg.gz FORCE
  106. $(call if_changed,ugImage)
  107. @echo ' Image $@ is ready'
  108. $(obj)/bootp/bootp: $(obj)/zImage initrd FORCE
  109. $(Q)$(MAKE) $(build)=$(obj)/bootp $@
  110. @:
  111. $(obj)/bootpImage: $(obj)/bootp/bootp FORCE
  112. $(call if_changed,objcopy)
  113. @echo ' Kernel: $@ is ready'
  114. PHONY += initrd FORCE
  115. initrd:
  116. @test "$(INITRD_PHYS)" != "" || \
  117. (echo This machine does not support INITRD; exit -1)
  118. @test "$(INITRD)" != "" || \
  119. (echo You must specify INITRD; exit -1)
  120. install: $(obj)/Image
  121. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  122. $(obj)/Image System.map "$(INSTALL_PATH)"
  123. zinstall: $(obj)/zImage
  124. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  125. $(obj)/zImage System.map "$(INSTALL_PATH)"
  126. uinstall: $(obj)/uImage
  127. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  128. $(obj)/uImage System.map "$(INSTALL_PATH)"
  129. zi:
  130. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  131. $(obj)/zImage System.map "$(INSTALL_PATH)"
  132. i:
  133. $(CONFIG_SHELL) $(srctree)/$(src)/install.sh $(KERNELRELEASE) \
  134. $(obj)/Image System.map "$(INSTALL_PATH)"
  135. subdir- := bootp compressed