Makefile 1.7 KB

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