Makefile 1.7 KB

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