Makefile 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. obj-$(CONFIG_RAID6_PQ) += raid6_pq.o
  2. raid6_pq-y += algos.o recov.o tables.o int1.o int2.o int4.o \
  3. int8.o int16.o int32.o
  4. raid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o
  5. raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o
  6. raid6_pq-$(CONFIG_KERNEL_MODE_NEON) += neon.o neon1.o neon2.o neon4.o neon8.o
  7. raid6_pq-$(CONFIG_TILEGX) += tilegx8.o
  8. hostprogs-y += mktables
  9. quiet_cmd_unroll = UNROLL $@
  10. cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) \
  11. < $< > $@ || ( rm -f $@ && exit 1 )
  12. ifeq ($(CONFIG_ALTIVEC),y)
  13. altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
  14. endif
  15. # The GCC option -ffreestanding is required in order to compile code containing
  16. # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
  17. ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
  18. NEON_FLAGS := -ffreestanding
  19. ifeq ($(ARCH),arm)
  20. NEON_FLAGS += -mfloat-abi=softfp -mfpu=neon
  21. endif
  22. ifeq ($(ARCH),arm64)
  23. CFLAGS_REMOVE_neon1.o += -mgeneral-regs-only
  24. CFLAGS_REMOVE_neon2.o += -mgeneral-regs-only
  25. CFLAGS_REMOVE_neon4.o += -mgeneral-regs-only
  26. CFLAGS_REMOVE_neon8.o += -mgeneral-regs-only
  27. endif
  28. endif
  29. targets += int1.c
  30. $(obj)/int1.c: UNROLL := 1
  31. $(obj)/int1.c: $(src)/int.uc $(src)/unroll.awk FORCE
  32. $(call if_changed,unroll)
  33. targets += int2.c
  34. $(obj)/int2.c: UNROLL := 2
  35. $(obj)/int2.c: $(src)/int.uc $(src)/unroll.awk FORCE
  36. $(call if_changed,unroll)
  37. targets += int4.c
  38. $(obj)/int4.c: UNROLL := 4
  39. $(obj)/int4.c: $(src)/int.uc $(src)/unroll.awk FORCE
  40. $(call if_changed,unroll)
  41. targets += int8.c
  42. $(obj)/int8.c: UNROLL := 8
  43. $(obj)/int8.c: $(src)/int.uc $(src)/unroll.awk FORCE
  44. $(call if_changed,unroll)
  45. targets += int16.c
  46. $(obj)/int16.c: UNROLL := 16
  47. $(obj)/int16.c: $(src)/int.uc $(src)/unroll.awk FORCE
  48. $(call if_changed,unroll)
  49. targets += int32.c
  50. $(obj)/int32.c: UNROLL := 32
  51. $(obj)/int32.c: $(src)/int.uc $(src)/unroll.awk FORCE
  52. $(call if_changed,unroll)
  53. CFLAGS_altivec1.o += $(altivec_flags)
  54. targets += altivec1.c
  55. $(obj)/altivec1.c: UNROLL := 1
  56. $(obj)/altivec1.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
  57. $(call if_changed,unroll)
  58. CFLAGS_altivec2.o += $(altivec_flags)
  59. targets += altivec2.c
  60. $(obj)/altivec2.c: UNROLL := 2
  61. $(obj)/altivec2.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
  62. $(call if_changed,unroll)
  63. CFLAGS_altivec4.o += $(altivec_flags)
  64. targets += altivec4.c
  65. $(obj)/altivec4.c: UNROLL := 4
  66. $(obj)/altivec4.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
  67. $(call if_changed,unroll)
  68. CFLAGS_altivec8.o += $(altivec_flags)
  69. targets += altivec8.c
  70. $(obj)/altivec8.c: UNROLL := 8
  71. $(obj)/altivec8.c: $(src)/altivec.uc $(src)/unroll.awk FORCE
  72. $(call if_changed,unroll)
  73. CFLAGS_neon1.o += $(NEON_FLAGS)
  74. targets += neon1.c
  75. $(obj)/neon1.c: UNROLL := 1
  76. $(obj)/neon1.c: $(src)/neon.uc $(src)/unroll.awk FORCE
  77. $(call if_changed,unroll)
  78. CFLAGS_neon2.o += $(NEON_FLAGS)
  79. targets += neon2.c
  80. $(obj)/neon2.c: UNROLL := 2
  81. $(obj)/neon2.c: $(src)/neon.uc $(src)/unroll.awk FORCE
  82. $(call if_changed,unroll)
  83. CFLAGS_neon4.o += $(NEON_FLAGS)
  84. targets += neon4.c
  85. $(obj)/neon4.c: UNROLL := 4
  86. $(obj)/neon4.c: $(src)/neon.uc $(src)/unroll.awk FORCE
  87. $(call if_changed,unroll)
  88. CFLAGS_neon8.o += $(NEON_FLAGS)
  89. targets += neon8.c
  90. $(obj)/neon8.c: UNROLL := 8
  91. $(obj)/neon8.c: $(src)/neon.uc $(src)/unroll.awk FORCE
  92. $(call if_changed,unroll)
  93. targets += tilegx8.c
  94. $(obj)/tilegx8.c: UNROLL := 8
  95. $(obj)/tilegx8.c: $(src)/tilegx.uc $(src)/unroll.awk FORCE
  96. $(call if_changed,unroll)
  97. quiet_cmd_mktable = TABLE $@
  98. cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
  99. targets += tables.c
  100. $(obj)/tables.c: $(obj)/mktables FORCE
  101. $(call if_changed,mktable)