Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 1 | # WATCH OUT! This makefile is a work in progress. -*- makefile -*- |
| 2 | # |
| 3 | # I'm not very knowledgeable about MSVC and nmake beyond their most basic |
| 4 | # aspects. If anything here looks wrong to you, please let me know. |
| 5 | |
| 6 | # If OPENSSL_DIR is not set, builds without OpenSSL support. If you want |
| 7 | # OpenSSL support, you can set the OPENSSL_DIR variable to where you |
| 8 | # installed OpenSSL. This can be done in the environment: |
| 9 | # set OPENSSL_DIR=c:\openssl |
| 10 | # Or on the nmake command line: |
| 11 | # nmake OPENSSL_DIR=C:\openssl -f Makefile.nmake |
| 12 | # Or by uncommenting the following line here in the makefile... |
| 13 | |
| 14 | # OPENSSL_DIR=c:\openssl |
| 15 | |
| 16 | !IFDEF OPENSSL_DIR |
| 17 | SSL_CFLAGS=/I$(OPENSSL_DIR)\include /DEVENT__HAVE_OPENSSL |
| 18 | !ELSE |
| 19 | SSL_CFLAGS= |
| 20 | !ENDIF |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 21 | |
| 22 | # Needed for correctness |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 23 | CFLAGS=/IWIN32-Code /IWIN32-Code/nmake /Iinclude /Icompat /DHAVE_CONFIG_H /I. $(SSL_CFLAGS) |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 24 | |
| 25 | # For optimization and warnings |
| 26 | CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo |
| 27 | |
| 28 | # XXXX have a debug mode |
| 29 | |
| 30 | LIBFLAGS=/nologo |
| 31 | |
| 32 | CORE_OBJS=event.obj buffer.obj bufferevent.obj bufferevent_sock.obj \ |
| 33 | bufferevent_pair.obj listener.obj evmap.obj log.obj evutil.obj \ |
| 34 | strlcpy.obj signal.obj bufferevent_filter.obj evthread.obj \ |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 35 | bufferevent_ratelim.obj evutil_rand.obj evutil_time.obj |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 36 | WIN_OBJS=win32select.obj evthread_win32.obj buffer_iocp.obj \ |
| 37 | event_iocp.obj bufferevent_async.obj |
| 38 | EXTRA_OBJS=event_tagging.obj http.obj evdns.obj evrpc.obj |
| 39 | |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 40 | !IFDEF OPENSSL_DIR |
| 41 | SSL_OBJS=bufferevent_openssl.obj |
| 42 | SSL_LIBS=libevent_openssl.lib |
| 43 | !ELSE |
| 44 | SSL_OBJS= |
| 45 | SSL_LIBS= |
| 46 | !ENDIF |
| 47 | |
| 48 | ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) $(SSL_OBJS) |
| 49 | STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib $(SSL_LIBS) |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 50 | |
| 51 | |
| 52 | all: static_libs tests |
| 53 | |
| 54 | static_libs: $(STATIC_LIBS) |
| 55 | |
| 56 | libevent_core.lib: $(CORE_OBJS) $(WIN_OBJS) |
| 57 | lib $(LIBFLAGS) $(CORE_OBJS) $(WIN_OBJS) /out:libevent_core.lib |
| 58 | |
| 59 | libevent_extras.lib: $(EXTRA_OBJS) |
| 60 | lib $(LIBFLAGS) $(EXTRA_OBJS) /out:libevent_extras.lib |
| 61 | |
| 62 | libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS) |
| 63 | lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib |
| 64 | |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 65 | libevent_openssl.lib: $(SSL_OBJS) |
| 66 | lib $(LIBFLAGS) $(SSL_OBJS) /out:libevent_openssl.lib |
| 67 | |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 68 | clean: |
| 69 | del $(ALL_OBJS) |
| 70 | del $(STATIC_LIBS) |
| 71 | cd test |
| 72 | $(MAKE) /F Makefile.nmake clean |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 73 | cd .. |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 74 | |
| 75 | tests: |
| 76 | cd test |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 77 | !IFDEF OPENSSL_DIR |
| 78 | $(MAKE) OPENSSL_DIR=$(OPENSSL_DIR) /F Makefile.nmake |
| 79 | !ELSE |
Christopher Wiley | e867981 | 2015-07-01 13:36:18 -0700 | [diff] [blame] | 80 | $(MAKE) /F Makefile.nmake |
Narayan Kamath | fc74cb4 | 2017-09-13 12:53:52 +0100 | [diff] [blame] | 81 | !ENDIF |
| 82 | cd .. |