0b6938c00185d269a4eeacbf169ba15a48927142
[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
86 TESTS=          alltests
87
88 EXE=    $(NPTEST)$(EXE_EXT) $(MEMLEAKTEST)$(EXE_EXT) \
89         $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) \
90         $(ECDSATEST)$(EXE_EXT) $(ECDHTEST)$(EXE_EXT) $(GMDIFFTEST)$(EXE_EXT) \
91         $(PBELUTEST)$(EXE_EXT) $(IDEATEST)$(EXE_EXT) \
92         $(MD2TEST)$(EXE_EXT)  $(MD4TEST)$(EXE_EXT) $(MD5TEST)$(EXE_EXT) $(HMACTEST)$(EXE_EXT) $(WPTEST)$(EXE_EXT) \
93         $(RC2TEST)$(EXE_EXT) $(RC4TEST)$(EXE_EXT) $(RC5TEST)$(EXE_EXT) \
94         $(DESTEST)$(EXE_EXT) $(SHA1TEST)$(EXE_EXT) $(SHA256TEST)$(EXE_EXT) $(SHA512TEST)$(EXE_EXT) \
95         $(MDC2TEST)$(EXE_EXT) $(RMDTEST)$(EXE_EXT) \
96         $(RANDTEST)$(EXE_EXT) $(DHTEST)$(EXE_EXT) $(ENGINETEST)$(EXE_EXT) \
97         $(DANETEST)$(EXE_EXT) \
98         $(BFTEST)$(EXE_EXT) $(CASTTEST)$(EXE_EXT) $(SSLTEST)$(EXE_EXT) \
99         $(EXPTEST)$(EXE_EXT) $(DSATEST)$(EXE_EXT) $(RSATEST)$(EXE_EXT) \
100         $(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) \
101         $(SECMEMTEST)$(EXE_EXT) \
102         $(SRPTEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) \
103         $(HEARTBEATTEST)$(EXE_EXT) $(P5_CRPT2_TEST)$(EXE_EXT) \
104         $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT) \
105         $(CLIENTHELLOTEST)$(EXE_EXT) $(PACKETTEST)$(EXE_EXT) $(ASYNCTEST)$(EXE_EXT) \
106         $(DTLSV1LISTENTEST)$(EXE_EXT) $(CTTEST)$(EXE_EXT)
107
108 # $(METHTEST)$(EXE_EXT)
109
110 OBJ=    $(NPTEST).o $(MEMLEAKTEST).o \
111         $(BNTEST).o $(ECTEST).o \
112         $(ECDSATEST).o $(ECDHTEST).o $(GMDIFFTEST).o $(PBELUTEST).o $(IDEATEST).o \
113         $(MD2TEST).o $(MD4TEST).o $(MD5TEST).o \
114         $(HMACTEST).o $(WPTEST).o \
115         $(RC2TEST).o $(RC4TEST).o $(RC5TEST).o \
116         $(DESTEST).o $(SHA1TEST).o $(SHA256TEST).o $(SHA512TEST).o \
117         $(MDC2TEST).o $(RMDTEST).o $(DANETEST).o \
118         $(RANDTEST).o $(DHTEST).o $(ENGINETEST).o $(CASTTEST).o \
119         $(BFTEST).o  $(SSLTEST).o  $(DSATEST).o  $(EXPTEST).o $(RSATEST).o \
120         $(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(V3NAMETEST).o \
121         $(HEARTBEATTEST).o $(P5_CRPT2_TEST).o \
122         $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o $(CLIENTHELLOTEST).o \
123         $(PACKETTEST).o $(ASYNCTEST).o $(DTLSV1LISTENTEST).o $(CTTEST).o testutil.o
124
125 SRC=    $(NPTEST).c $(MEMLEAKTEST).c \
126         $(BNTEST).c $(ECTEST).c \
127         $(ECDSATEST).c $(ECDHTEST).c $(GMDIFFTEST).c $(PBELUTEST).c $(IDEATEST).c \
128         $(MD2TEST).c  $(MD4TEST).c $(MD5TEST).c \
129         $(HMACTEST).c $(WPTEST).c \
130         $(RC2TEST).c $(RC4TEST).c $(RC5TEST).c $(DANETEST).c \
131         $(DESTEST).c $(SHA1TEST).c $(MDC2TEST).c $(RMDTEST).c \
132         $(RANDTEST).c $(DHTEST).c $(ENGINETEST).c $(CASTTEST).c \
133         $(BFTEST).c  $(SSLTEST).c $(DSATEST).c   $(EXPTEST).c $(RSATEST).c \
134         $(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(V3NAMETEST).c \
135         $(HEARTBEATTEST).c $(P5_CRPT2_TEST).c \
136         $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c $(CLIENTHELLOTEST).c \
137         $(PACKETTEST).c $(ASYNCTEST).c $(DTLSV1LISTENTEST).c $(CTTEST).c testutil.c
138
139 HEADER= testutil.h
140
141 ALL=    $(GENERAL) $(SRC) $(HEADER)
142
143 top:
144         (cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all)
145
146 all:    exe
147
148 exe:    $(EXE) dummytest$(EXE_EXT)
149
150 files:
151         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
152
153 generate: $(SRC)
154 $(SRC):
155         @sh $(TOP)/util/point.sh dummytest.c $@
156
157 tests: exe apps
158         TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl $(TESTS)
159
160 errors:
161
162 list-tests:
163         @TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl list
164
165 apps:
166         @(cd ..; $(MAKE) DIRS=apps all)
167
168 depend:
169         $(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(PROGS) $(SRC)
170
171 clean:
172         rm -f .rnd tmp.bntest tmp.bctest *.o *.obj *.dll lib tags core .pure .nfs* *.old *.bak fluff $(EXE) *.ss *.srl log *.log dummytest
173
174 $(DLIBSSL):
175         (cd ..; $(MAKE) build_libssl)
176
177 $(DLIBCRYPTO):
178         (cd ..; $(MAKE) build_libcrypto)
179
180 BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
181                 shlib_target="$(SHLIB_TARGET)"; \
182         fi; \
183         LIBRARIES="$(LIBSSL) $(LIBCRYPTO)"; \
184         $(MAKE) -f $(TOP)/Makefile.shared -e \
185                 APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
186                 LDFLAG="$(LDFLAG)" \
187                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
188                 link_app.$${shlib_target}
189
190 BUILD_CMD_STATIC=shlib_target=; \
191         LIBRARIES="$(DLIBSSL) $(DLIBCRYPTO)"; \
192         $(MAKE) -f $(TOP)/Makefile.shared -e \
193                 APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
194                 LDFLAG="$(LDFLAG)" \
195                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
196                 link_app.$${shlib_target}
197
198 $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
199         @target=$(RSATEST); $(BUILD_CMD)
200
201 $(NPTEST)$(EXE_EXT): $(NPTEST).o $(DLIBCRYPTO)
202         @target=$(NPTEST); $(BUILD_CMD)
203
204 $(MEMLEAKTEST)$(EXE_EXT): $(MEMLEAKTEST).o $(DLIBCRYPTO)
205         @target=$(MEMLEAKTEST); $(BUILD_CMD)
206
207 $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
208         @target=$(BNTEST); $(BUILD_CMD)
209
210 $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
211         @target=$(ECTEST); $(BUILD_CMD)
212
213 $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
214         @target=$(EXPTEST); $(BUILD_CMD)
215
216 $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
217         @target=$(IDEATEST); $(BUILD_CMD)
218
219 $(GMDIFFTEST)$(EXE_EXT): $(GMDIFFTEST).o $(DLIBCRYPTO)
220         @target=$(GMDIFFTEST); $(BUILD_CMD)
221
222 $(PBELUTEST)$(EXE_EXT): $(PBELUTEST).o $(DLIBCRYPTO)
223         @target=$(PBELUTEST); $(BUILD_CMD)
224
225 $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
226         @target=$(MD2TEST); $(BUILD_CMD)
227
228 $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
229         @target=$(SHA1TEST); $(BUILD_CMD)
230
231 $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
232         @target=$(SHA256TEST); $(BUILD_CMD)
233
234 $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
235         @target=$(SHA512TEST); $(BUILD_CMD)
236
237 FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
238                 shlib_target="$(SHLIB_TARGET)"; \
239         fi; \
240         if [ "$(FIPSCANLIB)" = "libfips" ]; then \
241                 LIBRARIES="-L$(TOP) -lfips"; \
242         elif [ -n "$(FIPSCANLIB)" ]; then \
243                 FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \
244                 LIBRARIES="$${FIPSLIBDIR:-$(TOP)/fips/}fipscanister.o"; \
245         else \
246                 LIBRARIES="$(LIBCRYPTO)"; \
247         fi; \
248         $(MAKE) -f $(TOP)/Makefile.shared -e \
249                 CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
250                 LDFLAG="$(LDFLAG)" \
251                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
252                 link_app.$${shlib_target}
253
254 FIPS_CRYPTO_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
255                 shlib_target="$(SHLIB_TARGET)"; \
256         fi; \
257         LIBRARIES="$(LIBSSL) $(LIBCRYPTO)"; \
258         if [ -z "$(SHARED_LIBS)" -a -n "$(FIPSCANLIB)" ] ; then \
259                 FIPSLD_CC="$(CC)"; CC=$(TOP)/fips/fipsld; export CC FIPSLD_CC; \
260         fi; \
261         [ "$(FIPSCANLIB)" = "libfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \
262         $(MAKE) -f $(TOP)/Makefile.shared -e \
263                 CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
264                 LDFLAG="$(LDFLAG)" \
265                 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
266                 link_app.$${shlib_target}
267
268 $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
269         @target=$(RMDTEST); $(BUILD_CMD)
270
271 $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
272         @target=$(MDC2TEST); $(BUILD_CMD)
273
274 $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
275         @target=$(MD4TEST); $(BUILD_CMD)
276
277 $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
278         @target=$(MD5TEST); $(BUILD_CMD)
279
280 $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
281         @target=$(HMACTEST); $(BUILD_CMD)
282
283 $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
284         @target=$(WPTEST); $(BUILD_CMD)
285
286 $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
287         @target=$(RC2TEST); $(BUILD_CMD)
288
289 $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
290         @target=$(BFTEST); $(BUILD_CMD)
291
292 $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
293         @target=$(CASTTEST); $(BUILD_CMD)
294
295 $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
296         @target=$(RC4TEST); $(BUILD_CMD)
297
298 $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
299         @target=$(RC5TEST); $(BUILD_CMD)
300
301 $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
302         @target=$(DESTEST); $(BUILD_CMD)
303
304 $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
305         @target=$(RANDTEST); $(BUILD_CMD)
306
307 $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
308         @target=$(DHTEST); $(BUILD_CMD)
309
310 $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
311         @target=$(DSATEST); $(BUILD_CMD)
312
313 $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
314         @target=$(METHTEST); $(BUILD_CMD)
315
316 $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
317         @target=$(SSLTEST); $(BUILD_CMD)
318
319 $(DANETEST)$(EXE_EXT): $(DANETEST).o $(DLIBSSL) $(DLIBCRYPTO)
320         @target=$(DANETEST); $(BUILD_CMD)
321
322 $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
323         @target=$(ENGINETEST); $(BUILD_CMD)
324
325 $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
326         @target=$(EVPTEST); $(BUILD_CMD)
327
328 $(EVPEXTRATEST)$(EXE_EXT): $(EVPEXTRATEST).o $(DLIBCRYPTO)
329         @target=$(EVPEXTRATEST); $(BUILD_CMD)
330
331 $(P5_CRPT2_TEST)$(EXE_EXT): $(P5_CRPT2_TEST).o $(DLIBCRYPTO)
332         @target=$(P5_CRPT2_TEST); $(BUILD_CMD)
333
334 $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
335         @target=$(ECDSATEST); $(BUILD_CMD)
336
337 $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
338         @target=$(ECDHTEST); $(BUILD_CMD)
339
340 $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
341         @target=$(IGETEST); $(BUILD_CMD)
342
343 $(SECMEMTEST)$(EXE_EXT): $(SECMEMTEST).o $(DLIBCRYPTO)
344         @target=$(SECMEMTEST); $(BUILD_CMD)
345
346 $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
347         @target=$(SRPTEST); $(BUILD_CMD)
348
349 $(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
350         @target=$(V3NAMETEST); $(BUILD_CMD)
351
352 $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO) testutil.o
353         @target=$(HEARTBEATTEST) testutil=testutil.o; $(BUILD_CMD_STATIC)
354
355 $(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
356         @target=$(CONSTTIMETEST) $(BUILD_CMD)
357
358 $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o
359         @target=$(VERIFYEXTRATEST) $(BUILD_CMD)
360
361 $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o
362         @target=$(CLIENTHELLOTEST) $(BUILD_CMD)
363
364 $(PACKETTEST)$(EXE_EXT): $(PACKETTEST).o
365         @target=$(PACKETTEST) $(BUILD_CMD)
366
367 $(ASYNCTEST)$(EXE_EXT): $(ASYNCTEST).o
368         @target=$(ASYNCTEST) $(BUILD_CMD)
369
370 $(DTLSV1LISTENTEST)$(EXE_EXT): $(DTLSV1LISTENTEST).o
371         @target=$(DTLSV1LISTENTEST) $(BUILD_CMD)
372
373 $(CTTEST)$(EXE_EXT): $(CTTEST).o testutil.o
374         @target=$(CTTEST) testutil=testutil.o;  $(BUILD_CMD)
375
376 dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
377         @target=dummytest; $(BUILD_CMD)
378
379 # DO NOT DELETE THIS LINE -- make depend depends on it.