]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blob - arch/nds32/Makefile
treewide: Add SPDX license identifier - Makefile/Kconfig
[mirror_ubuntu-hirsute-kernel.git] / arch / nds32 / Makefile
1 # SPDX-License-Identifier: GPL-2.0-only
2 LDFLAGS_vmlinux := --no-undefined -X
3 OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S
4
5 KBUILD_DEFCONFIG := defconfig
6
7 ifdef CONFIG_FUNCTION_TRACER
8 arch-y += -malways-save-lp -mno-relax
9 endif
10
11 # Avoid generating FPU instructions
12 arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
13
14 KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
15 KBUILD_CFLAGS += -mcmodel=large
16
17 KBUILD_CFLAGS +=$(arch-y) $(tune-y)
18 KBUILD_AFLAGS +=$(arch-y) $(tune-y)
19
20 #Default value
21 head-y := arch/nds32/kernel/head.o
22 textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
23
24 TEXTADDR := $(textaddr-y)
25
26 export TEXTADDR
27
28
29 # If we have a machine-specific directory, then include it in the build.
30 core-y += arch/nds32/kernel/ arch/nds32/mm/
31 core-$(CONFIG_FPU) += arch/nds32/math-emu/
32 libs-y += arch/nds32/lib/
33
34 ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
35 BUILTIN_DTB := y
36 else
37 BUILTIN_DTB := n
38 endif
39
40 ifdef CONFIG_CPU_LITTLE_ENDIAN
41 KBUILD_CFLAGS += $(call cc-option, -EL)
42 KBUILD_AFLAGS += $(call cc-option, -EL)
43 KBUILD_LDFLAGS += $(call cc-option, -EL)
44 CHECKFLAGS += -D__NDS32_EL__
45 else
46 KBUILD_CFLAGS += $(call cc-option, -EB)
47 KBUILD_AFLAGS += $(call cc-option, -EB)
48 KBUILD_LDFLAGS += $(call cc-option, -EB)
49 CHECKFLAGS += -D__NDS32_EB__
50 endif
51
52 boot := arch/nds32/boot
53 core-y += $(boot)/dts/
54
55 Image: vmlinux
56 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
57
58
59 PHONY += vdso_install
60 vdso_install:
61 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
62
63 prepare: vdso_prepare
64 vdso_prepare: prepare0
65 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
66
67 archclean:
68 $(Q)$(MAKE) $(clean)=$(boot)
69
70 define archhelp
71 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
72 endef