Makefile 2.0 KB

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