xref: /linux/lib/raid6/Makefile (revision 0d456bad36d42d16022be045c8a53ddbb59ee478)
1obj-$(CONFIG_RAID6_PQ)	+= raid6_pq.o
2
3raid6_pq-y	+= algos.o recov.o tables.o int1.o int2.o int4.o \
4		   int8.o int16.o int32.o
5
6raid6_pq-$(CONFIG_X86) += recov_ssse3.o recov_avx2.o mmx.o sse1.o sse2.o avx2.o
7raid6_pq-$(CONFIG_ALTIVEC) += altivec1.o altivec2.o altivec4.o altivec8.o
8
9hostprogs-y	+= mktables
10
11quiet_cmd_unroll = UNROLL  $@
12      cmd_unroll = $(AWK) -f$(srctree)/$(src)/unroll.awk -vN=$(UNROLL) \
13                   < $< > $@ || ( rm -f $@ && exit 1 )
14
15ifeq ($(CONFIG_ALTIVEC),y)
16altivec_flags := -maltivec -mabi=altivec
17endif
18
19targets += int1.c
20$(obj)/int1.c:   UNROLL := 1
21$(obj)/int1.c:   $(src)/int.uc $(src)/unroll.awk FORCE
22	$(call if_changed,unroll)
23
24targets += int2.c
25$(obj)/int2.c:   UNROLL := 2
26$(obj)/int2.c:   $(src)/int.uc $(src)/unroll.awk FORCE
27	$(call if_changed,unroll)
28
29targets += int4.c
30$(obj)/int4.c:   UNROLL := 4
31$(obj)/int4.c:   $(src)/int.uc $(src)/unroll.awk FORCE
32	$(call if_changed,unroll)
33
34targets += int8.c
35$(obj)/int8.c:   UNROLL := 8
36$(obj)/int8.c:   $(src)/int.uc $(src)/unroll.awk FORCE
37	$(call if_changed,unroll)
38
39targets += int16.c
40$(obj)/int16.c:  UNROLL := 16
41$(obj)/int16.c:  $(src)/int.uc $(src)/unroll.awk FORCE
42	$(call if_changed,unroll)
43
44targets += int32.c
45$(obj)/int32.c:  UNROLL := 32
46$(obj)/int32.c:  $(src)/int.uc $(src)/unroll.awk FORCE
47	$(call if_changed,unroll)
48
49CFLAGS_altivec1.o += $(altivec_flags)
50targets += altivec1.c
51$(obj)/altivec1.c:   UNROLL := 1
52$(obj)/altivec1.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
53	$(call if_changed,unroll)
54
55CFLAGS_altivec2.o += $(altivec_flags)
56targets += altivec2.c
57$(obj)/altivec2.c:   UNROLL := 2
58$(obj)/altivec2.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
59	$(call if_changed,unroll)
60
61CFLAGS_altivec4.o += $(altivec_flags)
62targets += altivec4.c
63$(obj)/altivec4.c:   UNROLL := 4
64$(obj)/altivec4.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
65	$(call if_changed,unroll)
66
67CFLAGS_altivec8.o += $(altivec_flags)
68targets += altivec8.c
69$(obj)/altivec8.c:   UNROLL := 8
70$(obj)/altivec8.c:   $(src)/altivec.uc $(src)/unroll.awk FORCE
71	$(call if_changed,unroll)
72
73quiet_cmd_mktable = TABLE   $@
74      cmd_mktable = $(obj)/mktables > $@ || ( rm -f $@ && exit 1 )
75
76targets += tables.c
77$(obj)/tables.c: $(obj)/mktables FORCE
78	$(call if_changed,mktable)
79