Bug 1893155 - Part 6: Correct constant for minimum epoch day. r=spidermonkey-reviewer...
[gecko.git] / third_party / libsrtp / src / crypto / Makefile.in
blob8c2c4fabef95acc0bcc59fc12faf9865b488e6f8
1 # Makefile for crypto test suite
3 # David A. McGrew
4 # Cisco Systems, Inc.
6 srcdir = @srcdir@
7 top_srcdir = @top_srcdir@
8 top_builddir = @top_builddir@
9 VPATH = @srcdir@
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@
22 RANLIB = @RANLIB@
24 # Specify how tests should find shared libraries on macOS and Linux
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
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@
49 ifdef ARCH
50 DEFS += -D$(ARCH)=1
51 endif
53 ifdef sysname
54 DEFS += -D$(sysname)=1
55 endif
57 .PHONY: dummy all runtest clean superclean
59 dummy : all runtest
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
67 testapp = test/cipher_driver$(EXE) test/datatypes_driver$(EXE) \
68 $(SHA1_DRIVER) test/kernel_driver$(EXE) \
69 $(AES_CALC) test/env$(EXE)
71 # data values used to test the aes_calc application for AES-128
72 k128=000102030405060708090a0b0c0d0e0f
73 p128=00112233445566778899aabbccddeeff
74 c128=69c4e0d86a7b0430d8cdb78070b4c55a
77 # data values used to test the aes_calc application for AES-256
78 k256=000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
79 p256=00112233445566778899aabbccddeeff
80 c256=8ea2b7ca516745bfeafc49904b496089
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."
97 # the rule for making object files and test apps
99 %.o: %.c
100 $(COMPILE) -c $< -o $@
102 %$(EXE): %.c $(srcdir)/../test/getopt_s.c
103 $(COMPILE) $(LDFLAGS) $< $(srcdir)/../test/getopt_s.c -o $@ $(CRYPTOLIB) $(LIBS)
105 all: $(testapp)
107 # housekeeping functions
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
115 superclean: clean
116 rm -f *core TAGS ktrace.out
118 # EOF