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