]> granicus.if.org Git - libevent/commitdiff
Add nmake files to build with MSVC.
authorNick Mathewson <nickm@torproject.org>
Thu, 5 Nov 2009 20:40:11 +0000 (20:40 +0000)
committerNick Mathewson <nickm@torproject.org>
Thu, 5 Nov 2009 20:40:11 +0000 (20:40 +0000)
Right now, they just make static libraries and unit tests.  They probably set lots of options wrong.

svn:r1507

Makefile.nmake [new file with mode: 0644]
test/Makefile.nmake [new file with mode: 0644]

diff --git a/Makefile.nmake b/Makefile.nmake
new file mode 100644 (file)
index 0000000..8d56dfa
--- /dev/null
@@ -0,0 +1,47 @@
+# 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.
+
+# Needed for correctness
+CFLAGS=/Iinclude /Icompat /IWIN32-Code /DWIN32 /DHAVE_CONFIG_H /I.
+
+# For optimization and warnings
+CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
+
+# XXXX have a debug mode
+
+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
+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 bufferevent_evdns.obj evrpc.obj
+
+ALL_OBJS=$(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
+STATIC_LIBS=libevent_core.lib libevent_extras.lib libevent.lib
+
+
+all: static_libs tests
+
+static_libs: $(STATIC_LIBS)
+
+libevent_core.lib: $(CORE_OBJS) $(WIN_OBJS)
+       lib $(LIBFLAGS) $(CORE_OBJS) $(WIN_OBJS) /out:libevent_core.lib 
+
+libevent_extras.lib: $(EXTRA_OBJS)
+       lib $(LIBFLAGS) $(EXTRA_OBJS) /out:libevent_extras.lib
+
+libevent.lib: $(CORE_OBJS) $(WIN_OBJS) $(EXTRA_OBJS)
+       lib $(LIBFLAGS) $(CORE_OBJS) $(EXTRA_OBJS) $(WIN_OBJS) /out:libevent.lib
+
+clean:
+       del $(ALL_OBJS)
+       del $(STATIC_LIBS)
+       cd test
+       $(MAKE) /F Makefile.nmake clean
+
+tests:
+       cd test
+       $(MAKE) /F Makefile.nmake
diff --git a/test/Makefile.nmake b/test/Makefile.nmake
new file mode 100644 (file)
index 0000000..ffdd3d9
--- /dev/null
@@ -0,0 +1,50 @@
+
+CFLAGS=/I.. /I../include /I../WIN32-Code /I../compat /DWIN32 /DHAVE_CONFIG_H
+
+CFLAGS=$(CFLAGS) /Ox /W3 /wd4996 /nologo
+
+REGRESS_OBJS=regress.obj regress_buffer.obj regress_http.obj regress_dns.obj \
+        regress_rpc.obj regress.gen.obj \
+       regress_et.obj regress_bufferevent.obj \
+       regress_listener.obj regress_util.obj tinytest.obj \
+       regress_main.obj regress_minheap.obj regress_iocp.obj
+
+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
+
+PROGRAMS=regress.exe \
+       test-init.exe test-eof.exe test-weof.exe test-time.exe
+
+# Disabled for now:
+#      bench.exe bench_cascade.exe bench_http.exe bench_httpclient.exe
+
+
+LIBS=..\libevent.lib ws2_32.lib advapi32.lib
+
+all: $(PROGRAMS)
+
+regress.exe: $(REGRESS_OBJS)
+       $(CC) $(CFLAGS) $(LIBS) $(REGRESS_OBJS)
+
+test-init.exe: test-init.obj
+       $(CC) $(CFLAGS) $(LIBS) test-init.obj
+test-eof.exe: test-eof.obj
+       $(CC) $(CFLAGS) $(LIBS) test-eof.obj
+test-weof.exe: test-weof.obj
+       $(CC) $(CFLAGS) $(LIBS) test-weof.obj
+test-time.exe: test-time.obj
+       $(CC) $(CFLAGS) $(LIBS) test-time.obj
+
+bench.exe: bench.obj
+       $(CC) $(CFLAGS) $(LIBS) bench.obj
+bench_cascade.exe: bench_cascade.obj
+       $(CC) $(CFLAGS) $(LIBS) bench_cascade.obj
+bench_http.exe: bench_http.obj
+       $(CC) $(CFLAGS) $(LIBS) bench_http.obj
+bench_httpclient.exe: bench_httpclient.obj
+       $(CC) $(CFLAGS) $(LIBS) bench_httpclient.obj
+
+clean:
+       -del $(REGRESS_OBJS)
+       -del $(OTHER_OBJS)
+       -del regress.exe