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