Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. CPP=g++
  2. CPPFLAGS=-g -Wall -DCHECK
  3. CC=gcc
  4. CFLAGS=-std=c99 -O3 -fomit-frame-pointer
  5. LFLAGS=-lm
  6. all: as check c
  7. c: bilintest-c \
  8. speedtest-c
  9. as: bilintest-as \
  10. speedtest-as \
  11. test_curvepoint_multiscalar-as \
  12. test_twistpoint_multiscalar-as
  13. check: bilintest-check \
  14. speedtest-check \
  15. test_curvepoint_multiscalar-check \
  16. test_twistpoint_multiscalar-check
  17. bilintest-check: bilintest.c linefunction.c optate.c fpe.c fp2e.c fp6e.c fp12e.c curvepoint_fp.c twistpoint_fp2.c final_expo.c scalar.c parameters.c mul.c mydouble.c
  18. $(CPP) $(CPPFLAGS) -DNTESTS=20 -o $@ $^
  19. bilintest-c: bilintest.c linefunction.c optate.c fpe.c fp2e.c fp6e.c fp12e.c curvepoint_fp.c twistpoint_fp2.c final_expo.c scalar.c parameters.c mul.c mydouble.c
  20. $(CC) $(CFLAGS) $(LFLAGS) -DNTESTS=1000 -o $@ $^
  21. bilintest-as: bilintest.c linefunction.c optate.c fpe.c fp2e.c fp6e.c fp12e.c curvepoint_fp.c twistpoint_fp2.c final_expo.c scalar.c parameters.c mul.c mydouble.c asfunctions.a
  22. $(CC) $(CFLAGS) $(LFLAGS) -DQHASM -DNTESTS=1000000 -o $@ $^
  23. speedtest-check: speedtest.c linefunction.c optate.c fpe.c fp2e.c fp6e.c fp12e.c curvepoint_fp.c twistpoint_fp2.c final_expo.c scalar.c parameters.c mul.c mydouble.c
  24. $(CPP) $(CPPFLAGS) -o $@ $^
  25. speedtest-c: speedtest.c linefunction.c optate.c fpe.c fp2e.c fp6e.c fp12e.c curvepoint_fp.c twistpoint_fp2.c final_expo.c scalar.c parameters.c mul.c mydouble.c
  26. $(CC) $(CFLAGS) $(LFLAGS) -o $@ $^
  27. speedtest-as: speedtest.c linefunction.c optate.c fpe.c fp2e.c fp6e.c fp12e.c curvepoint_fp.c twistpoint_fp2.c final_expo.c scalar.c parameters.c mul.c mydouble.c asfunctions.a
  28. $(CC) $(CFLAGS) $(LFLAGS) -DQHASM -o $@ $^
  29. test_curvepoint_multiscalar-check: test_curvepoint_multiscalar.c fpe.c scalar.c parameters.c curvepoint_fp.c mul.c mydouble.c \
  30. curvepoint_fp_multiscalar.c heap_rootreplaced.s index_heap.c scalar_sub_nored.s \
  31. asfunctions.a
  32. $(CPP) $(CPPFLAGS) -o $@ $^
  33. test_curvepoint_multiscalar-as: test_curvepoint_multiscalar.c fpe.c scalar.c parameters.c curvepoint_fp.c mul.c mydouble.c \
  34. curvepoint_fp_multiscalar.c heap_rootreplaced.s index_heap.c scalar_sub_nored.s \
  35. asfunctions.a
  36. $(CC) $(CFLAGS) $(LFLAGS) -DQHASM -o $@ $^
  37. test_twistpoint_multiscalar-check: test_twistpoint_multiscalar.c fpe.c fp2e.c scalar.c parameters.c twistpoint_fp2.c mul.c mydouble.c \
  38. twistpoint_fp2_multiscalar.c heap_rootreplaced.s index_heap.c scalar_sub_nored.s \
  39. asfunctions.a
  40. $(CPP) $(CPPFLAGS) -o $@ $^
  41. test_twistpoint_multiscalar-as: test_twistpoint_multiscalar.c fpe.c fp2e.c scalar.c parameters.c twistpoint_fp2.c mul.c mydouble.c \
  42. twistpoint_fp2_multiscalar.c heap_rootreplaced.s index_heap.c scalar_sub_nored.s \
  43. asfunctions.a
  44. $(CC) $(CFLAGS) $(LFLAGS) -DQHASM -o $@ $^
  45. %.o: %.s
  46. $(CC) $(CFLAGS) -c -o $@ $^
  47. asfunctions.a: fp2e_add2.o fp2e_sub2.o \
  48. fp2e_double2.o fp2e_triple2.o fp2e_neg2.o \
  49. fp2e_mul.o fp2e_mul_fpe.o fp2e_short_coeffred.o \
  50. fp2e_add.o fp2e_sub.o fp2e_parallel_coeffmul.o fp2e_mulxi.o\
  51. fp2e_double.o fp2e_triple.o fp2e_neg.o fp2e_conjugate.o \
  52. fpe_mul.o fp2e_square.o \
  53. consts.o
  54. rm -f asfunctions.a
  55. ar cr asfunctions.a $^
  56. .PHONY: clean
  57. clean:
  58. -rm bilintest-check
  59. -rm speedtest-check
  60. -rm bilintest-c
  61. -rm speedtest-c
  62. -rm bilintest-as
  63. -rm speedtest-as
  64. -rm test_curvepoint_multiscalar-as
  65. -rm test_curvepoint_multiscalar-check
  66. -rm *.o
  67. -rm asfunctions.a