Makefile 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs test-sha1 \
  2. test-sha256 test-aes test-asn1 test-x509
  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. LIBS = ../src/utils/libutils.a \
  16. ../src/crypto/libcrypto.a \
  17. ../src/tls/libtls.a
  18. ../src/utils/libutils.a:
  19. $(MAKE) -C ../src/utils
  20. ../src/crypto/libcrypto.a:
  21. $(MAKE) -C ../src/crypto
  22. ../src/tls/libtls.a:
  23. $(MAKE) -C ../src/tls
  24. test-aes: test-aes.o $(LIBS)
  25. $(LDO) $(LDFLAGS) -o $@ $^
  26. test-asn1: test-asn1.o $(LIBS)
  27. $(LDO) $(LDFLAGS) -o $@ $^
  28. test-base64: test-base64.o $(LIBS)
  29. $(LDO) $(LDFLAGS) -o $@ $^
  30. test-md4: test-md4.o $(LIBS)
  31. $(LDO) $(LDFLAGS) -o $@ $^
  32. test-md5: test-md5.o $(LIBS)
  33. $(LDO) $(LDFLAGS) -o $@ $^
  34. test-milenage: test-milenage.o $(LIBS)
  35. $(LDO) $(LDFLAGS) -o $@ $^
  36. test-ms_funcs: test-ms_funcs.o $(LIBS)
  37. $(LDO) $(LDFLAGS) -o $@ $^
  38. test-sha1: test-sha1.o $(LIBS)
  39. $(LDO) $(LDFLAGS) -o $@ $^
  40. test-sha256: test-sha256.o $(LIBS)
  41. $(LDO) $(LDFLAGS) -o $@ $^
  42. test-x509: test-x509.o $(LIBS)
  43. $(LDO) $(LDFLAGS) -o $@ $^
  44. run-tests: $(TESTS)
  45. ./test-aes
  46. ./test-md4
  47. ./test-md5
  48. ./test-milenage
  49. ./test-sha1
  50. ./test-sha256
  51. @echo
  52. @echo All tests completed successfully.
  53. clean:
  54. $(MAKE) -C ../src clean
  55. rm -f $(TESTS) *~ *.o *.d
  56. -include $(OBJS:%.o=%.d)