aboutsummaryrefslogtreecommitdiff
path: root/Makefile.nmake
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2017-08-07 14:18:18 -0700
committerElliott Hughes <enh@google.com>2017-08-07 16:58:18 -0700
commit2a572d125a91a4aafd3ad8ce87259fc640fa0763 (patch)
treebd05e575a4a2629cc420c5e2bc54f176fee611ab /Makefile.nmake
parent596447c7ff2881a67e7082c905112584c3e61a17 (diff)
downloadlibevent-2a572d125a91a4aafd3ad8ce87259fc640fa0763.tar.gz
Upgrade to 2.1.8-stable (2017-01-22).
Bug: N/A Test: builds Change-Id: Idbbdc1db3d01984a4f4b60f8fdf455140b6b7ca6
Diffstat (limited to 'Makefile.nmake')
-rw-r--r--Makefile.nmake47
1 files changed, 41 insertions, 6 deletions
diff --git a/Makefile.nmake b/Makefile.nmake
index 4cd04c1..f27cd61 100644
--- a/Makefile.nmake
+++ b/Makefile.nmake
@@ -1,8 +1,26 @@
-# WATCH OUT! This makefile is a work in progress. It is probably missing
-# tons of important things. DO NOT RELY ON IT TO BUILD A GOOD LIBEVENT.
+# 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 OPENSSL_DIR is not set, builds without OpenSSL support. If you want
+# OpenSSL support, you can set the OPENSSL_DIR variable to where you
+# installed OpenSSL. This can be done in the environment:
+# set OPENSSL_DIR=c:\openssl
+# Or on the nmake command line:
+# nmake OPENSSL_DIR=C:\openssl -f Makefile.nmake
+# Or by uncommenting the following line here in the makefile...
+
+# 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 /DWIN32 /DHAVE_CONFIG_H /I.
+CFLAGS=/IWIN32-Code /IWIN32-Code/nmake /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS)
# For optimization and warnings
CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
@@ -14,13 +32,21 @@ LIBFLAGS=/nologo
CORE_OBJS=event.obj buffer.obj bufferevent.obj bufferevent_sock.obj \
bufferevent_pair.obj listener.obj evmap.obj log.obj evutil.obj \
strlcpy.obj signal.obj bufferevent_filter.obj evthread.obj \
- bufferevent_ratelim.obj evutil_rand.obj
+ bufferevent_ratelim.obj evutil_rand.obj evutil_time.obj
WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \
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
@@ -36,12 +62,21 @@ libevent_extras.lib: $(EXTRA_OBJS)
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 ..