Makefile 3.8 KB

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