Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #
  2. # This is a simple Makefile to test some of the RAID-6 code
  3. # from userspace.
  4. #
  5. CC = gcc
  6. OPTFLAGS = -O2 # Adjust as desired
  7. CFLAGS = -I.. -I ../../../include -g $(OPTFLAGS)
  8. LD = ld
  9. AWK = awk -f
  10. AR = ar
  11. RANLIB = ranlib
  12. .c.o:
  13. $(CC) $(CFLAGS) -c -o $@ $<
  14. %.c: ../%.c
  15. cp -f $< $@
  16. %.uc: ../%.uc
  17. cp -f $< $@
  18. all: raid6.a raid6test
  19. raid6.a: int1.o int2.o int4.o int8.o int16.o int32.o mmx.o sse1.o sse2.o \
  20. altivec1.o altivec2.o altivec4.o altivec8.o recov.o algos.o \
  21. tables.o
  22. rm -f $@
  23. $(AR) cq $@ $^
  24. $(RANLIB) $@
  25. raid6test: test.c raid6.a
  26. $(CC) $(CFLAGS) -o raid6test $^
  27. altivec1.c: altivec.uc ../unroll.awk
  28. $(AWK) ../unroll.awk -vN=1 < altivec.uc > $@
  29. altivec2.c: altivec.uc ../unroll.awk
  30. $(AWK) ../unroll.awk -vN=2 < altivec.uc > $@
  31. altivec4.c: altivec.uc ../unroll.awk
  32. $(AWK) ../unroll.awk -vN=4 < altivec.uc > $@
  33. altivec8.c: altivec.uc ../unroll.awk
  34. $(AWK) ../unroll.awk -vN=8 < altivec.uc > $@
  35. int1.c: int.uc ../unroll.awk
  36. $(AWK) ../unroll.awk -vN=1 < int.uc > $@
  37. int2.c: int.uc ../unroll.awk
  38. $(AWK) ../unroll.awk -vN=2 < int.uc > $@
  39. int4.c: int.uc ../unroll.awk
  40. $(AWK) ../unroll.awk -vN=4 < int.uc > $@
  41. int8.c: int.uc ../unroll.awk
  42. $(AWK) ../unroll.awk -vN=8 < int.uc > $@
  43. int16.c: int.uc ../unroll.awk
  44. $(AWK) ../unroll.awk -vN=16 < int.uc > $@
  45. int32.c: int.uc ../unroll.awk
  46. $(AWK) ../unroll.awk -vN=32 < int.uc > $@
  47. tables.c: mktables
  48. ./mktables > tables.c
  49. clean:
  50. rm -f *.o *.a mktables mktables.c *.uc int*.c altivec*.c tables.c raid6test
  51. spotless: clean
  52. rm -f *~