[Title] Add packaging/nettle.spec to build nettle on OBS system
[external/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                     sha1-test.c sha224-test.c sha256-test.c \
20                     sha384-test.c sha512-test.c \
21                     serpent-test.c twofish-test.c \
22                     knuth-lfib-test.c \
23                     cbc-test.c ctr-test.c hmac-test.c \
24                     buffer-test.c yarrow-test.c
25
26 TS_HOGWEED_SOURCES = sexp-test.c sexp-format-test.c \
27                      rsa2sexp-test.c sexp2rsa-test.c \
28                      bignum-test.c random-prime-test.c \
29                      pkcs1-test.c \
30                      rsa-test.c rsa-encrypt-test.c rsa-keygen-test.c \
31                      dsa-test.c dsa-keygen-test.c
32
33 TS_SOURCES = $(TS_NETTLE_SOURCES) @IF_HOGWEED@ $(TS_HOGWEED_SOURCES)
34
35 TS_NETTLE = $(TS_NETTLE_SOURCES:.c=$(EXEEXT))
36 TS_HOGWEED = $(TS_HOGWEED_SOURCES:.c=$(EXEEXT))
37 TS_C = $(TS_NETTLE) @IF_HOGWEED@ $(TS_HOGWEED)
38 TS_CXX = @CXX_TESTS@
39 TARGETS = $(TS_C) $(TS_CXX)
40 TS_SH = sexp-conv-test pkcs1-conv-test symbols-test
41 TS_ALL = $(TARGETS) $(TS_SH)
42 EXTRA_SOURCES = sha1-huge-test.c
43 EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
44
45 SOURCES = $(TS_SOURCES) testutils.c
46
47 DISTFILES = $(SOURCES) $(EXTRA_SOURCES) cxx-test.cxx Makefile.in .test-rules.make \
48         $(TS_SH) run-tests teardown-env \
49         gold-bug.txt testutils.h
50
51 all: $(TARGETS) $(EXTRA_TARGETS)
52
53 .c.$(OBJEXT):
54         $(COMPILE) -c $< && $(DEP_PROCESS)
55
56 .SUFFIXES: .cxx
57 .cxx.$(OBJEXT):
58         $(COMPILE_CXX) -c $< && $(DEP_PROCESS)
59
60 # BSD (and Solaris) make doesn't allow extra dependencies together one
61 # single-suffix rules, which makes it impossible or almost impossible
62 # to use suffix rules to build the test executables. So we use an
63 # explicit rule for each and every executable.
64
65 LIB_HOGWEED = @IF_HOGWEED@ -lhogweed
66 TEST_OBJS = testutils.$(OBJEXT) $(LIB_HOGWEED) -lnettle $(LIBS)
67
68 .PHONY: test-rules
69 test-rules:
70         (for f in $(TS_NETTLE) $(TS_HOGWEED) $(EXTRA_TARGETS) ; do \
71           echo $$f'$$(EXEEXT): '$$f'.$$(OBJEXT)' ; \
72           echo '        $$(LINK) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o '$$f'$$(EXEEXT)' ; \
73           echo ; \
74         done ; \
75         for f in $(TS_CXX) ; do \
76           echo $$f'$$(EXEEXT): '$$f'.$$(OBJEXT)' ; \
77           echo '        $$(LINK_CXX) '$$f'.$$(OBJEXT) $$(TEST_OBJS) -o '$$f'$$(EXEEXT)' ; \
78           echo ; \
79         done) > $(srcdir)/.test-rules.make
80
81 include $(srcdir)/.test-rules.make
82
83 $(TARGETS) $(EXTRA_TARGETS): testutils.$(OBJEXT) \
84         ../libnettle.a @IF_HOGWEED@ ../libhogweed.a
85
86 check: $(TS_ALL) $(srcdir)/run-tests
87         LD_LIBRARY_PATH=../.lib srcdir="$(srcdir)" \
88           $(srcdir)/run-tests $(TS_ALL)
89
90
91 Makefile: $(srcdir)/Makefile.in ../config.status
92         cd .. && $(SHELL) ./config.status testsuite/$@
93
94 install uninstall:
95         true
96
97 distdir: $(DISTFILES)
98         cp $? $(distdir)
99
100 clean:
101         -rm -f $(TARGETS) $(EXTRA_TARGETS) *.o test.in test1.out test2.out
102
103 distclean: clean
104         -rm -f Makefile *.d
105
106 tags:
107         etags -o $(srcdir)/TAGS --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h
108
109 @DEP_INCLUDE@ $(SOURCES:.c=.$(OBJEXT).d)