Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # |
| 2 | # This is a simple Makefile to test some of the RAID-6 code |
| 3 | # from userspace. |
| 4 | # |
| 5 | |
| 6 | CC = gcc |
| 7 | OPTFLAGS = -O2 # Adjust as desired |
Dan Williams | f701d58 | 2009-03-31 15:09:39 +1100 | [diff] [blame] | 8 | CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | LD = ld |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 10 | AWK = awk |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 11 | AR = ar |
| 12 | RANLIB = ranlib |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | |
| 14 | .c.o: |
| 15 | $(CC) $(CFLAGS) -c -o $@ $< |
| 16 | |
| 17 | %.c: ../%.c |
| 18 | cp -f $< $@ |
| 19 | |
| 20 | %.uc: ../%.uc |
| 21 | cp -f $< $@ |
| 22 | |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 23 | all: raid6.a raid6test |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 24 | |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 25 | raid6.a: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | raid6int32.o \ |
| 27 | raid6mmx.o raid6sse1.o raid6sse2.o \ |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 28 | raid6altivec1.o raid6altivec2.o raid6altivec4.o raid6altivec8.o \ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | raid6recov.o raid6algos.o \ |
| 30 | raid6tables.o |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 31 | rm -f $@ |
| 32 | $(AR) cq $@ $^ |
| 33 | $(RANLIB) $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 35 | raid6test: test.c raid6.a |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | $(CC) $(CFLAGS) -o raid6test $^ |
| 37 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 38 | raid6altivec1.c: raid6altivec.uc ../unroll.awk |
| 39 | $(AWK) ../unroll.awk -vN=1 < raid6altivec.uc > $@ |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 40 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 41 | raid6altivec2.c: raid6altivec.uc ../unroll.awk |
| 42 | $(AWK) ../unroll.awk -vN=2 < raid6altivec.uc > $@ |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 43 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 44 | raid6altivec4.c: raid6altivec.uc ../unroll.awk |
| 45 | $(AWK) ../unroll.awk -vN=4 < raid6altivec.uc > $@ |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 46 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 47 | raid6altivec8.c: raid6altivec.uc ../unroll.awk |
| 48 | $(AWK) ../unroll.awk -vN=8 < raid6altivec.uc > $@ |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 49 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 50 | raid6int1.c: raid6int.uc ../unroll.awk |
| 51 | $(AWK) ../unroll.awk -vN=1 < raid6int.uc > $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 53 | raid6int2.c: raid6int.uc ../unroll.awk |
| 54 | $(AWK) ../unroll.awk -vN=2 < raid6int.uc > $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 55 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 56 | raid6int4.c: raid6int.uc ../unroll.awk |
| 57 | $(AWK) ../unroll.awk -vN=4 < raid6int.uc > $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 59 | raid6int8.c: raid6int.uc ../unroll.awk |
| 60 | $(AWK) ../unroll.awk -vN=8 < raid6int.uc > $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 62 | raid6int16.c: raid6int.uc ../unroll.awk |
| 63 | $(AWK) ../unroll.awk -vN=16 < raid6int.uc > $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
Vladimir Dronnikov | dce3a7a | 2009-10-16 16:25:19 +1100 | [diff] [blame] | 65 | raid6int32.c: raid6int.uc ../unroll.awk |
| 66 | $(AWK) ../unroll.awk -vN=32 < raid6int.uc > $@ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
| 68 | raid6tables.c: mktables |
| 69 | ./mktables > raid6tables.c |
| 70 | |
| 71 | clean: |
H. Peter Anvin | d7e70ba | 2005-09-16 19:27:29 -0700 | [diff] [blame] | 72 | rm -f *.o *.a mktables mktables.c raid6int.uc raid6*.c raid6test |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | |
| 74 | spotless: clean |
| 75 | rm -f *~ |