Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs \
  2. test-rsa-sig-ver \
  3. test-sha1 \
  4. test-sha256 test-aes test-asn1 test-x509 test-x509v3 test-list test-rc4
  5. all: $(TESTS)
  6. ifndef CC
  7. CC=gcc
  8. endif
  9. ifndef LDO
  10. LDO=$(CC)
  11. endif
  12. ifndef CFLAGS
  13. CFLAGS = -MMD -O2 -Wall -g
  14. endif
  15. CFLAGS += -I../src
  16. CFLAGS += -I../src/utils
  17. SLIBS = ../src/utils/libutils.a
  18. DLIBS = ../src/crypto/libcrypto.a \
  19. ../src/tls/libtls.a
  20. LIBS = $(SLIBS) $(DLIBS)
  21. LLIBS = -Wl,--start-group $(DLIBS) -Wl,--end-group $(SLIBS)
  22. # glibc < 2.17 needs -lrt for clock_gettime()
  23. LLIBS += -lrt
  24. ../src/utils/libutils.a:
  25. $(MAKE) -C ../src/utils
  26. ../src/crypto/libcrypto.a:
  27. $(MAKE) -C ../src/crypto
  28. ../src/tls/libtls.a:
  29. $(MAKE) -C ../src/tls
  30. test-aes: test-aes.o $(LIBS)
  31. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  32. test-asn1: test-asn1.o $(LIBS)
  33. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  34. test-base64: test-base64.o $(LIBS)
  35. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  36. test-https: test-https.o $(LIBS)
  37. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  38. test-list: test-list.o $(LIBS)
  39. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  40. test-md4: test-md4.o $(LIBS)
  41. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  42. test-md5: test-md5.o $(LIBS)
  43. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  44. test-milenage: test-milenage.o $(LIBS)
  45. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  46. test-ms_funcs: test-ms_funcs.o $(LIBS)
  47. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  48. test-rc4: test-rc4.o $(LIBS)
  49. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  50. test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS)
  51. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  52. test-sha1: test-sha1.o $(LIBS)
  53. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  54. test-sha256: test-sha256.o $(LIBS)
  55. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  56. test-x509: test-x509.o $(LIBS)
  57. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  58. test-x509v3: test-x509v3.o $(LIBS)
  59. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  60. run-tests: $(TESTS)
  61. ./test-aes
  62. ./test-list
  63. ./test-md4
  64. ./test-md5
  65. ./test-milenage
  66. ./test-rsa-sig-ver
  67. ./test-sha1
  68. ./test-sha256
  69. @echo
  70. @echo All tests completed successfully.
  71. clean:
  72. $(MAKE) -C ../src clean
  73. rm -f $(TESTS) *~ *.o *.d
  74. rm -f test-https
  75. rm -f test_x509v3_nist.out.*
  76. rm -f test_x509v3_nist2.out.*
  77. -include $(OBJS:%.o=%.d)