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