David Woodhouse | cc4589e | 2010-08-11 00:19:05 +0100 | [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 |
| 8 | CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS) |
| 9 | LD = ld |
| 10 | AWK = awk -f |
| 11 | AR = ar |
| 12 | RANLIB = ranlib |
| 13 | |
| 14 | .c.o: |
| 15 | $(CC) $(CFLAGS) -c -o $@ $< |
| 16 | |
| 17 | %.c: ../%.c |
| 18 | cp -f $< $@ |
| 19 | |
| 20 | %.uc: ../%.uc |
| 21 | cp -f $< $@ |
| 22 | |
| 23 | all: raid6.a raid6test |
| 24 | |
| 25 | raid6.a: int1.o int2.o int4.o int8.o int16.o int32.o mmx.o sse1.o sse2.o \ |
| 26 | altivec1.o altivec2.o altivec4.o altivec8.o recov.o algos.o \ |
| 27 | tables.o |
| 28 | rm -f $@ |
| 29 | $(AR) cq $@ $^ |
| 30 | $(RANLIB) $@ |
| 31 | |
| 32 | raid6test: test.c raid6.a |
| 33 | $(CC) $(CFLAGS) -o raid6test $^ |
| 34 | |
| 35 | altivec1.c: altivec.uc ../unroll.awk |
| 36 | $(AWK) ../unroll.awk -vN=1 < altivec.uc > $@ |
| 37 | |
| 38 | altivec2.c: altivec.uc ../unroll.awk |
| 39 | $(AWK) ../unroll.awk -vN=2 < altivec.uc > $@ |
| 40 | |
| 41 | altivec4.c: altivec.uc ../unroll.awk |
| 42 | $(AWK) ../unroll.awk -vN=4 < altivec.uc > $@ |
| 43 | |
| 44 | altivec8.c: altivec.uc ../unroll.awk |
| 45 | $(AWK) ../unroll.awk -vN=8 < altivec.uc > $@ |
| 46 | |
| 47 | int1.c: int.uc ../unroll.awk |
| 48 | $(AWK) ../unroll.awk -vN=1 < int.uc > $@ |
| 49 | |
| 50 | int2.c: int.uc ../unroll.awk |
| 51 | $(AWK) ../unroll.awk -vN=2 < int.uc > $@ |
| 52 | |
| 53 | int4.c: int.uc ../unroll.awk |
| 54 | $(AWK) ../unroll.awk -vN=4 < int.uc > $@ |
| 55 | |
| 56 | int8.c: int.uc ../unroll.awk |
| 57 | $(AWK) ../unroll.awk -vN=8 < int.uc > $@ |
| 58 | |
| 59 | int16.c: int.uc ../unroll.awk |
| 60 | $(AWK) ../unroll.awk -vN=16 < int.uc > $@ |
| 61 | |
| 62 | int32.c: int.uc ../unroll.awk |
| 63 | $(AWK) ../unroll.awk -vN=32 < int.uc > $@ |
| 64 | |
| 65 | tables.c: mktables |
| 66 | ./mktables > tables.c |
| 67 | |
| 68 | clean: |
| 69 | rm -f *.o *.a mktables mktables.c *.uc int*.c altivec*.c tables.c raid6test |
| 70 | |
| 71 | spotless: clean |
| 72 | rm -f *~ |