# Simple Makefile.w32 for stunnel.exe by Michal Trojnara 1998-2000
#
# Modified by Brian Hatch  (bri@stunnel.org)

# This makefile is only tested on the mingw compiler.  Mingw
# can successfully compile both openssl and stunnel.  If you want
# to use another compiler, give it a shot, and tell us how it went.

# Modify this to point to your actual openssl compile directory
# (You did already compile openssl, didn't you???)
SSLDIR=../openssl-0.9.6

DEFINES=-DUSE_WIN32 -DHAVE_OPENSSL

# You may want to add some of the following flags
# to the DEFINES definition above.

# Location of default certificate file for -v option
#    -DCERT_FILE=\"/stunnel/certs/certs.pem\"

# Location of default certificate directory for -v option
#    -DCERT_DIR=\"/stunnel/certs\"

# Default directory for stunnel.pem file
#    -DPEM_DIR=\"/stunnel/private\"

# Use the default certificate sources from your ssl library?  (0==no, 1==yes)
#    -DSSLLIB_CS=0

CC=gcc
CFLAGS=-O2 -Wall $(DEFINES) -I$(SSLDIR)/outinc
LDFLAGS=-s

# LIBS=-L$(SSLDIR)/out -lssl -lcrypto -lwsock32 -lgdi32

LIBS=-L$(SSLDIR)/out -leay32 -lssl32 -lwsock32 -lgdi32
OBJS=stunnel.o ssl.o protocol.o sthreads.o log.o

stunnel.exe: $(OBJS)
	$(CC) $(LDFLAGS) -o stunnel.exe $(OBJS) $(LIBS)

clean:
	del *.o
	del stunnel.exe

