Thomas Gleixner | ec8f24b | 2019-05-19 13:07:45 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0-only |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 2 | LDFLAGS_vmlinux := --no-undefined -X |
| 3 | OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S |
| 4 | |
Zong Li | a180825 | 2018-08-15 10:45:59 +0800 | [diff] [blame] | 5 | ifdef CONFIG_FUNCTION_TRACER |
| 6 | arch-y += -malways-save-lp -mno-relax |
| 7 | endif |
| 8 | |
Vincent Chen | e46bf83 | 2018-11-22 11:14:34 +0800 | [diff] [blame] | 9 | # Avoid generating FPU instructions |
| 10 | arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft |
| 11 | |
Alexey Dobriyan | 04e85bb | 2021-08-02 23:43:15 +0300 | [diff] [blame] | 12 | # Enable <nds32_intrinsic.h> |
| 13 | KBUILD_CFLAGS += -isystem $(shell $(CC) -print-file-name=include) |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 14 | KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog) |
| 15 | KBUILD_CFLAGS += -mcmodel=large |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 16 | |
| 17 | KBUILD_CFLAGS +=$(arch-y) $(tune-y) |
| 18 | KBUILD_AFLAGS +=$(arch-y) $(tune-y) |
| 19 | |
| 20 | #Default value |
| 21 | head-y := arch/nds32/kernel/head.o |
| 22 | textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000 |
| 23 | |
| 24 | TEXTADDR := $(textaddr-y) |
| 25 | |
| 26 | export TEXTADDR |
| 27 | |
| 28 | |
| 29 | # If we have a machine-specific directory, then include it in the build. |
| 30 | core-y += arch/nds32/kernel/ arch/nds32/mm/ |
Vincent Chen | 1ac8325 | 2018-11-22 11:14:35 +0800 | [diff] [blame] | 31 | core-$(CONFIG_FPU) += arch/nds32/math-emu/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 32 | libs-y += arch/nds32/lib/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 33 | |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 34 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 35 | KBUILD_CFLAGS += $(call cc-option, -EL) |
Greentime Hu | b3b112b | 2018-04-19 16:26:43 +0800 | [diff] [blame] | 36 | KBUILD_AFLAGS += $(call cc-option, -EL) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 37 | KBUILD_LDFLAGS += $(call cc-option, -EL) |
Luc Van Oostenryck | 97d1e3d | 2018-05-28 18:29:02 +0200 | [diff] [blame] | 38 | CHECKFLAGS += -D__NDS32_EL__ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 39 | else |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 40 | KBUILD_CFLAGS += $(call cc-option, -EB) |
Greentime Hu | b3b112b | 2018-04-19 16:26:43 +0800 | [diff] [blame] | 41 | KBUILD_AFLAGS += $(call cc-option, -EB) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 42 | KBUILD_LDFLAGS += $(call cc-option, -EB) |
Luc Van Oostenryck | 97d1e3d | 2018-05-28 18:29:02 +0200 | [diff] [blame] | 43 | CHECKFLAGS += -D__NDS32_EB__ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 44 | endif |
| 45 | |
| 46 | boot := arch/nds32/boot |
Rob Herring | 37c8a5f | 2018-01-10 15:19:37 -0600 | [diff] [blame] | 47 | core-y += $(boot)/dts/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 48 | |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 49 | Image: vmlinux |
| 50 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 51 | |
| 52 | |
| 53 | PHONY += vdso_install |
| 54 | vdso_install: |
| 55 | $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@ |
| 56 | |
| 57 | prepare: vdso_prepare |
| 58 | vdso_prepare: prepare0 |
| 59 | $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h |
| 60 | |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 61 | define archhelp |
| 62 | echo ' Image - kernel image (arch/$(ARCH)/boot/Image)' |
| 63 | endef |