Imported Upstream version 2.4
[platform/upstream/nettle.git] / testsuite / Makefile.in
1 @SET_MAKE@
2
3 srcdir = @srcdir@
4 VPATH = @srcdir@
5
6 top_srcdir = @top_srcdir@
7
8 include ../config.make
9
10 PRE_CPPFLAGS = -I.. -I$(top_srcdir)
11 PRE_LDFLAGS = -L..
12
13 TS_NETTLE_SOURCES = aes-test.c arcfour-test.c arctwo-test.c \
14                     blowfish-test.c cast128-test.c \
15                     base16-test.c base64-test.c \
16                     camellia-test.c \
17                     des-test.c des3-test.c des-compat-test.c \
18                     md2-test.c md4-test.c md5-test.c md5-compat-test.c \
19                     memxor-test.c \
20                     ripemd160-test.c \
21                     sha1-test.c sha224-test.c sha256-test.c \
22                     sha384-test.c sha512-test.c \
23                     serpent-test.c twofish-test.c \
24                     knuth-lfib-test.c \
25                     cbc-test.c ctr-test.c gcm-test.c hmac-test.c \
26                     meta-hash-test.c meta-cipher-test.c meta-armor-test.c \
27                     buffer-test.c yarrow-test.c
28
29 TS_HOGWEED_SOURCES = sexp-test.c sexp-format-test.c \
30                      rsa2sexp-test.c sexp2rsa-test.c \
31                      bignum-test.c random-prime-test.c \
32                      pkcs1-test.c \
33                      rsa-test.c rsa-encrypt-test.c rsa-keygen-test.c \
34                      dsa-test.c dsa-keygen-test.c
35
36 TS_SOURCES = $(TS_NETTLE_SOURCES) @IF_HOGWEED@ $(TS_HOGWEED_SOURCES)
37
38 TS_NETTLE = $(TS_NETTLE_SOURCES:.c=$(EXEEXT))
39 TS_HOGWEED = $(TS_HOGWEED_SOURCES:.c=$(EXEEXT))
40 TS_C = $(TS_NETTLE) @IF_HOGWEED@ $(TS_HOGWEED)
41 TS_CXX = @CXX_TESTS@
42 TARGETS = $(TS_C) $(TS_CXX)
43 TS_SH = sexp-conv-test pkcs1-conv-test symbols-test
44 TS_ALL = $(TARGETS) $(TS_SH)
45 EXTRA_SOURCES = sha1-huge-test.c
46 EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
47
48 SOURCES = $(TS_SOURCES) testutils.c
49
50 DISTFILES = $(SOURCES) $(EXTRA_SOURCES) cxx-test.cxx Makefile.in .test-rules.make \
51         $(TS_SH) run-tests teardown-env \
52         gold-bug.txt testutils.h
53
54 all: $(TARGETS) $(EXTRA_TARGETS)
55
56 .c.$(OBJEXT):
57         $(COMPILE) -c $< && $(DEP_PROCESS)
58
59 .SUFFIXES: .cxx
60 .cxx.$(OBJEXT):
61         $(COMPILE_CXX) -c $< && $(DEP_PROCESS)
62
63 # BSD (and Solaris) make doesn't allow extra dependencies together one
64 # single-suffix rules, which makes it impossible or almost impossible
65 # to use suffix rules to build the test executables. So we use an
66 # explicit rule for each and every executable.
67
68 LIB_HOGWEED = @IF_HOGWEED@ -lhogweed
69 TEST_OBJS = testutils.$(OBJEXT) $(LIB_HOGWEED) -lnettle $(LIBS)
70
71 .PHONY: test-rules
72 test-rules:
73         (for f in $(TS_NETTLE) $(TS_HOGWEED) $(EXTRA_TARGETS) ; do \
74           echo $$f'$$(EXEEXT): '$$f'.$$(OBJEXT)' ; \
75           echo '        $$(LINK) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o '$$f'$$(EXEEXT)' ; \
76           echo ; \
77         done ; \
78         for f in $(TS_CXX) ; do \
79           echo $$f'$$(EXEEXT): '$$f'.$$(OBJEXT)' ; \
80           echo '        $$(LINK_CXX) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o '$$f'$$(EXEEXT)' ; \
81           echo ; \
82         done) > $(srcdir)/.test-rules.make
83
84 include $(srcdir)/.test-rules.make
85
86 $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) \
87         ../libnettle.a @IF_HOGWEED@ ../libhogweed.a
88
89 # The PATH update is for locating dlls on w*ndows.
90 check: $(TS_ALL) $(srcdir)/run-tests
91         LD_LIBRARY_PATH=../.lib PATH="../.lib:$$PATH" srcdir="$(srcdir)" \
92           $(srcdir)/run-tests $(TS_ALL)
93
94
95 Makefile: $(srcdir)/Makefile.in ../config.status
96         cd .. && $(SHELL) ./config.status testsuite/$@
97
98 install uninstall:
99         true
100
101 distdir: $(DISTFILES)
102         cp $? $(distdir)
103
104 clean:
105         -rm -f $(TARGETS) $(EXTRA_TARGETS) *.o test.in test1.out test2.out
106
107 distclean: clean
108         -rm -f Makefile *.d
109
110 tags:
111         etags -o $(srcdir)/TAGS --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h
112
113 @DEP_INCLUDE@ $(SOURCES:.c=.$(OBJEXT).d)