blob: 63f4f173e5f4b97afa7078a3d8600fbfb50c13a6 [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
Greentime Hud78a62f2018-03-01 10:54:07 +08008KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
9KBUILD_CFLAGS += -mcmodel=large
Greentime Hue71ea3b2017-10-25 15:03:49 +080010
11KBUILD_CFLAGS +=$(arch-y) $(tune-y)
12KBUILD_AFLAGS +=$(arch-y) $(tune-y)
13
14#Default value
15head-y := arch/nds32/kernel/head.o
16textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
17
18TEXTADDR := $(textaddr-y)
19
20export TEXTADDR
21
22
23# If we have a machine-specific directory, then include it in the build.
24core-y += arch/nds32/kernel/ arch/nds32/mm/
25libs-y += arch/nds32/lib/
Greentime Hue71ea3b2017-10-25 15:03:49 +080026
27ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
28BUILTIN_DTB := y
29else
30BUILTIN_DTB := n
31endif
32
33ifdef CONFIG_CPU_LITTLE_ENDIAN
Greentime Hud78a62f2018-03-01 10:54:07 +080034KBUILD_CFLAGS += $(call cc-option, -EL)
Greentime Hub3b112b2018-04-19 16:26:43 +080035KBUILD_AFLAGS += $(call cc-option, -EL)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090036KBUILD_LDFLAGS += $(call cc-option, -EL)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020037CHECKFLAGS += -D__NDS32_EL__
Greentime Hue71ea3b2017-10-25 15:03:49 +080038else
Greentime Hud78a62f2018-03-01 10:54:07 +080039KBUILD_CFLAGS += $(call cc-option, -EB)
Greentime Hub3b112b2018-04-19 16:26:43 +080040KBUILD_AFLAGS += $(call cc-option, -EB)
Masahiro Yamadad503ac52018-08-24 08:20:39 +090041KBUILD_LDFLAGS += $(call cc-option, -EB)
Luc Van Oostenryck97d1e3d2018-05-28 18:29:02 +020042CHECKFLAGS += -D__NDS32_EB__
Greentime Hue71ea3b2017-10-25 15:03:49 +080043endif
44
45boot := arch/nds32/boot
46core-$(BUILTIN_DTB) += $(boot)/dts/
47
48.PHONY: FORCE
49
50Image: vmlinux
51 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
52
53
54PHONY += vdso_install
55vdso_install:
56 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
57
58prepare: vdso_prepare
59vdso_prepare: prepare0
60 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
61
62CLEAN_FILES += include/asm-nds32/constants.h*
63
64# We use MRPROPER_FILES and CLEAN_FILES now
65archclean:
66 $(Q)$(MAKE) $(clean)=$(boot)
67
68define archhelp
69 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
70endef