4 # This file is included by the global makefile so that you can add your own
5 # architecture-specific flags and dependencies.
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
11 # Copyright (C) 1995-2001 by Russell King
13 LDFLAGS_vmlinux :=-p --no-undefined -X
14 CPPFLAGS_vmlinux.lds = -DTEXT_OFFSET=$(TEXT_OFFSET)
15 OBJCOPYFLAGS :=-O binary -R .note -R .note.gnu.build-id -R .comment -S
18 LIBGCC := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
20 KBUILD_DEFCONFIG := defconfig
22 KBUILD_CFLAGS += -mgeneral-regs-only
23 KBUILD_CFLAGS += -fno-pic
24 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
25 KBUILD_CPPFLAGS += -mbig-endian
29 KBUILD_CPPFLAGS += -mlittle-endian
36 CHECKFLAGS += -D__aarch64__
39 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())}')
45 TEXT_OFFSET := 0x00080000
48 export TEXT_OFFSET GZFLAGS
50 core-y += arch/arm64/kernel/ arch/arm64/mm/
51 core-$(CONFIG_ARCH_ROCKCHIP) += arch/arm64/mach-rockchip/
52 core-$(CONFIG_KVM) += arch/arm64/kvm/
53 core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
54 libs-y := arch/arm64/lib/ $(libs-y)
57 # Default target when executing plain make
58 ifeq ($(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE),y)
59 KBUILD_IMAGE := Image.gz-dtb
61 KBUILD_IMAGE := Image.gz
66 all: $(KBUILD_IMAGE) $(KBUILD_DTBS)
68 boot := arch/arm64/boot
70 Image Image.gz: vmlinux
71 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
73 zinstall install: vmlinux
74 $(Q)$(MAKE) $(build)=$(boot) $@
77 $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
80 $(Q)$(MAKE) $(build)=$(boot)/dts dtbs
82 Image.gz-dtb: vmlinux scripts dtbs
83 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
87 $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
89 # We use MRPROPER_FILES and CLEAN_FILES now
91 $(Q)$(MAKE) $(clean)=$(boot)
94 echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
95 echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
96 echo '* dtbs - Build device tree blobs for enabled boards'
97 echo ' install - Install uncompressed kernel'
98 echo ' zinstall - Install compressed kernel'
99 echo ' Install using (your) ~/bin/installkernel or'
100 echo ' (distribution) /sbin/installkernel or'
101 echo ' install to $$(INSTALL_PATH) and run lilo'
105 $(Q)$(srctree)/mkkrnlimg $(objtree)/arch/arm64/boot/Image $(objtree)/kernel.img >/dev/null
106 @echo ' Image: kernel.img is ready'
108 LOGO := $(notdir $(wildcard $(srctree)/logo.bmp))
109 LOGO_KERNEL := $(notdir $(wildcard $(srctree)/logo_kernel.bmp))
110 %.img: %.dtb kernel.img $(LOGO) $(LOGO_KERNEL)
111 $(Q)$(srctree)/resource_tool $(objtree)/arch/arm64/boot/dts/$*.dtb $(LOGO) $(LOGO_KERNEL)
112 @echo ' Image: resource.img (with $*.dtb $(LOGO) $(LOGO_KERNEL)) is ready'