Merge tag '9p-for-4.20' of git://github.com/martinetd/linux
[sfrench/cifs-2.6.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 ifdef CONFIG_FUNCTION_TRACER
9 arch-y += -malways-save-lp -mno-relax
10 endif
11
12 KBUILD_CFLAGS   += $(call cc-option, -mno-sched-prolog-epilog)
13 KBUILD_CFLAGS   += -mcmodel=large
14
15 KBUILD_CFLAGS   +=$(arch-y) $(tune-y)
16 KBUILD_AFLAGS   +=$(arch-y) $(tune-y)
17
18 #Default value
19 head-y           := arch/nds32/kernel/head.o
20 textaddr-y       := $(CONFIG_PAGE_OFFSET)+0xc000
21
22 TEXTADDR := $(textaddr-y)
23
24 export  TEXTADDR
25
26
27 # If we have a machine-specific directory, then include it in the build.
28 core-y                          += arch/nds32/kernel/ arch/nds32/mm/
29 libs-y                          += arch/nds32/lib/
30
31 ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
32 BUILTIN_DTB := y
33 else
34 BUILTIN_DTB := n
35 endif
36
37 ifdef CONFIG_CPU_LITTLE_ENDIAN
38 KBUILD_CFLAGS   += $(call cc-option, -EL)
39 KBUILD_AFLAGS   += $(call cc-option, -EL)
40 KBUILD_LDFLAGS  += $(call cc-option, -EL)
41 CHECKFLAGS      += -D__NDS32_EL__
42 else
43 KBUILD_CFLAGS   += $(call cc-option, -EB)
44 KBUILD_AFLAGS   += $(call cc-option, -EB)
45 KBUILD_LDFLAGS  += $(call cc-option, -EB)
46 CHECKFLAGS      += -D__NDS32_EB__
47 endif
48
49 boot := arch/nds32/boot
50 core-y += $(boot)/dts/
51
52 .PHONY: FORCE
53
54 Image: vmlinux
55         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
56
57
58 PHONY += vdso_install
59 vdso_install:
60         $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
61
62 prepare: vdso_prepare
63 vdso_prepare: prepare0
64         $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
65
66 CLEAN_FILES += include/asm-nds32/constants.h*
67
68 # We use MRPROPER_FILES and CLEAN_FILES now
69 archclean:
70         $(Q)$(MAKE) $(clean)=$(boot)
71
72 define archhelp
73   echo  '  Image         - kernel image (arch/$(ARCH)/boot/Image)'
74 endef