Implement new multi-threading API
[oweals/openssl.git] / test / Makefile.in
1 #
2 # test/Makefile
3 #
4
5 DIR=            test
6 TOP=            ..
7 CC=             cc
8 INCLUDES=       -I$(TOP) -I../include -I../crypto/include -I$(TOP)/fips
9 CFLAG=          -g
10 MAKEDEPEND=     $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
11 PERL=           perl
12
13 PLIB_LDFLAG=
14 EX_LIBS= #-lnsl -lsocket
15
16 CFLAGS= $(INCLUDES) $(CFLAG)
17 LDFLAGS= $(CFLAGS) $(LDFLAG)
18
19 GENERAL=Makefile maketests.com \
20         tests.com testenc.com tx509.com trsa.com tcrl.com tsid.com treq.com \
21         tpkcs7.com tpkcs7d.com tverify.com testgen.com testss.com testssl.com \
22         testca.com VMSca-response.1 VMSca-response.2
23
24 DLIBCRYPTO= ../libcrypto.a
25 DLIBSSL= ../libssl.a
26 LIBCRYPTO= -L.. -lcrypto
27 LIBSSL= -L.. -lssl
28 LIBFIPS= -L.. -lfips
29
30 # Prefix for logline for each test
31 START= @@@ START
32
33 NPTEST=         nptest
34 MEMLEAKTEST=    memleaktest
35 BNTEST=         bntest
36 ECTEST=         ectest
37 ECDSATEST=      ecdsatest
38 ECDHTEST=       ecdhtest
39 EXPTEST=        exptest
40 GMDIFFTEST=     gmdifftest
41 PBELUTEST=      pbelutest
42 IDEATEST=       ideatest
43 SHA1TEST=       sha1test
44 SHA256TEST=     sha256t
45 SHA512TEST=     sha512t
46 MDC2TEST=       mdc2test
47 RMDTEST=        rmdtest
48 MD2TEST=        md2test
49 MD4TEST=        md4test
50 MD5TEST=        md5test
51 HMACTEST=       hmactest
52 WPTEST=         wp_test
53 RC2TEST=        rc2test
54 RC4TEST=        rc4test
55 RC5TEST=        rc5test
56 BFTEST=         bftest
57 CASTTEST=       casttest
58 DESTEST=        destest
59 RANDTEST=       randtest
60 DHTEST=         dhtest
61 DSATEST=        dsatest
62 SSLTEST=        ssltest
63 DANETEST=       danetest
64 RSATEST=        rsa_test
65 ENGINETEST=     enginetest
66 EVPTEST=        evp_test
67 EVPEXTRATEST=evp_extra_test
68 P5_CRPT2_TEST=  p5_crpt2_test
69 IGETEST=        igetest
70 SECMEMTEST=     secmemtest
71 SRPTEST=        srptest
72 V3NAMETEST=     v3nametest
73 HEARTBEATTEST=  heartbeat_test
74 CONSTTIMETEST=  constant_time_test
75 VERIFYEXTRATEST=        verify_extra_test
76 CLIENTHELLOTEST=        clienthellotest
77 PACKETTEST=     packettest
78 SSLVERTOLTEST=  sslvertoltest
79 SSLEXTENSIONTEST=       sslextensiontest
80 SSLSESSIONTICKTEST=     sslsessionticktest
81 SSLSKEWITH0PTEST=       sslskewith0ptest
82 ASYNCTEST=      asynctest
83 DTLSV1LISTENTEST = dtlsv1listentest
84 CTTEST= ct_test
85 THREADSTEST=    threadstest
86
87 TESTS=          alltests
88
89 EXE=    $(NPTEST)$(EXE_EXT) $(MEMLEAKTEST)$(EXE_EXT) \
90         $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) \
91         $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)$(EXE_EXT) $(GMDIFFTEST)$(EXE_EXT) \
92         $(PBELUTEST)$(EXE_EXT) $(IDEATEST)$(EXE_EXT) \
93         $(MD2TEST)$(EXE_EXT)  $(MD4TEST)$(EXE_EXT) $(MD5TEST)$(EXE_EXT) $(HMACTEST)$(EXE_EXT) $(WPTEST)$(EXE_EXT) \
94         $(RC2TEST)$(EXE_EXT) $(RC4TEST)$(EXE_EXT) $(RC5TEST)$(EXE_EXT) \
95         $(DESTEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(SHA256TEST)$(EXE_EXT) $(SHA512TEST)$(EXE_EXT) \
96         $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \
97         $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \
98         $(DANETEST)$(EXE_EXT) \
99         $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) \
100         $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \
101         $(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) \
102         $(SECMEMTEST)$(EXE_EXT) \
103         $(SRPTEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) \
104         $(HEARTBEATTEST)$(EXE_EXT) $(P5_CRPT2_TEST)$(EXE_EXT) \
105         $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT) \
106         $(CLIENTHELLOTEST)$(EXE_EXT) $(PACKETTEST)$(EXE_EXT) $(ASYNCTEST)$(EXE_EXT) \
107         $(DTLSV1LISTENTEST)$(EXE_EXT) $(CTTEST)$(EXE_EXT) $(THREADSTEST)$(EXE_EXT)
108
109 # $(METHTEST)$(EXE_EXT)
110
111 OBJ=    $(NPTEST).o $(MEMLEAKTEST).o \
112         $(BNTEST).o $(ECTEST).o \
113         $(ECDSATEST).o $(ECDHTEST).o $(GMDIFFTEST).o $(PBELUTEST).o $(IDEATEST).o \
114         $(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \
115         $(HMACTEST).o $(WPTEST).o \
116         $(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \
117         $(DESTEST).o $(SHA1TEST).o $(SHA256TEST).o $(SHA512TEST).o \
118         $(MDC2TEST).o $(RMDTEST).o $(DANETEST).o \
119         $(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \
120         $(BFTEST).o  $(SSLTEST).o  $(DSATEST).o  $(EXPTEST).o $(RSATEST).o \
121         $(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(V3NAMETEST).o \
122         $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o \
123         $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o $(CLIENTHELLOTEST).o \
124         $(PACKETTEST).o $(ASYNCTEST).o $(DTLSV1LISTENTEST).o $(CTTEST).o \
125         $(THREADSTEST).o testutil.o
126
127 SRC=    $(NPTEST).c $(MEMLEAKTEST).c \
128         $(BNTEST).c $(ECTEST).c \
129         $(ECDSATEST).c $(ECDHTEST).c $(GMDIFFTEST).c $(PBELUTEST).c $(IDEATEST).c \
130         $(MD2TEST).c  $(MD4TEST).c $(MD5TEST).c \
131         $(HMACTEST).c $(WPTEST).c \
132         $(RC2TEST).c $(RC4TEST).c $(RC5TEST).c $(DANETEST).c \
133         $(DESTEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \
134         $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \
135         $(BFTEST).c  $(SSLTEST).c $(DSATEST).c   $(EXPTEST).c $(RSATEST).c \
136         $(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(V3NAMETEST).c \
137         $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c \
138         $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c $(CLIENTHELLOTEST).c \
139         $(PACKETTEST).c $(ASYNCTEST).c $(DTLSV1LISTENTEST).c $(CTTEST).c \
140         $(THREADSTEST).c testutil.c
141
142 HEADER= testutil.h
143
144 ALL=    $(GENERAL) $(SRC) $(HEADER)
145
146 top:
147         (cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all)
148
149 all:    exe
150
151 exe:    $(EXE) dummytest$(EXE_EXT)
152
153 files:
154         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
155
156 generate: $(SRC)
157 $(SRC):
158         @sh $(TOP)/util/point.sh dummytest.c $@
159
160 tests: exe apps
161         TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl $(TESTS)
162
163 errors:
164
165 list-tests:
166         @TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl list
167
168 apps:
169         @(cd ..; $(MAKE) DIRS=apps all)
170
171 depend:
172         $(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(PROGS) $(SRC)
173
174 clean:
175         rm -f .rnd tmp.bntest tmp.bctest *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log *.log dummytest
176
177 $(DLIBSSL):
178         (cd ..; $(MAKE) build_libssl)
179
180 $(DLIBCRYPTO):
181         (cd ..; $(MAKE) build_libcrypto)
182
183 BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
184                 shlib_target="$(SHLIB_TARGET)"; \
185         fi; \
186         LIBRARIES="$(LIBSSL) $(LIBCRYPTO)"; \
187         $(MAKE) -f $(TOP)/Makefile.shared -e \
188                 APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
189                 LDFLAG="$(LDFLAG)" \
190                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
191                 link_app.$${shlib_target}
192
193 BUILD_CMD_STATIC=shlib_target=; \
194         LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO)"; \
195         $(MAKE) -f $(TOP)/Makefile.shared -e \
196                 APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
197                 LDFLAG="$(LDFLAG)" \
198                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
199                 link_app.$${shlib_target}
200
201 $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
202         @target=$(RSATEST); $(BUILD_CMD)
203
204 $(NPTEST)$(EXE_EXT): $(NPTEST).o $(DLIBCRYPTO)
205         @target=$(NPTEST); $(BUILD_CMD)
206
207 $(MEMLEAKTEST)$(EXE_EXT): $(MEMLEAKTEST).o $(DLIBCRYPTO)
208         @target=$(MEMLEAKTEST); $(BUILD_CMD)
209
210 $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
211         @target=$(BNTEST); $(BUILD_CMD)
212
213 $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
214         @target=$(ECTEST); $(BUILD_CMD)
215
216 $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
217         @target=$(EXPTEST); $(BUILD_CMD)
218
219 $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
220         @target=$(IDEATEST); $(BUILD_CMD)
221
222 $(GMDIFFTEST)$(EXE_EXT): $(GMDIFFTEST).o $(DLIBCRYPTO)
223         @target=$(GMDIFFTEST); $(BUILD_CMD)
224
225 $(PBELUTEST)$(EXE_EXT): $(PBELUTEST).o $(DLIBCRYPTO)
226         @target=$(PBELUTEST); $(BUILD_CMD)
227
228 $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
229         @target=$(MD2TEST); $(BUILD_CMD)
230
231 $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
232         @target=$(SHA1TEST); $(BUILD_CMD)
233
234 $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
235         @target=$(SHA256TEST); $(BUILD_CMD)
236
237 $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
238         @target=$(SHA512TEST); $(BUILD_CMD)
239
240 FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
241                 shlib_target="$(SHLIB_TARGET)"; \
242         fi; \
243         if [ "$(FIPSCANLIB)" = "libfips" ]; then \
244                 LIBRARIES="-L$(TOP) -lfips"; \
245         elif [ -n "$(FIPSCANLIB)" ]; then \
246                 FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \
247                 LIBRARIES="$${FIPSLIBDIR:-$(TOP)/fips/}fipscanister.o"; \
248         else \
249                 LIBRARIES="$(LIBCRYPTO)"; \
250         fi; \
251         $(MAKE) -f $(TOP)/Makefile.shared -e \
252                 CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
253                 LDFLAG="$(LDFLAG)" \
254                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
255                 link_app.$${shlib_target}
256
257 FIPS_CRYPTO_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
258                 shlib_target="$(SHLIB_TARGET)"; \
259         fi; \
260         LIBRARIES="$(LIBSSL) $(LIBCRYPTO)"; \
261         if [ -z "$(SHARED_LIBS)" -a -n "$(FIPSCANLIB)" ] ; then \
262                 FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \
263         fi; \
264         [ "$(FIPSCANLIB)" = "libfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \
265         $(MAKE) -f $(TOP)/Makefile.shared -e \
266                 CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
267                 LDFLAG="$(LDFLAG)" \
268                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
269                 link_app.$${shlib_target}
270
271 $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
272         @target=$(RMDTEST); $(BUILD_CMD)
273
274 $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
275         @target=$(MDC2TEST); $(BUILD_CMD)
276
277 $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
278         @target=$(MD4TEST); $(BUILD_CMD)
279
280 $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
281         @target=$(MD5TEST); $(BUILD_CMD)
282
283 $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
284         @target=$(HMACTEST); $(BUILD_CMD)
285
286 $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
287         @target=$(WPTEST); $(BUILD_CMD)
288
289 $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
290         @target=$(RC2TEST); $(BUILD_CMD)
291
292 $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
293         @target=$(BFTEST); $(BUILD_CMD)
294
295 $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
296         @target=$(CASTTEST); $(BUILD_CMD)
297
298 $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
299         @target=$(RC4TEST); $(BUILD_CMD)
300
301 $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
302         @target=$(RC5TEST); $(BUILD_CMD)
303
304 $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
305         @target=$(DESTEST); $(BUILD_CMD)
306
307 $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
308         @target=$(RANDTEST); $(BUILD_CMD)
309
310 $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
311         @target=$(DHTEST); $(BUILD_CMD)
312
313 $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
314         @target=$(DSATEST); $(BUILD_CMD)
315
316 $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
317         @target=$(METHTEST); $(BUILD_CMD)
318
319 $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
320         @target=$(SSLTEST); $(BUILD_CMD)
321
322 $(DANETEST)$(EXE_EXT): $(DANETEST).o $(DLIBSSL) $(DLIBCRYPTO)
323         @target=$(DANETEST); $(BUILD_CMD)
324
325 $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
326         @target=$(ENGINETEST); $(BUILD_CMD)
327
328 $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
329         @target=$(EVPTEST); $(BUILD_CMD)
330
331 $(EVPEXTRATEST)$(EXE_EXT): $(EVPEXTRATEST).o $(DLIBCRYPTO)
332         @target=$(EVPEXTRATEST); $(BUILD_CMD)
333
334 $(P5_CRPT2_TEST)$(EXE_EXT): $(P5_CRPT2_TEST).o $(DLIBCRYPTO)
335         @target=$(P5_CRPT2_TEST); $(BUILD_CMD)
336
337 $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
338         @target=$(ECDSATEST); $(BUILD_CMD)
339
340 $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
341         @target=$(ECDHTEST); $(BUILD_CMD)
342
343 $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
344         @target=$(IGETEST); $(BUILD_CMD)
345
346 $(SECMEMTEST)$(EXE_EXT): $(SECMEMTEST).o $(DLIBCRYPTO)
347         @target=$(SECMEMTEST); $(BUILD_CMD)
348
349 $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
350         @target=$(SRPTEST); $(BUILD_CMD)
351
352 $(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
353         @target=$(V3NAMETEST); $(BUILD_CMD)
354
355 $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO) testutil.o
356         @target=$(HEARTBEATTEST) testutil=testutil.o; $(BUILD_CMD_STATIC)
357
358 $(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
359         @target=$(CONSTTIMETEST) $(BUILD_CMD)
360
361 $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o
362         @target=$(VERIFYEXTRATEST) $(BUILD_CMD)
363
364 $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o
365         @target=$(CLIENTHELLOTEST) $(BUILD_CMD)
366
367 $(PACKETTEST)$(EXE_EXT): $(PACKETTEST).o
368         @target=$(PACKETTEST) $(BUILD_CMD)
369
370 $(ASYNCTEST)$(EXE_EXT): $(ASYNCTEST).o
371         @target=$(ASYNCTEST) $(BUILD_CMD)
372
373 $(DTLSV1LISTENTEST)$(EXE_EXT): $(DTLSV1LISTENTEST).o
374         @target=$(DTLSV1LISTENTEST) $(BUILD_CMD)
375
376 $(CTTEST)$(EXE_EXT): $(CTTEST).o testutil.o
377         @target=$(CTTEST) testutil=testutil.o;  $(BUILD_CMD)
378
379 $(THREADSTEST)$(EXE_EXT): $(THREADSTEST).o $(DLIBCRYPTO)
380         @target=$(THREADSTEST) $(BUILD_CMD)
381
382 dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
383         @target=dummytest; $(BUILD_CMD)
384
385 # DO NOT DELETE THIS LINE -- make depend depends on it.