#
# Copyright (C) 2002 Ilya Volynets, Total Knowledge
#
# This program is free software. Free means freedom.
# You are hereby granted the right to use this program
# in any way you want as long as following conditions are met:
# 1. All source distributions with code unmodified will also retain this
#    notice intact.
# 2. All binary distributions will be accompanied by text file clearly
#    attributing authorship to Ilya Volynets and sopnsorship to
#    Total Knowledge using following wording:
#    "This binary is built from sources developed by Ilya Volynets.
#    Development was kindly sponsored by Total Knowledge"
# 3. All modified versions, if distributed, will clearly indicate
#    that they are not original works and that they were derived from
#    work developed by Ilya Volynets and sponsored by Total Knowledge
#

SSL_INCLUDES= -I/usr/local/ssl/include/openssl -I/usr/local/ssl/include -I/usr/local/include
SSL_LIBS=-lssl

CFLAGS=$(SSL_INCLUDES) -O2 -I../include -g
LIBS=$(SSL_LIBS)
CXXFLAGS=$(CFLAGS)

SSL_PP_LIB=libssl++.so
OBJS=sslobject.o sslconnection.o sslserver.o

all: $(SSL_PP_LIB)

%.o: %.cpp
	g++ $(CXXFLAGS) -c $<

%.d:%.cpp
	g++ $(CXXFLAGS) -M $< >$@

deps: $(OBJS:o=d) 
	cat $^ >$@
	rm -f $^

include deps

$(SSL_PP_LIB): $(OBJS)
	g++ -shared -o libssl++.so $(LIBS) $(LDFLAGS) $(OBJS)

clean:
	rm -f *.o deps core *~ *.d $(SSL_PP_LIB)
