blob: 78e0396adf2ac28ab8cc23f0427303b10d2207b2 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# This is a simple Makefile to test some of the RAID-6 code
3# from userspace.
4#
5
6CC = gcc
7OPTFLAGS = -O2 # Adjust as desired
8CFLAGS = -I.. -g $(OPTFLAGS)
9LD = ld
10PERL = perl
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070011AR = ar
12RANLIB = ranlib
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
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 Anvind7e70ba2005-09-16 19:27:29 -070023all: raid6.a raid6test
Linus Torvalds1da177e2005-04-16 15:20:36 -070024
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070025raid6.a: raid6int1.o raid6int2.o raid6int4.o raid6int8.o raid6int16.o \
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 raid6int32.o \
27 raid6mmx.o raid6sse1.o raid6sse2.o \
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070028 raid6altivec1.o raid6altivec2.o raid6altivec4.o raid6altivec8.o \
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 raid6recov.o raid6algos.o \
30 raid6tables.o
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070031 rm -f $@
32 $(AR) cq $@ $^
33 $(RANLIB) $@
Linus Torvalds1da177e2005-04-16 15:20:36 -070034
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070035raid6test: test.c raid6.a
Linus Torvalds1da177e2005-04-16 15:20:36 -070036 $(CC) $(CFLAGS) -o raid6test $^
37
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070038raid6altivec1.c: raid6altivec.uc ../unroll.pl
39 $(PERL) ../unroll.pl 1 < raid6altivec.uc > $@
40
41raid6altivec2.c: raid6altivec.uc ../unroll.pl
42 $(PERL) ../unroll.pl 2 < raid6altivec.uc > $@
43
44raid6altivec4.c: raid6altivec.uc ../unroll.pl
45 $(PERL) ../unroll.pl 4 < raid6altivec.uc > $@
46
47raid6altivec8.c: raid6altivec.uc ../unroll.pl
48 $(PERL) ../unroll.pl 8 < raid6altivec.uc > $@
49
Linus Torvalds1da177e2005-04-16 15:20:36 -070050raid6int1.c: raid6int.uc ../unroll.pl
51 $(PERL) ../unroll.pl 1 < raid6int.uc > $@
52
53raid6int2.c: raid6int.uc ../unroll.pl
54 $(PERL) ../unroll.pl 2 < raid6int.uc > $@
55
56raid6int4.c: raid6int.uc ../unroll.pl
57 $(PERL) ../unroll.pl 4 < raid6int.uc > $@
58
59raid6int8.c: raid6int.uc ../unroll.pl
60 $(PERL) ../unroll.pl 8 < raid6int.uc > $@
61
62raid6int16.c: raid6int.uc ../unroll.pl
63 $(PERL) ../unroll.pl 16 < raid6int.uc > $@
64
65raid6int32.c: raid6int.uc ../unroll.pl
66 $(PERL) ../unroll.pl 32 < raid6int.uc > $@
67
68raid6tables.c: mktables
69 ./mktables > raid6tables.c
70
71clean:
H. Peter Anvind7e70ba2005-09-16 19:27:29 -070072 rm -f *.o *.a mktables mktables.c raid6int.uc raid6*.c raid6test
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
74spotless: clean
75 rm -f *~