blob: 6dc03206e3c94c7f7456b86a14ec4a244c4163b0 [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
6comma = ,
7
Vincent Chene46bf832018-11-22 11:14:34 +08008
Zong Lia1808252018-08-15 10:45:59 +08009ifdef CONFIG_FUNCTION_TRACER
10arch-y += -malways-save-lp -mno-relax
11endif
12
Vincent Chene46bf832018-11-22 11:14:34 +080013# Avoid generating FPU instructions
14arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
15
Greentime Hud78a62f2018-03-01 10:54:07 +080016KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
17KBUILD_CFLAGS += -mcmodel=large
Greentime Hue71ea3b2017-10-25 15:03:49 +080018
19KBUILD_CFLAGS +=$(arch-y) $(tune-y)
20KBUILD_AFLAGS +=$(arch-y) $(tune-y)
21
22#Default value
23head-y := arch/nds32/kernel/head.o
24textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
25
26TEXTADDR := $(textaddr-y)
27
28export TEXTADDR
29
30
31# If we have a machine-specific directory, then include it in the build.
32core-y += arch/nds32/kernel/ arch/nds32/mm/
33libs-y += arch/nds32/lib/
Greentime Hue71ea3b2017-10-25 15:03:49 +080034
35ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
36BUILTIN_DTB := y
37else
38BUILTIN_DTB := n
39endif
40
41ifdef CONFIG_CPU_LITTLE_ENDIAN
Greentime Hud78a62f2018-03-01 10:54:07 +080042KBUILD_CFLAGS += $(call cc-option, -EL)
Greentime Hub3b112b2018-04-19 16:26:43 +080043KBUILD_AFLAGS += $(call cc-option, -EL)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090044KBUILD_LDFLAGS += $(call cc-option, -EL)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020045CHECKFLAGS += -D__NDS32_EL__
Greentime Hue71ea3b2017-10-25 15:03:49 +080046else
Greentime Hud78a62f2018-03-01 10:54:07 +080047KBUILD_CFLAGS += $(call cc-option, -EB)
Greentime Hub3b112b2018-04-19 16:26:43 +080048KBUILD_AFLAGS += $(call cc-option, -EB)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090049KBUILD_LDFLAGS += $(call cc-option, -EB)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020050CHECKFLAGS += -D__NDS32_EB__
Greentime Hue71ea3b2017-10-25 15:03:49 +080051endif
52
53boot := arch/nds32/boot
Rob Herring37c8a5f2018-01-10 15:19:37 -060054core-y += $(boot)/dts/
Greentime Hue71ea3b2017-10-25 15:03:49 +080055
56.PHONY: FORCE
57
58Image: vmlinux
59 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
60
61
62PHONY += vdso_install
63vdso_install:
64 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
65
66prepare: vdso_prepare
67vdso_prepare: prepare0
68 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
69
70CLEAN_FILES += include/asm-nds32/constants.h*
71
72# We use MRPROPER_FILES and CLEAN_FILES now
73archclean:
74 $(Q)$(MAKE) $(clean)=$(boot)
75
76define archhelp
77 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
78endef