-# WATCH OUT! This makefile is a work in progress.
+# WATCH OUT! This makefile is a work in progress. -*- makefile -*-
#
# I'm not very knowledgeable about MSVC and nmake beyond their most basic
# aspects. If anything here looks wrong to you, please let me know.
+# If you want OpenSSL support, uncomment and change to where your OpenSSL is
+# OPENSSL_DIR=c:\openssl
+
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+!ELSE
+SSL_CFLAGS=
+!ENDIF
+
# Needed for correctness
-CFLAGS=/IWIN32-Code /Iinclude /Icompat /DHAVE_CONFIG_H /I.
+CFLAGS=/IWIN32-Code /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS)
# For optimization and warnings
CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
event_iocp.obj bufferevent_async.obj
EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj
-ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
-STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib
+!IFDEF OPENSSL_DIR
+SSL_OBJS=bufferevent_openssl.obj
+SSL_LIBS=libevent_openssl.lib
+!ELSE
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) $(SSL_OBJS)
+STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib $(SSL_LIBS)
all: static_libs tests
libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib
+libevent_openssl.lib: $(SSL_OBJS)
+ lib $(LIBFLAGS) $(SSL_OBJS) /out:libevent_openssl.lib
+
clean:
del $(ALL_OBJS)
del $(STATIC_LIBS)
cd test
$(MAKE) /F Makefile.nmake clean
+ cd ..
tests:
cd test
+!IFDEF OPENSSL_DIR
+ $(MAKE) OPENSSL_DIR=$(OPENSSL_DIR) /F Makefile.nmake
+!ELSE
$(MAKE) /F Makefile.nmake
+!ENDIF
+ cd ..
+# WATCH OUT! This makefile is a work in progress. -*- makefile -*-
-CFLAGS=/I.. /I../WIN32-Code /I../include /I../compat /DHAVE_CONFIG_H /DTINYTEST_LOCAL
+!IFDEF OPENSSL_DIR
+SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL
+SSL_OBJS=regress_ssl.obj
+SSL_LIBS=..\libevent_openssl.lib $(OPENSSL_DIR)\lib\libeay32.lib $(OPENSSL_DIR)\lib\ssleay32.lib
+!ELSE
+SSL_CFLAGS=
+SSL_OBJS=
+SSL_LIBS=
+!ENDIF
+
+CFLAGS=/I.. /I../WIN32-Code /I../include /I../compat /DHAVE_CONFIG_H /DTINYTEST_LOCAL $(SSL_CFLAGS)
CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
regress_et.obj regress_bufferevent.obj \
regress_listener.obj regress_util.obj tinytest.obj \
regress_main.obj regress_minheap.obj regress_iocp.obj \
- regress_thread.obj
+ regress_thread.obj $(SSL_OBJS)
OTHER_OBJS=test-init.obj test-eof.obj test-weof.obj test-time.obj \
bench.obj bench_cascade.obj bench_http.obj bench_httpclient.obj \
all: $(PROGRAMS)
regress.exe: $(REGRESS_OBJS)
- $(CC) $(CFLAGS) $(LIBS) $(REGRESS_OBJS)
+ $(CC) $(CFLAGS) $(LIBS) $(SSL_LIBS) $(REGRESS_OBJS)
test-init.exe: test-init.obj
$(CC) $(CFLAGS) $(LIBS) test-init.obj