blob: 3509fac104919ff8d9727d4cdfe2185d10473746 [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
Zong Lia1808252018-08-15 10:45:59 +08008ifdef CONFIG_FUNCTION_TRACER
9arch-y += -malways-save-lp -mno-relax
10endif
11
Greentime Hud78a62f2018-03-01 10:54:07 +080012KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
13KBUILD_CFLAGS += -mcmodel=large
Greentime Hue71ea3b2017-10-25 15:03:49 +080014
15KBUILD_CFLAGS +=$(arch-y) $(tune-y)
16KBUILD_AFLAGS +=$(arch-y) $(tune-y)
17
18#Default value
19head-y := arch/nds32/kernel/head.o
20textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
21
22TEXTADDR := $(textaddr-y)
23
24export TEXTADDR
25
26
27# If we have a machine-specific directory, then include it in the build.
28core-y += arch/nds32/kernel/ arch/nds32/mm/
29libs-y += arch/nds32/lib/
Greentime Hue71ea3b2017-10-25 15:03:49 +080030
31ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
32BUILTIN_DTB := y
33else
34BUILTIN_DTB := n
35endif
36
37ifdef CONFIG_CPU_LITTLE_ENDIAN
Greentime Hud78a62f2018-03-01 10:54:07 +080038KBUILD_CFLAGS += $(call cc-option, -EL)
Greentime Hub3b112b2018-04-19 16:26:43 +080039KBUILD_AFLAGS += $(call cc-option, -EL)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090040KBUILD_LDFLAGS += $(call cc-option, -EL)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020041CHECKFLAGS += -D__NDS32_EL__
Greentime Hue71ea3b2017-10-25 15:03:49 +080042else
Greentime Hud78a62f2018-03-01 10:54:07 +080043KBUILD_CFLAGS += $(call cc-option, -EB)
Greentime Hub3b112b2018-04-19 16:26:43 +080044KBUILD_AFLAGS += $(call cc-option, -EB)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090045KBUILD_LDFLAGS += $(call cc-option, -EB)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020046CHECKFLAGS += -D__NDS32_EB__
Greentime Hue71ea3b2017-10-25 15:03:49 +080047endif
48
49boot := arch/nds32/boot
50core-$(BUILTIN_DTB) += $(boot)/dts/
51
52.PHONY: FORCE
53
54Image: 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
66CLEAN_FILES += include/asm-nds32/constants.h*
67
68# We use MRPROPER_FILES and CLEAN_FILES now
69archclean:
70 $(Q)$(MAKE) $(clean)=$(boot)
71
72define archhelp
73 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
74endef