blob: 797ad9b450af210562d526fac5f1b5a6f4d4bba9 [file] [log] [blame]
Thomas Gleixnerec8f24b2019-05-19 13:07:45 +01001# SPDX-License-Identifier: GPL-2.0-only
Greentime Hue71ea3b2017-10-25 15:03:49 +08002LDFLAGS_vmlinux := --no-undefined -X
3OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S
4
Zong Lia1808252018-08-15 10:45:59 +08005ifdef CONFIG_FUNCTION_TRACER
6arch-y += -malways-save-lp -mno-relax
7endif
8
Vincent Chene46bf832018-11-22 11:14:34 +08009# Avoid generating FPU instructions
10arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
11
Alexey Dobriyan04e85bb2021-08-02 23:43:15 +030012# Enable <nds32_intrinsic.h>
13KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include)
Greentime Hud78a62f2018-03-01 10:54:07 +080014KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
15KBUILD_CFLAGS += -mcmodel=large
Greentime Hue71ea3b2017-10-25 15:03:49 +080016
17KBUILD_CFLAGS +=$(arch-y) $(tune-y)
18KBUILD_AFLAGS +=$(arch-y) $(tune-y)
19
20#Default value
21head-y := arch/nds32/kernel/head.o
22textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
23
24TEXTADDR := $(textaddr-y)
25
26export TEXTADDR
27
28
29# If we have a machine-specific directory, then include it in the build.
30core-y += arch/nds32/kernel/ arch/nds32/mm/
Vincent Chen1ac83252018-11-22 11:14:35 +080031core-$(CONFIG_FPU) += arch/nds32/math-emu/
Greentime Hue71ea3b2017-10-25 15:03:49 +080032libs-y += arch/nds32/lib/
Greentime Hue71ea3b2017-10-25 15:03:49 +080033
34ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
35BUILTIN_DTB := y
36else
37BUILTIN_DTB := n
38endif
39
40ifdef CONFIG_CPU_LITTLE_ENDIAN
Greentime Hud78a62f2018-03-01 10:54:07 +080041KBUILD_CFLAGS += $(call cc-option, -EL)
Greentime Hub3b112b2018-04-19 16:26:43 +080042KBUILD_AFLAGS += $(call cc-option, -EL)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090043KBUILD_LDFLAGS += $(call cc-option, -EL)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020044CHECKFLAGS += -D__NDS32_EL__
Greentime Hue71ea3b2017-10-25 15:03:49 +080045else
Greentime Hud78a62f2018-03-01 10:54:07 +080046KBUILD_CFLAGS += $(call cc-option, -EB)
Greentime Hub3b112b2018-04-19 16:26:43 +080047KBUILD_AFLAGS += $(call cc-option, -EB)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090048KBUILD_LDFLAGS += $(call cc-option, -EB)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020049CHECKFLAGS += -D__NDS32_EB__
Greentime Hue71ea3b2017-10-25 15:03:49 +080050endif
51
52boot := arch/nds32/boot
Rob Herring37c8a5f2018-01-10 15:19:37 -060053core-y += $(boot)/dts/
Greentime Hue71ea3b2017-10-25 15:03:49 +080054
Greentime Hue71ea3b2017-10-25 15:03:49 +080055Image: vmlinux
56 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
57
58
59PHONY += vdso_install
60vdso_install:
61 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
62
63prepare: vdso_prepare
64vdso_prepare: prepare0
65 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
66
Greentime Hue71ea3b2017-10-25 15:03:49 +080067define archhelp
68 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
69endef