blob: 54b4de9d48b6c477e506e9ee02f506f165743daf [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
8KBUILD_CFLAGS +=-mno-sched-prolog-epilog -mcmodel=large
9
10KBUILD_CFLAGS +=$(arch-y) $(tune-y)
11KBUILD_AFLAGS +=$(arch-y) $(tune-y)
12
13#Default value
14head-y := arch/nds32/kernel/head.o
15textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
16
17TEXTADDR := $(textaddr-y)
18
19export TEXTADDR
20
21
22# If we have a machine-specific directory, then include it in the build.
23core-y += arch/nds32/kernel/ arch/nds32/mm/
24libs-y += arch/nds32/lib/
25LIBGCC_PATH := \
26 $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
27libs-y += $(LIBGCC_PATH)
28
29ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
30BUILTIN_DTB := y
31else
32BUILTIN_DTB := n
33endif
34
35ifdef CONFIG_CPU_LITTLE_ENDIAN
36KBUILD_CFLAGS += -EL
37else
38KBUILD_CFLAGS += -EB
39endif
40
41boot := arch/nds32/boot
42core-$(BUILTIN_DTB) += $(boot)/dts/
43
44.PHONY: FORCE
45
46Image: vmlinux
47 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
48
49
50PHONY += vdso_install
51vdso_install:
52 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
53
54prepare: vdso_prepare
55vdso_prepare: prepare0
56 $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
57
58CLEAN_FILES += include/asm-nds32/constants.h*
59
60# We use MRPROPER_FILES and CLEAN_FILES now
61archclean:
62 $(Q)$(MAKE) $(clean)=$(boot)
63
64define archhelp
65 echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
66endef