Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. head-y := arch/csky/kernel/head.o
  49. core-y += arch/csky/kernel/
  50. core-y += arch/csky/mm/
  51. core-y += arch/csky/$(CSKYABI)/
  52. libs-y += arch/csky/lib/ \
  53. $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
  54. boot := arch/csky/boot
  55. core-y += $(boot)/dts/
  56. all: zImage
  57. zImage Image uImage: vmlinux
  58. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  59. archclean:
  60. $(Q)$(MAKE) $(clean)=$(boot)
  61. define archhelp
  62. echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
  63. echo ' Image - Uncompressed kernel image (arch/$(ARCH)/boot/Image)'
  64. echo ' uImage - U-Boot wrapped zImage'
  65. endef