svn cleanup
[anytun.git] / openvpn / makefile.w32
blobc70d25681d3b2faa6890405dc67a6765339477af
1 # This Makefile builds the user-mode component
2 # of OpenVPN for WIN32 in the MinGW environment.
4 # Build Dependencies:
5 #       mingw           (GNU C compiler for windows)
6 #       msys            (GNU utilities and shell for windows)
7 #       OpenSSL         (SSL/TLS/crypto library)
8 #       LZO             (real-time compression library)
9 #       Dmalloc         (debugging only)
11 # Targets:
12 #       static -- link statically with OpenSSL
13 #       dynamic -- link dynamically with OpenSSL
14 #       dmalloc -- enable memory debugging using the dmalloc library 
16 # Note that LZO is always linked statically.
18 # To build openssl-0.9.7d, remember to edit ms\mw.bat
19 # adding '--win32' flag to make command:
21 #   make --win32 -f ms/mingw32.mak
23 # Now cd to top level openssl directory in a Windows
24 # command-prompt window, and type:
26 #   ms\mw
28 # See additional .bat scripts in install-win32 for OpenSSL
29 # build setup.
31 # If you are building with dmalloc debugging support
32 # see windbg.h for additional dmalloc notes.
34 #########################################################
35 # Change these to point to your OpenSSL, LZO, and
36 # (optionally) dmalloc top-level directories.
37 # If you are using the prebuild script, set the OpenSSL
38 # lib path in the prebuild script, not here.
40 OPENSSL = /c/src/openssl-0.9.7k
41 LZO = /c/src/lzo-1.08
42 DMALLOC = /c/src/dmalloc-5.4.2
44 #########################################################
46 CC = gcc -g -O2 -Wall -Wno-unused-function -Wno-unused-variable -mno-cygwin
48 CC_DMALLOC = gcc -g -O2 -Wall -Wno-unused-function -Wno-unused-variable -mno-cygwin -fno-inline -DDMALLOC
50 INCLUDE_DIRS = -I${OPENSSL}/include -I${LZO}/include
52 INCLUDE_DIRS_DMALLOC = ${INCLUDE_DIRS} -I${DMALLOC}
54 LIBS = -llzo -lcrypt32 -lws2_32 -lgdi32 -liphlpapi -lwinmm
56 LIBS_DMALLOC = ${LIBS} -ldmalloc
58 LIB_DIRS = -L${OPENSSL}/out -L${LZO}
60 LIB_DIRS_DMALLOC = ${LIB_DIRS} -L${DMALLOC}
62 EXE = openvpn.exe
64 HEADERS = \
65         base64.h \
66         basic.h \
67         buffer.h \
68         circ_list.h \
69         common.h \
70         tap-win32/common.h \
71         config-win32.h \
72         crypto.h \
73         cryptoapi.h \
74         errlevel.h \
75         error.h \
76         event.h \
77         fdmisc.h \
78         forward-inline.h \
79         forward.h \
80         fragment.h \
81         gremlin.h \
82         helper.h \
83         init.h \
84         integer.h \
85         interval.h \
86         list.h \
87         lzo.h \
88         manage.h \
89         mbuf.h \
90         memdbg.h \
91         misc.h \
92         mroute.h \
93         mss.h \
94         mtcp.h \
95         mtu.h \
96         mudp.h \
97         multi.h \
98         ntlm.h \
99         occ-inline.h \
100         occ.h \
101         openvpn.h \
102         openvpn-plugin.h \
103         options.h \
104         otime.h \
105         packet_id.h \
106         perf.h \
107         ping-inline.h \
108         ping.h \
109         plugin.h \
110         pool.h \
111         proto.h \
112         proxy.h \
113         push.h \
114         reliable.h \
115         route.h \
116         schedule.h \
117         session_id.h \
118         shaper.h \
119         sig.h \
120         socket.h \
121         socks.h \
122         ssl.h \
123         status.h \
124         syshead.h \
125         thread.h \
126         tun.h \
127         win32.h
129 OBJS =  base64.o \
130         buffer.o \
131         crypto.o \
132         cryptoapi.o \
133         error.o \
134         event.o \
135         fdmisc.o \
136         forward.o \
137         fragment.o \
138         gremlin.o \
139         helper.o \
140         init.o \
141         interval.o \
142         list.o \
143         lzo.o \
144         manage.o \
145         mbuf.o \
146         misc.o \
147         mroute.o \
148         mss.o \
149         mtcp.o \
150         mtu.o \
151         mudp.o \
152         multi.o \
153         ntlm.o \
154         occ.o \
155         openvpn.o \
156         options.o \
157         otime.o \
158         packet_id.o \
159         perf.o \
160         ping.o \
161         plugin.o \
162         pool.o \
163         proto.o \
164         proxy.o \
165         push.o \
166         reliable.o \
167         route.o \
168         schedule.o \
169         session_id.o \
170         shaper.o \
171         sig.o \
172         socket.o \
173         socks.o \
174         ssl.o \
175         status.o \
176         thread.o \
177         tun.o \
178         win32.o
180 dynamic : MY_CC = ${CC}
181 dynamic : MY_INCLUDE_DIRS = ${INCLUDE_DIRS}
182 dynamic : ${OBJS}
183         ${MY_CC} -o ${EXE} ${OBJS} ${LIB_DIRS} -lssl32 -leay32 ${LIBS}
185 static : MY_CC = ${CC}
186 static : MY_INCLUDE_DIRS = ${INCLUDE_DIRS}
187 static : ${OBJS}
188         ${CC} -o ${EXE} ${OBJS} ${LIB_DIRS} -lssl -lcrypto ${LIBS}
190 dmalloc : MY_CC = ${CC_DMALLOC}
191 dmalloc : MY_INCLUDE_DIRS = ${INCLUDE_DIRS_DMALLOC}
192 dmalloc : ${OBJS}
193         ${MY_CC} -o ${EXE} ${OBJS} ${LIB_DIRS_DMALLOC} -lssl32 -leay32 ${LIBS_DMALLOC}
195 clean :
196         rm -f ${OBJS} ${EXE}
198 %.o : %.c ${HEADERS}
199         ${MY_CC} ${MY_INCLUDE_DIRS} -c $< -o $@