blob: 91f933d5a962aee31c3e4fcad3a7bd9396806785 [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/
26LIBGCC_PATH := \
27 $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
28libs-y += $(LIBGCC_PATH)
29
30ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
31BUILTIN_DTB := y
32else
33BUILTIN_DTB := n
34endif
35
36ifdef CONFIG_CPU_LITTLE_ENDIAN
Greentime Hud78a62f2018-03-01 10:54:07 +080037KBUILD_CFLAGS += $(call cc-option, -EL)
Greentime Hue71ea3b2017-10-25 15:03:49 +080038else
Greentime Hud78a62f2018-03-01 10:54:07 +080039KBUILD_CFLAGS += $(call cc-option, -EB)
Greentime Hue71ea3b2017-10-25 15:03:49 +080040endif
41
42boot := arch/nds32/boot
43core-$(BUILTIN_DTB) += $(boot)/dts/
44
45.PHONY: FORCE
46
47Image: vmlinux
48 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
49
50
51PHONY += vdso_install
52vdso_install:
53 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
54
55prepare: vdso_prepare
56vdso_prepare: prepare0
57 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
58
59CLEAN_FILES += include/asm-nds32/constants.h*
60
61# We use MRPROPER_FILES and CLEAN_FILES now
62archclean:
63 $(Q)$(MAKE) $(clean)=$(boot)
64
65define archhelp
66 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
67endef