Makefile 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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
  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-md4: test-md4.o $(LIBS)
  33. $(LDO) $(LDFLAGS) -o $@ $^
  34. test-md5: test-md5.o $(LIBS)
  35. $(LDO) $(LDFLAGS) -o $@ $^
  36. test-milenage: test-milenage.o $(LIBS)
  37. $(LDO) $(LDFLAGS) -o $@ $^
  38. test-ms_funcs: test-ms_funcs.o $(LIBS)
  39. $(LDO) $(LDFLAGS) -o $@ $^
  40. test-sha1: test-sha1.o $(LIBS)
  41. $(LDO) $(LDFLAGS) -o $@ $^
  42. test-sha256: test-sha256.o $(LIBS)
  43. $(LDO) $(LDFLAGS) -o $@ $^
  44. test-x509: test-x509.o $(LIBS)
  45. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  46. test-x509v3: test-x509v3.o $(LIBS)
  47. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  48. run-tests: $(TESTS)
  49. ./test-aes
  50. ./test-md4
  51. ./test-md5
  52. ./test-milenage
  53. ./test-sha1
  54. ./test-sha256
  55. @echo
  56. @echo All tests completed successfully.
  57. clean:
  58. $(MAKE) -C ../src clean
  59. rm -f $(TESTS) *~ *.o *.d
  60. rm -f test_x509v3_nist.out.*
  61. rm -f test_x509v3_nist2.out.*
  62. -include $(OBJS:%.o=%.d)