Makefile 1.5 KB

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