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