Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. OBJCOPYFLAGS :=-O binary
  3. GZFLAGS :=-9
  4. ifdef CONFIG_CPU_HAS_FPU
  5. FPUEXT = f
  6. endif
  7. ifdef CONFIG_CPU_HAS_VDSP
  8. VDSPEXT = v
  9. endif
  10. ifdef CONFIG_CPU_HAS_TEE
  11. TEEEXT = t
  12. endif
  13. ifdef CONFIG_CPU_CK610
  14. CPUTYPE = ck610
  15. CSKYABI = abiv1
  16. endif
  17. ifdef CONFIG_CPU_CK810
  18. CPUTYPE = ck810
  19. CSKYABI = abiv2
  20. endif
  21. ifdef CONFIG_CPU_CK807
  22. CPUTYPE = ck807
  23. CSKYABI = abiv2
  24. endif
  25. ifdef CONFIG_CPU_CK860
  26. CPUTYPE = ck860
  27. CSKYABI = abiv2
  28. endif
  29. ifneq ($(CSKYABI),)
  30. MCPU_STR = $(CPUTYPE)$(FPUEXT)$(VDSPEXT)$(TEEEXT)
  31. KBUILD_CFLAGS += -mcpu=$(CPUTYPE) -Wa,-mcpu=$(MCPU_STR)
  32. KBUILD_CFLAGS += -DCSKYCPU_DEF_NAME=\"$(MCPU_STR)\"
  33. KBUILD_CFLAGS += -msoft-float -mdiv
  34. KBUILD_CFLAGS += -fno-tree-vectorize
  35. endif
  36. KBUILD_CFLAGS += -pipe
  37. ifeq ($(CSKYABI),abiv2)
  38. KBUILD_CFLAGS += -mno-stack-size
  39. endif
  40. ifdef CONFIG_FRAME_POINTER
  41. KBUILD_CFLAGS += -mbacktrace
  42. endif
  43. abidirs := $(patsubst %,arch/csky/%/,$(CSKYABI))
  44. KBUILD_CFLAGS += $(patsubst %,-I$(srctree)/%inc,$(abidirs))
  45. KBUILD_CPPFLAGS += -mlittle-endian
  46. LDFLAGS += -EL
  47. KBUILD_AFLAGS += $(KBUILD_CFLAGS)
  48. core-y += arch/csky/$(CSKYABI)/
  49. libs-y += arch/csky/lib/ \
  50. $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
  51. boot := arch/csky/boot
  52. all: zImage
  53. zImage Image uImage: vmlinux
  54. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  55. define archhelp
  56. echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
  57. echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  58. echo ' uImage - U-Boot wrapped zImage'
  59. endef