Merge tag 'leaks-4.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tobin...
[linux-2.6-microblaze.git] / arch / nds32 / Makefile
1 LDFLAGS_vmlinux := --no-undefined -X
2 OBJCOPYFLAGS    := -O binary -R .note -R .note.gnu.build-id -R .comment -S
3
4 KBUILD_DEFCONFIG := defconfig
5
6 comma = ,
7
8 KBUILD_CFLAGS   += $(call cc-option, -mno-sched-prolog-epilog)
9 KBUILD_CFLAGS   += -mcmodel=large
10
11 KBUILD_CFLAGS   +=$(arch-y) $(tune-y)
12 KBUILD_AFLAGS   +=$(arch-y) $(tune-y)
13
14 #Default value
15 head-y           := arch/nds32/kernel/head.o
16 textaddr-y       := $(CONFIG_PAGE_OFFSET)+0xc000
17
18 TEXTADDR := $(textaddr-y)
19
20 export  TEXTADDR
21
22
23 # If we have a machine-specific directory, then include it in the build.
24 core-y                          += arch/nds32/kernel/ arch/nds32/mm/
25 libs-y                          += arch/nds32/lib/
26 LIBGCC_PATH                     := \
27   $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
28 libs-y                          += $(LIBGCC_PATH)
29
30 ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
31 BUILTIN_DTB := y
32 else
33 BUILTIN_DTB := n
34 endif
35
36 ifdef CONFIG_CPU_LITTLE_ENDIAN
37 KBUILD_CFLAGS   += $(call cc-option, -EL)
38 else
39 KBUILD_CFLAGS   += $(call cc-option, -EB)
40 endif
41
42 boot := arch/nds32/boot
43 core-$(BUILTIN_DTB) += $(boot)/dts/
44
45 .PHONY: FORCE
46
47 Image: vmlinux
48         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
49
50
51 PHONY += vdso_install
52 vdso_install:
53         $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
54
55 prepare: vdso_prepare
56 vdso_prepare: prepare0
57         $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
58
59 CLEAN_FILES += include/asm-nds32/constants.h*
60
61 # We use MRPROPER_FILES and CLEAN_FILES now
62 archclean:
63         $(Q)$(MAKE) $(clean)=$(boot)
64
65 define archhelp
66   echo  '  Image         - kernel image (arch/$(ARCH)/boot/Image)'
67 endef