Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #
  2. # arch/arm64/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-2001 by Russell King
  12. LDFLAGS_vmlinux :=-p --no-undefined -X
  13. CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
  14. OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
  15. GZFLAGS :=-9
  16. LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  17. KBUILD_DEFCONFIG := defconfig
  18. KBUILD_CFLAGS += -mgeneral-regs-only
  19. KBUILD_CFLAGS += -fno-pic
  20. ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
  21. KBUILD_CPPFLAGS += -mbig-endian
  22. AS += -EB
  23. LD += -EB
  24. else
  25. KBUILD_CPPFLAGS += -mlittle-endian
  26. AS += -EL
  27. LD += -EL
  28. endif
  29. CHECKFLAGS += -D__aarch64__
  30. # Default value
  31. head-y := arch/arm64/kernel/head.o
  32. # The byte offset of the kernel image in RAM from the start of RAM.
  33. ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
  34. TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
  35. else
  36. TEXT_OFFSET := 0x00080000
  37. endif
  38. export TEXT_OFFSET GZFLAGS
  39. core-y += arch/arm64/kernel/ arch/arm64/mm/
  40. core-$(CONFIG_NET) += arch/arm64/net/
  41. core-$(CONFIG_KVM) += arch/arm64/kvm/
  42. core-$(CONFIG_XEN) += arch/arm64/xen/
  43. core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
  44. libs-y := arch/arm64/lib/ $(libs-y)
  45. libs-y += $(LIBGCC)
  46. libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/
  47. # Default target when executing plain make
  48. ifeq ($(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE),y)
  49. KBUILD_IMAGE := Image.gz-dtb
  50. else
  51. KBUILD_IMAGE := Image.gz
  52. endif
  53. KBUILD_DTBS := dtbs
  54. all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
  55. MTK_PLATFORM := $(CONFIG_MTK_PLATFORM:"%"=%)
  56. MTK_PROJECT := $(CONFIG_ARCH_MTK_PROJECT:"%"=%)
  57. export MTK_PLATFORM MTK_PROJECT MTK_TARGET_PROJECT
  58. -include $(srctree)/scripts/drvgen/drvgen.mk
  59. archprepare: $(DRVGEN_FILE_LIST)
  60. dtbs: $(DRVGEN_FILE_LIST)
  61. boot := arch/arm64/boot
  62. Image Image.gz: vmlinux
  63. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  64. zinstall install: vmlinux
  65. $(Q)$(MAKE) $(build)=$(boot) $@
  66. %.dtb: scripts
  67. $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
  68. dtbs: scripts
  69. $(Q)$(MAKE) $(build)=$(boot)/dts dtbs
  70. Image.gz-dtb: vmlinux scripts dtbs
  71. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  72. PHONY += vdso_install
  73. vdso_install:
  74. $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
  75. # We use MRPROPER_FILES and CLEAN_FILES now
  76. archclean:
  77. $(Q)$(MAKE) $(clean)=$(boot)
  78. define archhelp
  79. echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
  80. echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  81. echo '* dtbs - Build device tree blobs for enabled boards'
  82. echo ' install - Install uncompressed kernel'
  83. echo ' zinstall - Install compressed kernel'
  84. echo ' Install using (your) ~/bin/installkernel or'
  85. echo ' (distribution) /sbin/installkernel or'
  86. echo ' install to $$(INSTALL_PATH) and run lilo'
  87. endef