Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. TESTS=test-base64 test-md4 test-md5 test-milenage test-ms_funcs \
  2. test-printf \
  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. ../src/utils/libutils.a:
  23. $(MAKE) -C ../src/utils
  24. ../src/crypto/libcrypto.a:
  25. $(MAKE) -C ../src/crypto
  26. ../src/tls/libtls.a:
  27. $(MAKE) -C ../src/tls
  28. test-aes: test-aes.o $(LIBS)
  29. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  30. test-asn1: test-asn1.o $(LIBS)
  31. $(LDO) $(LDFLAGS) -o $@ $^
  32. test-base64: test-base64.o $(LIBS)
  33. $(LDO) $(LDFLAGS) -o $@ $^
  34. test-https: test-https.o $(LIBS)
  35. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  36. test-list: test-list.o $(LIBS)
  37. $(LDO) $(LDFLAGS) -o $@ $^
  38. test-md4: test-md4.o $(LIBS)
  39. $(LDO) $(LDFLAGS) -o $@ $^
  40. test-md5: test-md5.o $(LIBS)
  41. $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS)
  42. test-milenage: test-milenage.o $(LIBS)
  43. $(LDO) $(LDFLAGS) -o $@ $^
  44. test-ms_funcs: test-ms_funcs.o $(LIBS)
  45. $(LDO) $(LDFLAGS) -o $@ $^
  46. test-printf: test-printf.o $(LIBS)
  47. $(LDO) $(LDFLAGS) -o $@ $^
  48. test-rc4: test-rc4.o $(LIBS)
  49. $(LDO) $(LDFLAGS) -o $@ $^
  50. test-sha1: test-sha1.o $(LIBS)
  51. $(LDO) $(LDFLAGS) -o $@ $^ $(LIBS)
  52. test-sha256: test-sha256.o $(LIBS)
  53. $(LDO) $(LDFLAGS) -o $@ $^
  54. test-x509: test-x509.o $(LIBS)
  55. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  56. test-x509v3: test-x509v3.o $(LIBS)
  57. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  58. run-tests: $(TESTS)
  59. ./test-aes
  60. ./test-list
  61. ./test-md4
  62. ./test-md5
  63. ./test-milenage
  64. ./test-printf
  65. ./test-sha1
  66. ./test-sha256
  67. @echo
  68. @echo All tests completed successfully.
  69. clean:
  70. $(MAKE) -C ../src clean
  71. rm -f $(TESTS) *~ *.o *.d
  72. rm -f test-https
  73. rm -f test_x509v3_nist.out.*
  74. rm -f test_x509v3_nist2.out.*
  75. -include $(OBJS:%.o=%.d)