Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 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 | |
Zong Li | a180825 | 2018-08-15 10:45:59 +0800 | [diff] [blame] | 6 | ifdef CONFIG_FUNCTION_TRACER |
| 7 | arch-y += -malways-save-lp -mno-relax |
| 8 | endif |
| 9 | |
Vincent Chen | e46bf83 | 2018-11-22 11:14:34 +0800 | [diff] [blame] | 10 | # Avoid generating FPU instructions |
| 11 | arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft |
| 12 | |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 13 | KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog) |
| 14 | KBUILD_CFLAGS += -mcmodel=large |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 15 | |
| 16 | KBUILD_CFLAGS +=$(arch-y) $(tune-y) |
| 17 | KBUILD_AFLAGS +=$(arch-y) $(tune-y) |
| 18 | |
| 19 | #Default value |
| 20 | head-y := arch/nds32/kernel/head.o |
| 21 | textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000 |
| 22 | |
| 23 | TEXTADDR := $(textaddr-y) |
| 24 | |
| 25 | export TEXTADDR |
| 26 | |
| 27 | |
| 28 | # If we have a machine-specific directory, then include it in the build. |
| 29 | core-y += arch/nds32/kernel/ arch/nds32/mm/ |
Vincent Chen | 1ac8325 | 2018-11-22 11:14:35 +0800 | [diff] [blame] | 30 | core-$(CONFIG_FPU) += arch/nds32/math-emu/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 31 | libs-y += arch/nds32/lib/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 32 | |
| 33 | ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' |
| 34 | BUILTIN_DTB := y |
| 35 | else |
| 36 | BUILTIN_DTB := n |
| 37 | endif |
| 38 | |
| 39 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 40 | KBUILD_CFLAGS += $(call cc-option, -EL) |
Greentime Hu | b3b112b | 2018-04-19 16:26:43 +0800 | [diff] [blame] | 41 | KBUILD_AFLAGS += $(call cc-option, -EL) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 42 | KBUILD_LDFLAGS += $(call cc-option, -EL) |
Luc Van Oostenryck | 97d1e3d | 2018-05-28 18:29:02 +0200 | [diff] [blame] | 43 | CHECKFLAGS += -D__NDS32_EL__ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 44 | else |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 45 | KBUILD_CFLAGS += $(call cc-option, -EB) |
Greentime Hu | b3b112b | 2018-04-19 16:26:43 +0800 | [diff] [blame] | 46 | KBUILD_AFLAGS += $(call cc-option, -EB) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 47 | KBUILD_LDFLAGS += $(call cc-option, -EB) |
Luc Van Oostenryck | 97d1e3d | 2018-05-28 18:29:02 +0200 | [diff] [blame] | 48 | CHECKFLAGS += -D__NDS32_EB__ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 49 | endif |
| 50 | |
| 51 | boot := arch/nds32/boot |
Rob Herring | 37c8a5f | 2018-01-10 15:19:37 -0600 | [diff] [blame] | 52 | core-y += $(boot)/dts/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 53 | |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 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 | |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 66 | archclean: |
| 67 | $(Q)$(MAKE) $(clean)=$(boot) |
| 68 | |
| 69 | define archhelp |
| 70 | echo ' Image - kernel image (arch/$(ARCH)/boot/Image)' |
| 71 | endef |