blob: ac3482882cf93e50b165ac3896712fc65ce66e65 [file] [log] [blame]
Greentime Hue71ea3b2017-10-25 15:03:49 +08001LDFLAGS_vmlinux := --no-undefined -X
2OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S
3
4KBUILD_DEFCONFIG := defconfig
5
Zong Lia1808252018-08-15 10:45:59 +08006ifdef CONFIG_FUNCTION_TRACER
7arch-y += -malways-save-lp -mno-relax
8endif
9
Vincent Chene46bf832018-11-22 11:14:34 +080010# Avoid generating FPU instructions
11arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
12
Greentime Hud78a62f2018-03-01 10:54:07 +080013KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
14KBUILD_CFLAGS += -mcmodel=large
Greentime Hue71ea3b2017-10-25 15:03:49 +080015
16KBUILD_CFLAGS +=$(arch-y) $(tune-y)
17KBUILD_AFLAGS +=$(arch-y) $(tune-y)
18
19#Default value
20head-y := arch/nds32/kernel/head.o
21textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
22
23TEXTADDR := $(textaddr-y)
24
25export TEXTADDR
26
27
28# If we have a machine-specific directory, then include it in the build.
29core-y += arch/nds32/kernel/ arch/nds32/mm/
Vincent Chen1ac83252018-11-22 11:14:35 +080030core-$(CONFIG_FPU) += arch/nds32/math-emu/
Greentime Hue71ea3b2017-10-25 15:03:49 +080031libs-y += arch/nds32/lib/
Greentime Hue71ea3b2017-10-25 15:03:49 +080032
33ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
34BUILTIN_DTB := y
35else
36BUILTIN_DTB := n
37endif
38
39ifdef CONFIG_CPU_LITTLE_ENDIAN
Greentime Hud78a62f2018-03-01 10:54:07 +080040KBUILD_CFLAGS += $(call cc-option, -EL)
Greentime Hub3b112b2018-04-19 16:26:43 +080041KBUILD_AFLAGS += $(call cc-option, -EL)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090042KBUILD_LDFLAGS += $(call cc-option, -EL)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020043CHECKFLAGS += -D__NDS32_EL__
Greentime Hue71ea3b2017-10-25 15:03:49 +080044else
Greentime Hud78a62f2018-03-01 10:54:07 +080045KBUILD_CFLAGS += $(call cc-option, -EB)
Greentime Hub3b112b2018-04-19 16:26:43 +080046KBUILD_AFLAGS += $(call cc-option, -EB)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090047KBUILD_LDFLAGS += $(call cc-option, -EB)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020048CHECKFLAGS += -D__NDS32_EB__
Greentime Hue71ea3b2017-10-25 15:03:49 +080049endif
50
51boot := arch/nds32/boot
Rob Herring37c8a5f2018-01-10 15:19:37 -060052core-y += $(boot)/dts/
Greentime Hue71ea3b2017-10-25 15:03:49 +080053
Greentime Hue71ea3b2017-10-25 15:03:49 +080054Image: vmlinux
55 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
56
57
58PHONY += vdso_install
59vdso_install:
60 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
61
62prepare: vdso_prepare
63vdso_prepare: prepare0
64 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
65
Greentime Hue71ea3b2017-10-25 15:03:49 +080066archclean:
67 $(Q)$(MAKE) $(clean)=$(boot)
68
69define archhelp
70 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
71endef