1 # This Makefile builds the user-mode component
2 # of OpenVPN for WIN32 in the MinGW environment.
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)
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:
28 # See additional .bat scripts in install-win32 for OpenSSL
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
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}
180 dynamic : MY_CC = ${CC}
181 dynamic : MY_INCLUDE_DIRS = ${INCLUDE_DIRS}
183 ${MY_CC} -o ${EXE} ${OBJS} ${LIB_DIRS} -lssl32 -leay32 ${LIBS}
185 static : MY_CC = ${CC}
186 static : MY_INCLUDE_DIRS = ${INCLUDE_DIRS}
188 ${CC} -o ${EXE} ${OBJS} ${LIB_DIRS} -lssl -lcrypto ${LIBS}
190 dmalloc : MY_CC = ${CC_DMALLOC}
191 dmalloc : MY_INCLUDE_DIRS = ${INCLUDE_DIRS_DMALLOC}
193 ${MY_CC} -o ${EXE} ${OBJS} ${LIB_DIRS_DMALLOC} -lssl32 -leay32 ${LIBS_DMALLOC}
199 ${MY_CC} ${MY_INCLUDE_DIRS} -c $< -o $@