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 | |
| 6 | comma = , |
| 7 | |
Zong Li | a180825 | 2018-08-15 10:45:59 +0800 | [diff] [blame] | 8 | ifdef CONFIG_FUNCTION_TRACER |
| 9 | arch-y += -malways-save-lp -mno-relax |
| 10 | endif |
| 11 | |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 12 | KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog) |
| 13 | KBUILD_CFLAGS += -mcmodel=large |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 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/ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 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 |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 38 | KBUILD_CFLAGS += $(call cc-option, -EL) |
Greentime Hu | b3b112b | 2018-04-19 16:26:43 +0800 | [diff] [blame] | 39 | KBUILD_AFLAGS += $(call cc-option, -EL) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 40 | KBUILD_LDFLAGS += $(call cc-option, -EL) |
Luc Van Oostenryck | 97d1e3d | 2018-05-28 18:29:02 +0200 | [diff] [blame] | 41 | CHECKFLAGS += -D__NDS32_EL__ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 42 | else |
Greentime Hu | d78a62f | 2018-03-01 10:54:07 +0800 | [diff] [blame] | 43 | KBUILD_CFLAGS += $(call cc-option, -EB) |
Greentime Hu | b3b112b | 2018-04-19 16:26:43 +0800 | [diff] [blame] | 44 | KBUILD_AFLAGS += $(call cc-option, -EB) |
Masahiro Yamada | d503ac5 | 2018-08-24 08:20:39 +0900 | [diff] [blame] | 45 | KBUILD_LDFLAGS += $(call cc-option, -EB) |
Luc Van Oostenryck | 97d1e3d | 2018-05-28 18:29:02 +0200 | [diff] [blame] | 46 | CHECKFLAGS += -D__NDS32_EB__ |
Greentime Hu | e71ea3b | 2017-10-25 15:03:49 +0800 | [diff] [blame] | 47 | endif |
| 48 | |
| 49 | boot := arch/nds32/boot |
| 50 | core-$(BUILTIN_DTB) += $(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 |