Makefile 2.7 KB

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