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 | |
| 8 | KBUILD_CFLAGS +=-mno-sched-prolog-epilog -mcmodel=large |
| 9 | |
| 10 | KBUILD_CFLAGS +=$(arch-y) $(tune-y) |
| 11 | KBUILD_AFLAGS +=$(arch-y) $(tune-y) |
| 12 | |
| 13 | #Default value |
| 14 | head-y := arch/nds32/kernel/head.o |
| 15 | textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000 |
| 16 | |
| 17 | TEXTADDR := $(textaddr-y) |
| 18 | |
| 19 | export TEXTADDR |
| 20 | |
| 21 | |
| 22 | # If we have a machine-specific directory, then include it in the build. |
| 23 | core-y += arch/nds32/kernel/ arch/nds32/mm/ |
| 24 | libs-y += arch/nds32/lib/ |
| 25 | LIBGCC_PATH := \ |
| 26 | $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name) |
| 27 | libs-y += $(LIBGCC_PATH) |
| 28 | |
| 29 | ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""' |
| 30 | BUILTIN_DTB := y |
| 31 | else |
| 32 | BUILTIN_DTB := n |
| 33 | endif |
| 34 | |
| 35 | ifdef CONFIG_CPU_LITTLE_ENDIAN |
| 36 | KBUILD_CFLAGS += -EL |
| 37 | else |
| 38 | KBUILD_CFLAGS += -EB |
| 39 | endif |
| 40 | |
| 41 | boot := arch/nds32/boot |
| 42 | core-$(BUILTIN_DTB) += $(boot)/dts/ |
| 43 | |
| 44 | .PHONY: FORCE |
| 45 | |
| 46 | Image: vmlinux |
| 47 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 48 | |
| 49 | |
| 50 | PHONY += vdso_install |
| 51 | vdso_install: |
| 52 | $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@ |
| 53 | |
| 54 | prepare: vdso_prepare |
| 55 | vdso_prepare: prepare0 |
| 56 | $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h |
| 57 | |
| 58 | CLEAN_FILES += include/asm-nds32/constants.h* |
| 59 | |
| 60 | # We use MRPROPER_FILES and CLEAN_FILES now |
| 61 | archclean: |
| 62 | $(Q)$(MAKE) $(clean)=$(boot) |
| 63 | |
| 64 | define archhelp |
| 65 | echo ' Image - kernel image (arch/$(ARCH)/boot/Image)' |
| 66 | endef |