Makefile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. TESTS=test-base64 test-md4 test-milenage \
  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-milenage: test-milenage.o $(LIBS)
  43. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  44. test-rc4: test-rc4.o $(LIBS)
  45. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  46. test-rsa-sig-ver: test-rsa-sig-ver.o $(LIBS)
  47. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  48. test-sha1: test-sha1.o $(LIBS)
  49. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  50. test-sha256: test-sha256.o $(LIBS)
  51. $(LDO) $(LDFLAGS) -o $@ $^ $(LLIBS)
  52. test-x509: test-x509.o $(LIBS)
  53. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  54. test-x509v3: test-x509v3.o $(LIBS)
  55. $(LDO) $(LDFLAGS) -o $@ $< $(LLIBS)
  56. run-tests: $(TESTS)
  57. ./test-aes
  58. ./test-list
  59. ./test-md4
  60. ./test-milenage
  61. ./test-rsa-sig-ver
  62. ./test-sha1
  63. ./test-sha256
  64. @echo
  65. @echo All tests completed successfully.
  66. clean:
  67. $(MAKE) -C ../src clean
  68. rm -f $(TESTS) *~ *.o *.d
  69. rm -f test-https
  70. rm -f test_x509v3_nist.out.*
  71. rm -f test_x509v3_nist2.out.*
  72. -include $(OBJS:%.o=%.d)