18c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# 28c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# arch/arm64/Makefile 38c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# 48c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# This file is included by the global makefile so that you can add your own 58c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# architecture-specific flags and dependencies. 68c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# 78c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# This file is subject to the terms and conditions of the GNU General Public 88c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# License. See the file "COPYING" in the main directory of this archive 98c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# for more details. 108c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# 118c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# Copyright (C) 1995-2001 by Russell King 128c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 138c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasLDFLAGS_vmlinux :=-p --no-undefined -X 148c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasCPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET) 158c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasOBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S 168c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasGZFLAGS :=-9 178c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 188c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasLIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name) 198c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 208c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasKBUILD_DEFCONFIG := defconfig 218c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 228c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasKBUILD_CFLAGS += -mgeneral-regs-only 23a11623daf7b06e55e11ea33ade6d53b3a46cbb00Greg HackmannKBUILD_CFLAGS += -fno-pic 24a0974e6e217aead196033d72f898e2acb575304dWill Deaconifeq ($(CONFIG_CPU_BIG_ENDIAN), y) 25a0974e6e217aead196033d72f898e2acb575304dWill DeaconKBUILD_CPPFLAGS += -mbig-endian 26a0974e6e217aead196033d72f898e2acb575304dWill DeaconAS += -EB 27a0974e6e217aead196033d72f898e2acb575304dWill DeaconLD += -EB 28a0974e6e217aead196033d72f898e2acb575304dWill Deaconelse 298c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasKBUILD_CPPFLAGS += -mlittle-endian 308c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasAS += -EL 318c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasLD += -EL 32a0974e6e217aead196033d72f898e2acb575304dWill Deaconendif 338c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 348c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasCHECKFLAGS += -D__aarch64__ 358c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 368c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# Default value 378c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinashead-y := arch/arm64/kernel/head.o 388c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 398c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# The byte offset of the kernel image in RAM from the start of RAM. 40da57a369d3bc5cd61db90f7e9555840381db9b09Mark Rutlandifeq ($(CONFIG_ARM64_RANDOMIZE_TEXT_OFFSET), y) 414190312beb2acfb7bfb1bb971e24a759aa96b0e8Ard BiesheuvelTEXT_OFFSET := $(shell awk 'BEGIN {srand(); printf "0x%03x000\n", int(512 * rand())}') 42da57a369d3bc5cd61db90f7e9555840381db9b09Mark Rutlandelse 438c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasTEXT_OFFSET := 0x00080000 44da57a369d3bc5cd61db90f7e9555840381db9b09Mark Rutlandendif 458c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 468c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinasexport TEXT_OFFSET GZFLAGS 478c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 488c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinascore-y += arch/arm64/kernel/ arch/arm64/mm/ 49e54bcde3d69d40023ae77727213d14f920eb264aZi Shen Limcore-$(CONFIG_NET) += arch/arm64/net/ 506211753fdfd05af9e08f54c8d0ba3ee516034878Marc Zyngiercore-$(CONFIG_KVM) += arch/arm64/kvm/ 5163917f0b5ba2a932d4fca7f67d1a1eae9034269eCatalin Marinascore-$(CONFIG_XEN) += arch/arm64/xen/ 522c98833a42cd194ba0f537cd21917e15e5593715Ard Biesheuvelcore-$(CONFIG_CRYPTO) += arch/arm64/crypto/ 538c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinaslibs-y := arch/arm64/lib/ $(libs-y) 548c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinaslibs-y += $(LIBGCC) 55f4f75ad5741fe0331bbe1f5c42b906cda299f26bArd Biesheuvellibs-$(CONFIG_EFI_STUB) += drivers/firmware/efi/libstub/ 568c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 578c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# Default target when executing plain make 58082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex Rayifeq ($(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE),y) 59082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex RayKBUILD_IMAGE := Image.gz-dtb 60082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex Rayelse 6170f915a299bc72424fc2d3498284f6d48b880afaRob HerringKBUILD_IMAGE := Image.gz 62082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex Rayendif 63082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex Ray 6470f915a299bc72424fc2d3498284f6d48b880afaRob HerringKBUILD_DTBS := dtbs 658c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 6670f915a299bc72424fc2d3498284f6d48b880afaRob Herringall: $(KBUILD_IMAGE) $(KBUILD_DTBS) 678c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 688c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinasboot := arch/arm64/boot 698c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 708c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin MarinasImage Image.gz: vmlinux 7170f915a299bc72424fc2d3498284f6d48b880afaRob Herring $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 728c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 738c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinaszinstall install: vmlinux 7470f915a299bc72424fc2d3498284f6d48b880afaRob Herring $(Q)$(MAKE) $(build)=$(boot) $@ 758c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 7670f915a299bc72424fc2d3498284f6d48b880afaRob Herring%.dtb: scripts 7770f915a299bc72424fc2d3498284f6d48b880afaRob Herring $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@ 7870f915a299bc72424fc2d3498284f6d48b880afaRob Herring 7970f915a299bc72424fc2d3498284f6d48b880afaRob Herringdtbs: scripts 8058fea354d887fddddd342a8d14b02069161ca904Catalin Marinas $(Q)$(MAKE) $(build)=$(boot)/dts dtbs 818c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 82082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex RayImage.gz-dtb: vmlinux scripts dtbs 83082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex Ray $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 84082d89f7f2ae529e2d7b50f6259e4430472cf4edAlex Ray 853c01742a8ac93a3abf9b099758db970410427afdKyle McMartinPHONY += vdso_install 863c01742a8ac93a3abf9b099758db970410427afdKyle McMartinvdso_install: 873c01742a8ac93a3abf9b099758db970410427afdKyle McMartin $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@ 883c01742a8ac93a3abf9b099758db970410427afdKyle McMartin 898c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas# We use MRPROPER_FILES and CLEAN_FILES now 908c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinasarchclean: 918c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas $(Q)$(MAKE) $(clean)=$(boot) 928c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas 938c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinasdefine archhelp 948c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' 958c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)' 9670f915a299bc72424fc2d3498284f6d48b880afaRob Herring echo '* dtbs - Build device tree blobs for enabled boards' 978c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo ' install - Install uncompressed kernel' 988c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo ' zinstall - Install compressed kernel' 998c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo ' Install using (your) ~/bin/installkernel or' 1008c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo ' (distribution) /sbin/installkernel or' 1018c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinas echo ' install to $$(INSTALL_PATH) and run lilo' 1028c2c3df31e3b87cb5348e48776c366ebd1dc5a7aCatalin Marinasendef 103