Makefile.in 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. # Makefile for crypto test suite
  2. #
  3. # David A. McGrew
  4. # Cisco Systems, Inc.
  5. srcdir = @srcdir@
  6. top_srcdir = @top_srcdir@
  7. top_builddir = @top_builddir@
  8. VPATH = @srcdir@
  9. CC = @CC@
  10. INCDIR = -Iinclude -I$(srcdir)/include -I$(top_srcdir)/include
  11. DEFS = @DEFS@
  12. CPPFLAGS= @CPPFLAGS@
  13. CFLAGS = @CFLAGS@
  14. LIBS = @LIBS@
  15. LDFLAGS = @LDFLAGS@ -L. -L..
  16. COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
  17. CRYPTOLIB = -lsrtp2
  18. CRYPTO_LIBDIR = @CRYPTO_LIBDIR@
  19. RANLIB = @RANLIB@
  20. # Specify how tests should find shared libraries on macOS and Linux
  21. #
  22. # macOS purges DYLD_LIBRARY_PATH when spawning subprocesses, so it's
  23. # not possible to pass this in from the outside; we have to specify
  24. # it for any subprocesses we call. No support for dynamic linked
  25. # tests on Windows.
  26. ifneq ($(strip $(CRYPTO_LIBDIR)),)
  27. ifneq ($(OS),Windows_NT)
  28. UNAME_S = $(shell uname -s)
  29. ifeq ($(UNAME_S),Linux)
  30. FIND_LIBRARIES = LD_LIBRARY_PATH=$(CRYPTO_LIBDIR)
  31. endif
  32. ifeq ($(UNAME_S),Darwin)
  33. FIND_LIBRARIES = DYLD_LIBRARY_PATH=$(CRYPTO_LIBDIR)
  34. endif
  35. endif
  36. endif
  37. # EXE defines the suffix on executables - it's .exe for cygwin, and
  38. # null on linux, bsd, and OS X and other OSes. we define this so that
  39. # `make clean` will work on the cygwin platform
  40. EXE = @EXE@
  41. # Random source.
  42. USE_EXTERNAL_CRYPTO = @USE_EXTERNAL_CRYPTO@
  43. ifdef ARCH
  44. DEFS += -D$(ARCH)=1
  45. endif
  46. ifdef sysname
  47. DEFS += -D$(sysname)=1
  48. endif
  49. .PHONY: dummy all runtest clean superclean
  50. dummy : all runtest
  51. # test applications
  52. ifneq (1, $(USE_EXTERNAL_CRYPTO))
  53. AES_CALC = test/aes_calc$(EXE)
  54. endif
  55. testapp = test/cipher_driver$(EXE) test/datatypes_driver$(EXE) \
  56. test/stat_driver$(EXE) test/sha1_driver$(EXE) \
  57. test/kernel_driver$(EXE) $(AES_CALC) \
  58. test/env$(EXE)
  59. # data values used to test the aes_calc application for AES-128
  60. k128=000102030405060708090a0b0c0d0e0f
  61. p128=00112233445566778899aabbccddeeff
  62. c128=69c4e0d86a7b0430d8cdb78070b4c55a
  63. # data values used to test the aes_calc application for AES-256
  64. k256=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
  65. p256=00112233445566778899aabbccddeeff
  66. c256=8ea2b7ca516745bfeafc49904b496089
  67. runtest: $(testapp)
  68. $(FIND_LIBRARIES) test/env$(EXE) # print out information on the build environment
  69. @echo "running crypto test applications..."
  70. ifneq (1, $(USE_EXTERNAL_CRYPTO))
  71. $(FIND_LIBRARIES) test `test/aes_calc $(k128) $(p128)` = $(c128)
  72. $(FIND_LIBRARIES) test `test/aes_calc $(k256) $(p256)` = $(c256)
  73. endif
  74. $(FIND_LIBRARIES) test/cipher_driver$(EXE) -v >/dev/null
  75. $(FIND_LIBRARIES) test/datatypes_driver$(EXE) -v >/dev/null
  76. $(FIND_LIBRARIES) test/stat_driver$(EXE) >/dev/null
  77. $(FIND_LIBRARIES) test/sha1_driver$(EXE) -v >/dev/null
  78. $(FIND_LIBRARIES) test/kernel_driver$(EXE) -v >/dev/null
  79. @echo "crypto test applications passed."
  80. # the rule for making object files and test apps
  81. %.o: %.c
  82. $(COMPILE) -c $< -o $@
  83. %$(EXE): %.c $(srcdir)/../test/getopt_s.c
  84. $(COMPILE) $(LDFLAGS) $< $(srcdir)/../test/getopt_s.c -o $@ $(CRYPTOLIB) $(LIBS)
  85. all: $(testapp)
  86. # housekeeping functions
  87. clean:
  88. rm -f $(testapp) *.o */*.o
  89. for a in * .* */*; do if [ -f "$$a~" ] ; then rm $$a~; fi; done;
  90. rm -f `find . -name "*.[ch]~*~"`
  91. rm -rf latex
  92. superclean: clean
  93. rm -f *core TAGS ktrace.out
  94. # EOF