rk: temp revert rk change
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / Makefile
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
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
16 GZFLAGS         :=-9
17
18 LIBGCC          := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
19
20 KBUILD_DEFCONFIG := defconfig
21
22 KBUILD_CFLAGS   += -mgeneral-regs-only
23 KBUILD_CFLAGS   += -fno-pic
24 ifeq ($(CONFIG_CPU_BIG_ENDIAN), y)
25 KBUILD_CPPFLAGS += -mbig-endian
26 AS              += -EB
27 LD              += -EB
28 else
29 KBUILD_CPPFLAGS += -mlittle-endian
30 AS              += -EL
31 LD              += -EL
32 endif
33
34 comma = ,
35
36 CHECKFLAGS      += -D__aarch64__
37
38 # Default value
39 head-y          := arch/arm64/kernel/head.o
40
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
48 export  TEXT_OFFSET GZFLAGS
49
50 core-y          += arch/arm64/kernel/ arch/arm64/mm/
51 core-$(CONFIG_KVM) += arch/arm64/kvm/
52 core-$(CONFIG_CRYPTO) += arch/arm64/crypto/
53 libs-y          := arch/arm64/lib/ $(libs-y)
54 libs-y          += $(LIBGCC)
55
56 # Default target when executing plain make
57 ifeq ($(CONFIG_BUILD_ARM64_APPENDED_DTB_IMAGE),y)
58 KBUILD_IMAGE    := Image.gz-dtb
59 else
60 KBUILD_IMAGE    := Image.gz
61 endif
62
63 KBUILD_DTBS     := dtbs
64
65 all:    $(KBUILD_IMAGE) $(KBUILD_DTBS)
66
67 boot := arch/arm64/boot
68
69 Image Image.gz: vmlinux
70         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
71
72 zinstall install: vmlinux
73         $(Q)$(MAKE) $(build)=$(boot) $@
74
75 %.dtb: scripts
76         $(Q)$(MAKE) $(build)=$(boot)/dts $(boot)/dts/$@
77
78 dtbs: scripts
79         $(Q)$(MAKE) $(build)=$(boot)/dts dtbs
80
81 Image.gz-dtb: vmlinux scripts dtbs
82         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
83
84 PHONY += vdso_install
85 vdso_install:
86         $(Q)$(MAKE) $(build)=arch/arm64/kernel/vdso $@
87
88 # We use MRPROPER_FILES and CLEAN_FILES now
89 archclean:
90         $(Q)$(MAKE) $(clean)=$(boot)
91
92 define archhelp
93   echo  '* Image.gz      - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)'
94   echo  '  Image         - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
95   echo  '* dtbs          - Build device tree blobs for enabled boards'
96   echo  '  install       - Install uncompressed kernel'
97   echo  '  zinstall      - Install compressed kernel'
98   echo  '                  Install using (your) ~/bin/installkernel or'
99   echo  '                  (distribution) /sbin/installkernel or'
100   echo  '                  install to $$(INSTALL_PATH) and run lilo'
101 endef