xref: /OK3568_Linux_fs/kernel/arch/nds32/Makefile (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun# SPDX-License-Identifier: GPL-2.0-only
2*4882a593SmuzhiyunLDFLAGS_vmlinux	:= --no-undefined -X
3*4882a593SmuzhiyunOBJCOPYFLAGS	:= -O binary -R .note -R .note.gnu.build-id -R .comment -S
4*4882a593Smuzhiyun
5*4882a593Smuzhiyunifdef CONFIG_FUNCTION_TRACER
6*4882a593Smuzhiyunarch-y += -malways-save-lp -mno-relax
7*4882a593Smuzhiyunendif
8*4882a593Smuzhiyun
9*4882a593Smuzhiyun# Avoid generating FPU instructions
10*4882a593Smuzhiyunarch-y  += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunKBUILD_CFLAGS	+= $(call cc-option, -mno-sched-prolog-epilog)
13*4882a593SmuzhiyunKBUILD_CFLAGS	+= -mcmodel=large
14*4882a593Smuzhiyun
15*4882a593SmuzhiyunKBUILD_CFLAGS	+=$(arch-y) $(tune-y)
16*4882a593SmuzhiyunKBUILD_AFLAGS	+=$(arch-y) $(tune-y)
17*4882a593Smuzhiyun
18*4882a593Smuzhiyun#Default value
19*4882a593Smuzhiyunhead-y		 := arch/nds32/kernel/head.o
20*4882a593Smuzhiyuntextaddr-y	 := $(CONFIG_PAGE_OFFSET)+0xc000
21*4882a593Smuzhiyun
22*4882a593SmuzhiyunTEXTADDR := $(textaddr-y)
23*4882a593Smuzhiyun
24*4882a593Smuzhiyunexport	TEXTADDR
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun
27*4882a593Smuzhiyun# If we have a machine-specific directory, then include it in the build.
28*4882a593Smuzhiyuncore-y				+= arch/nds32/kernel/ arch/nds32/mm/
29*4882a593Smuzhiyuncore-$(CONFIG_FPU)              += arch/nds32/math-emu/
30*4882a593Smuzhiyunlibs-y				+= arch/nds32/lib/
31*4882a593Smuzhiyun
32*4882a593Smuzhiyunifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
33*4882a593SmuzhiyunBUILTIN_DTB := y
34*4882a593Smuzhiyunelse
35*4882a593SmuzhiyunBUILTIN_DTB := n
36*4882a593Smuzhiyunendif
37*4882a593Smuzhiyun
38*4882a593Smuzhiyunifdef CONFIG_CPU_LITTLE_ENDIAN
39*4882a593SmuzhiyunKBUILD_CFLAGS   += $(call cc-option, -EL)
40*4882a593SmuzhiyunKBUILD_AFLAGS   += $(call cc-option, -EL)
41*4882a593SmuzhiyunKBUILD_LDFLAGS  += $(call cc-option, -EL)
42*4882a593SmuzhiyunCHECKFLAGS      += -D__NDS32_EL__
43*4882a593Smuzhiyunelse
44*4882a593SmuzhiyunKBUILD_CFLAGS   += $(call cc-option, -EB)
45*4882a593SmuzhiyunKBUILD_AFLAGS   += $(call cc-option, -EB)
46*4882a593SmuzhiyunKBUILD_LDFLAGS  += $(call cc-option, -EB)
47*4882a593SmuzhiyunCHECKFLAGS      += -D__NDS32_EB__
48*4882a593Smuzhiyunendif
49*4882a593Smuzhiyun
50*4882a593Smuzhiyunboot := arch/nds32/boot
51*4882a593Smuzhiyuncore-y += $(boot)/dts/
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunImage: vmlinux
54*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
55*4882a593Smuzhiyun
56*4882a593Smuzhiyun
57*4882a593SmuzhiyunPHONY += vdso_install
58*4882a593Smuzhiyunvdso_install:
59*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
60*4882a593Smuzhiyun
61*4882a593Smuzhiyunprepare: vdso_prepare
62*4882a593Smuzhiyunvdso_prepare: prepare0
63*4882a593Smuzhiyun	$(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
64*4882a593Smuzhiyun
65*4882a593Smuzhiyunarchclean:
66*4882a593Smuzhiyun	$(Q)$(MAKE) $(clean)=$(boot)
67*4882a593Smuzhiyun
68*4882a593Smuzhiyundefine archhelp
69*4882a593Smuzhiyun  echo  '  Image         - kernel image (arch/$(ARCH)/boot/Image)'
70*4882a593Smuzhiyunendef
71