diff options
author | Patrick Pelletier <code@funwithsoftware.org> | 2012-06-08 19:47:23 -0700 |
---|---|---|
committer | Patrick Pelletier <code@funwithsoftware.org> | 2012-07-03 22:50:24 -0700 |
commit | eba0eb2e71a975517b88099cf1f925e1712fe03a (patch) | |
tree | 6341f31ae7c92fb1488b7ca09e25ccaa9994af4c | |
parent | e7bf4c84afd7961eb92a2d6583c84b56a87f2555 (diff) | |
download | libevent-eba0eb2e71a975517b88099cf1f925e1712fe03a.tar.gz |
attempt to support OpenSSL in Makefile.nmake
-rw-r--r-- | Makefile.nmake | 34 | ||||
-rw-r--r-- | test/Makefile.nmake | 17 |
2 files changed, 44 insertions, 7 deletions
diff --git a/Makefile.nmake b/Makefile.nmake index f0ec1023..76a423b4 100644 --- a/Makefile.nmake +++ b/Makefile.nmake @@ -1,10 +1,19 @@ -# 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 @@ -21,8 +30,16 @@ 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 @@ -38,12 +55,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 .. diff --git a/test/Makefile.nmake b/test/Makefile.nmake index 6f37db9b..f33ca530 100644 --- a/test/Makefile.nmake +++ b/test/Makefile.nmake @@ -1,5 +1,16 @@ +# 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 @@ -9,7 +20,7 @@ REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \ 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 \ @@ -28,7 +39,7 @@ LIBS=..\libevent.lib ws2_32.lib shell32.lib advapi32.lib 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 |