WIP FPC-III support
[linux/fpc-iii.git] / arch / nds32 / Makefile
blobccdca714202019884ccbf794923291dce728bc46
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
5 ifdef CONFIG_FUNCTION_TRACER
6 arch-y += -malways-save-lp -mno-relax
7 endif
9 # Avoid generating FPU instructions
10 arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
12 KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
13 KBUILD_CFLAGS += -mcmodel=large
15 KBUILD_CFLAGS +=$(arch-y) $(tune-y)
16 KBUILD_AFLAGS +=$(arch-y) $(tune-y)
18 #Default value
19 head-y := arch/nds32/kernel/head.o
20 textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
22 TEXTADDR := $(textaddr-y)
24 export TEXTADDR
27 # If we have a machine-specific directory, then include it in the build.
28 core-y += arch/nds32/kernel/ arch/nds32/mm/
29 core-$(CONFIG_FPU) += arch/nds32/math-emu/
30 libs-y += arch/nds32/lib/
32 ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
33 BUILTIN_DTB := y
34 else
35 BUILTIN_DTB := n
36 endif
38 ifdef CONFIG_CPU_LITTLE_ENDIAN
39 KBUILD_CFLAGS += $(call cc-option, -EL)
40 KBUILD_AFLAGS += $(call cc-option, -EL)
41 KBUILD_LDFLAGS += $(call cc-option, -EL)
42 CHECKFLAGS += -D__NDS32_EL__
43 else
44 KBUILD_CFLAGS += $(call cc-option, -EB)
45 KBUILD_AFLAGS += $(call cc-option, -EB)
46 KBUILD_LDFLAGS += $(call cc-option, -EB)
47 CHECKFLAGS += -D__NDS32_EB__
48 endif
50 boot := arch/nds32/boot
51 core-y += $(boot)/dts/
53 Image: vmlinux
54 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
57 PHONY += vdso_install
58 vdso_install:
59 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
61 prepare: vdso_prepare
62 vdso_prepare: prepare0
63 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
65 archclean:
66 $(Q)$(MAKE) $(clean)=$(boot)
68 define archhelp
69 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
70 endef