Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  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. KBUILD_DEFCONFIG := defconfig
  17. # Check for binutils support for specific extensions
  18. lseinstr := $(call as-instr,.arch_extension lse,-DCONFIG_AS_LSE=1)
  19. ifeq ($(CONFIG_ARM64_LSE_ATOMICS), y)
  20. ifeq ($(lseinstr),)
  21. $(warning LSE atomics not supported by binutils)
  22. endif
  23. endif
  24. KBUILD_CFLAGS += -mgeneral-regs-only $(lseinstr)
  25. KBUILD_AFLAGS += $(lseinstr)
  26. ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
  27. KBUILD_CPPFLAGS += -mbig-endian
  28. AS += -EB
  29. LD += -EB
  30. else
  31. KBUILD_CPPFLAGS += -mlittle-endian
  32. AS += -EL
  33. LD += -EL
  34. endif
  35. CHECKFLAGS += -D__aarch64__
  36. ifeq ($(CONFIG_ARM64_ERRATUM_843419), y)
  37. KBUILD_CFLAGS_MODULE += -mcmodel=large
  38. endif
  39. # Default value
  40. head-y := arch/arm64/kernel/head.o
  41. # The byte offset of the kernel image in RAM from the start of RAM.
  42. ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
  43. TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
  44. else
  45. TEXT_OFFSET := 0x00080000
  46. endif
  47. export TEXT_OFFSET GZFLAGS
  48. core-y += arch/arm64/kernel/ arch/arm64/mm/
  49. core-$(CONFIG_NET) += arch/arm64/net/
  50. core-$(CONFIG_KVM) += arch/arm64/kvm/
  51. core-$(CONFIG_XEN) += arch/arm64/xen/
  52. core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
  53. libs-y := arch/arm64/lib/ $(libs-y)
  54. core-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a
  55. # Default target when executing plain make
  56. KBUILD_IMAGE := Image.gz
  57. KBUILD_DTBS := dtbs
  58. all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
  59. boot := arch/arm64/boot
  60. Image: vmlinux
  61. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  62. Image.%: 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. PHONY += dtbs dtbs_install
  69. dtbs: prepare scripts
  70. $(Q)$(MAKE) $(build)=$(boot)/dts
  71. dtbs_install:
  72. $(Q)$(MAKE) $(dtbinst)=$(boot)/dts
  73. PHONY += vdso_install
  74. vdso_install:
  75. $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
  76. # We use MRPROPER_FILES and CLEAN_FILES now
  77. archclean:
  78. $(Q)$(MAKE) $(clean)=$(boot)
  79. $(Q)$(MAKE) $(clean)=$(boot)/dts
  80. define archhelp
  81. echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
  82. echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  83. echo '* dtbs - Build device tree blobs for enabled boards'
  84. echo ' dtbs_install - Install dtbs to $(INSTALL_DTBS_PATH)'
  85. echo ' install - Install uncompressed kernel'
  86. echo ' zinstall - Install compressed kernel'
  87. echo ' Install using (your) ~/bin/installkernel or'
  88. echo ' (distribution) /sbin/installkernel or'
  89. echo ' install to $$(INSTALL_PATH) and run lilo'
  90. endef