Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
  20. KBUILD_CPPFLAGS += -mbig-endian
  21. AS += -EB
  22. LD += -EB
  23. else
  24. KBUILD_CPPFLAGS += -mlittle-endian
  25. AS += -EL
  26. LD += -EL
  27. endif
  28. CHECKFLAGS += -D__aarch64__
  29. # Default value
  30. head-y := arch/arm64/kernel/head.o
  31. # The byte offset of the kernel image in RAM from the start of RAM.
  32. ifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y)
  33. TEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}')
  34. else
  35. TEXT_OFFSET := 0x00080000
  36. endif
  37. export TEXT_OFFSET GZFLAGS
  38. core-y += arch/arm64/kernel/ arch/arm64/mm/
  39. core-$(CONFIG_NET) += arch/arm64/net/
  40. core-$(CONFIG_KVM) += arch/arm64/kvm/
  41. core-$(CONFIG_XEN) += arch/arm64/xen/
  42. core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
  43. libs-y := arch/arm64/lib/ $(libs-y)
  44. libs-y += $(LIBGCC)
  45. libs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/
  46. # Default target when executing plain make
  47. KBUILD_IMAGE := Image.gz
  48. KBUILD_DTBS := dtbs
  49. all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
  50. boot := arch/arm64/boot
  51. Image Image.gz: vmlinux
  52. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  53. zinstall install: vmlinux
  54. $(Q)$(MAKE) $(build)=$(boot) $@
  55. %.dtb: scripts
  56. $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
  57. dtbs: scripts
  58. $(Q)$(MAKE) $(build)=$(boot)/dts dtbs
  59. PHONY += vdso_install
  60. vdso_install:
  61. $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
  62. # We use MRPROPER_FILES and CLEAN_FILES now
  63. archclean:
  64. $(Q)$(MAKE) $(clean)=$(boot)
  65. define archhelp
  66. echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
  67. echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  68. echo '* dtbs - Build device tree blobs for enabled boards'
  69. echo ' install - Install uncompressed kernel'
  70. echo ' zinstall - Install compressed kernel'
  71. echo ' Install using (your) ~/bin/installkernel or'
  72. echo ' (distribution) /sbin/installkernel or'
  73. echo ' install to $$(INSTALL_PATH) and run lilo'
  74. endef