8 INCLUDES= -I$(TOP) -I../include -I../crypto/include -I$(TOP)/fips
10 MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
14 EX_LIBS= #-lnsl -lsocket
16 CFLAGS= $(INCLUDES) $(CFLAG)
17 LDFLAGS= $(CFLAGS) $(LDFLAG)
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
24 DLIBCRYPTO= ../libcrypto.a
26 LIBCRYPTO= -L.. -lcrypto
30 # Prefix for logline for each test
34 MEMLEAKTEST= memleaktest
40 GMDIFFTEST= gmdifftest
65 ENGINETEST= enginetest
67 EVPEXTRATEST=evp_extra_test
68 P5_CRPT2_TEST= p5_crpt2_test
70 SECMEMTEST= secmemtest
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
83 DTLSV1LISTENTEST = dtlsv1listentest
85 THREADSTEST= threadstest
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)
109 # $(METHTEST)$(EXE_EXT)
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
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
144 ALL= $(GENERAL) $(SRC) $(HEADER)
147 (cd ..; $(MAKE) DIRS=$(DIR) TESTS=$(TESTS) all)
151 exe: $(EXE) dummytest$(EXE_EXT)
154 $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
158 @sh $(TOP)/util/point.sh dummytest.c $@
161 TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl $(TESTS)
166 @TOP=$(TOP) PERL=$(PERL) $(PERL) run_tests.pl list
169 @(cd ..; $(MAKE) DIRS=apps all)
172 $(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(PROGS) $(SRC)
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
178 (cd ..; $(MAKE) build_libssl)
181 (cd ..; $(MAKE) build_libcrypto)
183 BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
184 shlib_target="$(SHLIB_TARGET)"; \
186 LIBRARIES="$(LIBSSL) $(LIBCRYPTO)"; \
187 $(MAKE) -f $(TOP)/Makefile.shared -e \
188 APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$testutil" \
190 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
191 link_app.$${shlib_target}
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" \
198 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
199 link_app.$${shlib_target}
201 $(RSATEST)$(EXE_EXT): $(RSATEST).o $(DLIBCRYPTO)
202 @target=$(RSATEST); $(BUILD_CMD)
204 $(NPTEST)$(EXE_EXT): $(NPTEST).o $(DLIBCRYPTO)
205 @target=$(NPTEST); $(BUILD_CMD)
207 $(MEMLEAKTEST)$(EXE_EXT): $(MEMLEAKTEST).o $(DLIBCRYPTO)
208 @target=$(MEMLEAKTEST); $(BUILD_CMD)
210 $(BNTEST)$(EXE_EXT): $(BNTEST).o $(DLIBCRYPTO)
211 @target=$(BNTEST); $(BUILD_CMD)
213 $(ECTEST)$(EXE_EXT): $(ECTEST).o $(DLIBCRYPTO)
214 @target=$(ECTEST); $(BUILD_CMD)
216 $(EXPTEST)$(EXE_EXT): $(EXPTEST).o $(DLIBCRYPTO)
217 @target=$(EXPTEST); $(BUILD_CMD)
219 $(IDEATEST)$(EXE_EXT): $(IDEATEST).o $(DLIBCRYPTO)
220 @target=$(IDEATEST); $(BUILD_CMD)
222 $(GMDIFFTEST)$(EXE_EXT): $(GMDIFFTEST).o $(DLIBCRYPTO)
223 @target=$(GMDIFFTEST); $(BUILD_CMD)
225 $(PBELUTEST)$(EXE_EXT): $(PBELUTEST).o $(DLIBCRYPTO)
226 @target=$(PBELUTEST); $(BUILD_CMD)
228 $(MD2TEST)$(EXE_EXT): $(MD2TEST).o $(DLIBCRYPTO)
229 @target=$(MD2TEST); $(BUILD_CMD)
231 $(SHA1TEST)$(EXE_EXT): $(SHA1TEST).o $(DLIBCRYPTO)
232 @target=$(SHA1TEST); $(BUILD_CMD)
234 $(SHA256TEST)$(EXE_EXT): $(SHA256TEST).o $(DLIBCRYPTO)
235 @target=$(SHA256TEST); $(BUILD_CMD)
237 $(SHA512TEST)$(EXE_EXT): $(SHA512TEST).o $(DLIBCRYPTO)
238 @target=$(SHA512TEST); $(BUILD_CMD)
240 FIPS_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
241 shlib_target="$(SHLIB_TARGET)"; \
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"; \
249 LIBRARIES="$(LIBCRYPTO)"; \
251 $(MAKE) -f $(TOP)/Makefile.shared -e \
252 CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
254 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
255 link_app.$${shlib_target}
257 FIPS_CRYPTO_BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \
258 shlib_target="$(SHLIB_TARGET)"; \
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; \
264 [ "$(FIPSCANLIB)" = "libfips" ] && LIBRARIES="$$LIBRARIES -lfips"; \
265 $(MAKE) -f $(TOP)/Makefile.shared -e \
266 CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \
268 LIBDEPS="$(PLIB_LDFLAG) $$LIBRARIES $(EX_LIBS)" \
269 link_app.$${shlib_target}
271 $(RMDTEST)$(EXE_EXT): $(RMDTEST).o $(DLIBCRYPTO)
272 @target=$(RMDTEST); $(BUILD_CMD)
274 $(MDC2TEST)$(EXE_EXT): $(MDC2TEST).o $(DLIBCRYPTO)
275 @target=$(MDC2TEST); $(BUILD_CMD)
277 $(MD4TEST)$(EXE_EXT): $(MD4TEST).o $(DLIBCRYPTO)
278 @target=$(MD4TEST); $(BUILD_CMD)
280 $(MD5TEST)$(EXE_EXT): $(MD5TEST).o $(DLIBCRYPTO)
281 @target=$(MD5TEST); $(BUILD_CMD)
283 $(HMACTEST)$(EXE_EXT): $(HMACTEST).o $(DLIBCRYPTO)
284 @target=$(HMACTEST); $(BUILD_CMD)
286 $(WPTEST)$(EXE_EXT): $(WPTEST).o $(DLIBCRYPTO)
287 @target=$(WPTEST); $(BUILD_CMD)
289 $(RC2TEST)$(EXE_EXT): $(RC2TEST).o $(DLIBCRYPTO)
290 @target=$(RC2TEST); $(BUILD_CMD)
292 $(BFTEST)$(EXE_EXT): $(BFTEST).o $(DLIBCRYPTO)
293 @target=$(BFTEST); $(BUILD_CMD)
295 $(CASTTEST)$(EXE_EXT): $(CASTTEST).o $(DLIBCRYPTO)
296 @target=$(CASTTEST); $(BUILD_CMD)
298 $(RC4TEST)$(EXE_EXT): $(RC4TEST).o $(DLIBCRYPTO)
299 @target=$(RC4TEST); $(BUILD_CMD)
301 $(RC5TEST)$(EXE_EXT): $(RC5TEST).o $(DLIBCRYPTO)
302 @target=$(RC5TEST); $(BUILD_CMD)
304 $(DESTEST)$(EXE_EXT): $(DESTEST).o $(DLIBCRYPTO)
305 @target=$(DESTEST); $(BUILD_CMD)
307 $(RANDTEST)$(EXE_EXT): $(RANDTEST).o $(DLIBCRYPTO)
308 @target=$(RANDTEST); $(BUILD_CMD)
310 $(DHTEST)$(EXE_EXT): $(DHTEST).o $(DLIBCRYPTO)
311 @target=$(DHTEST); $(BUILD_CMD)
313 $(DSATEST)$(EXE_EXT): $(DSATEST).o $(DLIBCRYPTO)
314 @target=$(DSATEST); $(BUILD_CMD)
316 $(METHTEST)$(EXE_EXT): $(METHTEST).o $(DLIBCRYPTO)
317 @target=$(METHTEST); $(BUILD_CMD)
319 $(SSLTEST)$(EXE_EXT): $(SSLTEST).o $(DLIBSSL) $(DLIBCRYPTO)
320 @target=$(SSLTEST); $(BUILD_CMD)
322 $(DANETEST)$(EXE_EXT): $(DANETEST).o $(DLIBSSL) $(DLIBCRYPTO)
323 @target=$(DANETEST); $(BUILD_CMD)
325 $(ENGINETEST)$(EXE_EXT): $(ENGINETEST).o $(DLIBCRYPTO)
326 @target=$(ENGINETEST); $(BUILD_CMD)
328 $(EVPTEST)$(EXE_EXT): $(EVPTEST).o $(DLIBCRYPTO)
329 @target=$(EVPTEST); $(BUILD_CMD)
331 $(EVPEXTRATEST)$(EXE_EXT): $(EVPEXTRATEST).o $(DLIBCRYPTO)
332 @target=$(EVPEXTRATEST); $(BUILD_CMD)
334 $(P5_CRPT2_TEST)$(EXE_EXT): $(P5_CRPT2_TEST).o $(DLIBCRYPTO)
335 @target=$(P5_CRPT2_TEST); $(BUILD_CMD)
337 $(ECDSATEST)$(EXE_EXT): $(ECDSATEST).o $(DLIBCRYPTO)
338 @target=$(ECDSATEST); $(BUILD_CMD)
340 $(ECDHTEST)$(EXE_EXT): $(ECDHTEST).o $(DLIBCRYPTO)
341 @target=$(ECDHTEST); $(BUILD_CMD)
343 $(IGETEST)$(EXE_EXT): $(IGETEST).o $(DLIBCRYPTO)
344 @target=$(IGETEST); $(BUILD_CMD)
346 $(SECMEMTEST)$(EXE_EXT): $(SECMEMTEST).o $(DLIBCRYPTO)
347 @target=$(SECMEMTEST); $(BUILD_CMD)
349 $(SRPTEST)$(EXE_EXT): $(SRPTEST).o $(DLIBCRYPTO)
350 @target=$(SRPTEST); $(BUILD_CMD)
352 $(V3NAMETEST)$(EXE_EXT): $(V3NAMETEST).o $(DLIBCRYPTO)
353 @target=$(V3NAMETEST); $(BUILD_CMD)
355 $(HEARTBEATTEST)$(EXE_EXT): $(HEARTBEATTEST).o $(DLIBCRYPTO) testutil.o
356 @target=$(HEARTBEATTEST) testutil=testutil.o; $(BUILD_CMD_STATIC)
358 $(CONSTTIMETEST)$(EXE_EXT): $(CONSTTIMETEST).o
359 @target=$(CONSTTIMETEST) $(BUILD_CMD)
361 $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o
362 @target=$(VERIFYEXTRATEST) $(BUILD_CMD)
364 $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o
365 @target=$(CLIENTHELLOTEST) $(BUILD_CMD)
367 $(PACKETTEST)$(EXE_EXT): $(PACKETTEST).o
368 @target=$(PACKETTEST) $(BUILD_CMD)
370 $(ASYNCTEST)$(EXE_EXT): $(ASYNCTEST).o
371 @target=$(ASYNCTEST) $(BUILD_CMD)
373 $(DTLSV1LISTENTEST)$(EXE_EXT): $(DTLSV1LISTENTEST).o
374 @target=$(DTLSV1LISTENTEST) $(BUILD_CMD)
376 $(CTTEST)$(EXE_EXT): $(CTTEST).o testutil.o
377 @target=$(CTTEST) testutil=testutil.o; $(BUILD_CMD)
379 $(THREADSTEST)$(EXE_EXT): $(THREADSTEST).o $(DLIBCRYPTO)
380 @target=$(THREADSTEST) $(BUILD_CMD)
382 dummytest$(EXE_EXT): dummytest.o $(DLIBCRYPTO)
383 @target=dummytest; $(BUILD_CMD)
385 # DO NOT DELETE THIS LINE -- make depend depends on it.