Makefile 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. LDFLAGS_vmlinux := --no-undefined -X
  3. OBJCOPYFLAGS := -O binary -R .note -R .note.gnu.build-id -R .comment -S
  4. ifdef CONFIG_FUNCTION_TRACER
  5. arch-y += -malways-save-lp -mno-relax
  6. endif
  7. # Avoid generating FPU instructions
  8. arch-y += -mno-ext-fpu-sp -mno-ext-fpu-dp -mfloat-abi=soft
  9. KBUILD_CFLAGS += $(call cc-option, -mno-sched-prolog-epilog)
  10. KBUILD_CFLAGS += -mcmodel=large
  11. KBUILD_CFLAGS +=$(arch-y) $(tune-y)
  12. KBUILD_AFLAGS +=$(arch-y) $(tune-y)
  13. #Default value
  14. head-y := arch/nds32/kernel/head.o
  15. textaddr-y := $(CONFIG_PAGE_OFFSET)+0xc000
  16. TEXTADDR := $(textaddr-y)
  17. export TEXTADDR
  18. # If we have a machine-specific directory, then include it in the build.
  19. core-y += arch/nds32/kernel/ arch/nds32/mm/
  20. core-$(CONFIG_FPU) += arch/nds32/math-emu/
  21. libs-y += arch/nds32/lib/
  22. ifneq '$(CONFIG_NDS32_BUILTIN_DTB)' '""'
  23. BUILTIN_DTB := y
  24. else
  25. BUILTIN_DTB := n
  26. endif
  27. ifdef CONFIG_CPU_LITTLE_ENDIAN
  28. KBUILD_CFLAGS += $(call cc-option, -EL)
  29. KBUILD_AFLAGS += $(call cc-option, -EL)
  30. KBUILD_LDFLAGS += $(call cc-option, -EL)
  31. CHECKFLAGS += -D__NDS32_EL__
  32. else
  33. KBUILD_CFLAGS += $(call cc-option, -EB)
  34. KBUILD_AFLAGS += $(call cc-option, -EB)
  35. KBUILD_LDFLAGS += $(call cc-option, -EB)
  36. CHECKFLAGS += -D__NDS32_EB__
  37. endif
  38. boot := arch/nds32/boot
  39. core-y += $(boot)/dts/
  40. Image: vmlinux
  41. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  42. PHONY += vdso_install
  43. vdso_install:
  44. $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso $@
  45. prepare: vdso_prepare
  46. vdso_prepare: prepare0
  47. $(Q)$(MAKE) $(build)=arch/nds32/kernel/vdso include/generated/vdso-offsets.h
  48. archclean:
  49. $(Q)$(MAKE) $(clean)=$(boot)
  50. define archhelp
  51. echo ' Image - kernel image (arch/$(ARCH)/boot/Image)'
  52. endef