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