SHELL	= /bin/sh
SRCS	= tls_prng_dev.c tls_prng_egd.c tls_prng_file.c \
	tls_prng_exch.c tls_stream.c tls_bio_ops.c tls_misc.c tls_dh.c \
	tls_rsa.c tls_verify.c tls_certkey.c tls_session.c tls_temp.c \
	tls_client.c tls_server.c tls_scache.c tls_mgr.c tls_seed.c
OBJS	= tls_prng_dev.o tls_prng_egd.o tls_prng_file.o \
	tls_prng_exch.o tls_stream.o tls_bio_ops.o tls_misc.o tls_dh.o \
	tls_rsa.o tls_verify.o tls_certkey.o tls_session.o tls_temp.o \
	tls_client.o tls_server.o tls_scache.o tls_mgr.o tls_seed.o
HDRS	= tls.h tls_prng.h tls_scache.h tls_mgr.h
TESTSRC	= 
DEFS	= -I. -I$(INC_DIR) -D$(SYSTYPE)
CFLAGS	= $(DEBUG) $(OPT) $(DEFS)
INCL	=
LIB	= libtls.a
TESTPROG= tls_dh tls_mgr

LIBS	= ../../lib/libglobal.a ../../lib/libutil.a
LIB_DIR	= ../../lib
INC_DIR	= ../../include
MAKES	=

.c.o:;	$(CC) $(CFLAGS) -c $*.c

all: $(LIB)

Makefile: Makefile.in
	(echo "# DO NOT EDIT"; tail +2 ../../conf/makedefs.out; cat $?) >$@

test:	$(TESTPROG)

$(LIB):	$(OBJS)
	$(AR) $(ARFL) $(LIB) $?
	$(RANLIB) $(LIB)

$(LIB_DIR)/$(LIB): $(LIB)
	cp $(LIB) $(LIB_DIR)
	$(RANLIB) $(LIB_DIR)/$(LIB)

update: $(LIB_DIR)/$(LIB) $(HDRS)
	-for i in $(HDRS); \
	do \
	  cmp -s $$i $(INC_DIR)/$$i 2>/dev/null || cp $$i $(INC_DIR); \
	done
	cd $(INC_DIR); chmod 644 $(HDRS)

printfck: $(OBJS) $(PROG)
	rm -rf printfck
	mkdir printfck
	cp *.h printfck
	sed '1,/^# do not edit/!d' Makefile >printfck/Makefile
	set -e; for i in *.c; do printfck -f .printfck $$i >printfck/$$i; done
	cd printfck; make "INC_DIR=../../../include" `cd ..; ls *.o`

lint:
	lint $(DEFS) $(SRCS) $(LINTFIX)

clean:
	rm -f *.o $(LIB) *core $(TESTPROG) junk
	rm -rf printfck

tidy:	clean

tls_dh:	$(LIB) $(LIBS)
	mv $@.o junk
	$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
	mv junk $@.o

tls_mgr: $(LIB) $(LIBS)
	mv $@.o junk
	$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(LIB) $(LIBS) $(SYSLIBS)
	mv junk $@.o

depend: $(MAKES)
	(sed '1,/^# do not edit/!d' Makefile.in; \
	set -e; for i in [a-z][a-z0-9]*.c; do \
	    $(CC) -E $(DEFS) $(INCL) $$i | grep -v '[<>]' | sed -n -e '/^# *1 *"\([^"]*\)".*/{' \
	    -e 's//'`echo $$i|sed 's/c$$/o/'`': \1/' -e 'p' -e '}'; \
	done) | grep -v '[.][o][:][ ][/]' >$$$$ && mv $$$$ Makefile.in
	@$(EXPORT) make -f Makefile.in Makefile 1>&2

# do not edit below this line - it is generated by 'make depend'
tls_bio_ops.o: tls_bio_ops.c
tls_bio_ops.o: ../../include/sys_defs.h
tls_bio_ops.o: ../../include/msg.h
tls_bio_ops.o: ../../include/iostuff.h
tls_bio_ops.o: tls.h
tls_bio_ops.o: ../../include/vstream.h
tls_bio_ops.o: ../../include/vbuf.h
tls_bio_ops.o: ../../include/vstring.h
tls_certkey.o: tls_certkey.c
tls_certkey.o: ../../include/sys_defs.h
tls_certkey.o: ../../include/msg.h
tls_certkey.o: tls.h
tls_certkey.o: ../../include/vstream.h
tls_certkey.o: ../../include/vbuf.h
tls_certkey.o: ../../include/vstring.h
tls_client.o: tls_client.c
tls_client.o: ../../include/sys_defs.h
tls_client.o: ../../include/mymalloc.h
tls_client.o: ../../include/vstring.h
tls_client.o: ../../include/vbuf.h
tls_client.o: ../../include/vstream.h
tls_client.o: ../../include/stringops.h
tls_client.o: ../../include/msg.h
tls_client.o: ../../include/mail_params.h
tls_client.o: tls_mgr.h
tls_client.o: tls.h
tls_dh.o: tls_dh.c
tls_dh.o: ../../include/sys_defs.h
tls_dh.o: ../../include/msg.h
tls_dh.o: tls.h
tls_dh.o: ../../include/vstream.h
tls_dh.o: ../../include/vbuf.h
tls_dh.o: ../../include/vstring.h
tls_mgr.o: tls_mgr.c
tls_mgr.o: ../../include/sys_defs.h
tls_mgr.o: ../../include/msg.h
tls_mgr.o: ../../include/vstream.h
tls_mgr.o: ../../include/vbuf.h
tls_mgr.o: ../../include/vstring.h
tls_mgr.o: ../../include/attr.h
tls_mgr.o: ../../include/attr_clnt.h
tls_mgr.o: ../../include/mail_params.h
tls_mgr.o: ../../include/mail_proto.h
tls_mgr.o: ../../include/iostuff.h
tls_mgr.o: tls_mgr.h
tls_misc.o: tls_misc.c
tls_misc.o: ../../include/sys_defs.h
tls_misc.o: ../../include/vstream.h
tls_misc.o: ../../include/vbuf.h
tls_misc.o: ../../include/msg.h
tls_misc.o: ../../include/mymalloc.h
tls_misc.o: ../../include/vstring.h
tls_misc.o: tls.h
tls_prng_dev.o: tls_prng_dev.c
tls_prng_dev.o: ../../include/sys_defs.h
tls_prng_dev.o: ../../include/msg.h
tls_prng_dev.o: ../../include/mymalloc.h
tls_prng_dev.o: ../../include/connect.h
tls_prng_dev.o: ../../include/iostuff.h
tls_prng_dev.o: tls_prng.h
tls_prng_egd.o: tls_prng_egd.c
tls_prng_egd.o: ../../include/sys_defs.h
tls_prng_egd.o: ../../include/msg.h
tls_prng_egd.o: ../../include/mymalloc.h
tls_prng_egd.o: ../../include/connect.h
tls_prng_egd.o: ../../include/iostuff.h
tls_prng_egd.o: tls_prng.h
tls_prng_exch.o: tls_prng_exch.c
tls_prng_exch.o: ../../include/sys_defs.h
tls_prng_exch.o: ../../include/msg.h
tls_prng_exch.o: ../../include/mymalloc.h
tls_prng_exch.o: ../../include/iostuff.h
tls_prng_exch.o: ../../include/myflock.h
tls_prng_exch.o: tls_prng.h
tls_prng_file.o: tls_prng_file.c
tls_prng_file.o: ../../include/sys_defs.h
tls_prng_file.o: ../../include/msg.h
tls_prng_file.o: ../../include/mymalloc.h
tls_prng_file.o: ../../include/connect.h
tls_prng_file.o: ../../include/iostuff.h
tls_prng_file.o: tls_prng.h
tls_rsa.o: tls_rsa.c
tls_rsa.o: ../../include/sys_defs.h
tls_rsa.o: tls.h
tls_rsa.o: ../../include/vstream.h
tls_rsa.o: ../../include/vbuf.h
tls_rsa.o: ../../include/vstring.h
tls_scache.o: tls_scache.c
tls_scache.o: ../../include/sys_defs.h
tls_scache.o: ../../include/msg.h
tls_scache.o: ../../include/dict.h
tls_scache.o: ../../include/vstream.h
tls_scache.o: ../../include/vbuf.h
tls_scache.o: ../../include/argv.h
tls_scache.o: ../../include/stringops.h
tls_scache.o: ../../include/vstring.h
tls_scache.o: ../../include/mymalloc.h
tls_scache.o: ../../include/hex_code.h
tls_scache.o: ../../include/myflock.h
tls_scache.o: tls_scache.h
tls_seed.o: tls_seed.c
tls_seed.o: ../../include/sys_defs.h
tls_seed.o: ../../include/msg.h
tls_seed.o: ../../include/vstring.h
tls_seed.o: ../../include/vbuf.h
tls_seed.o: tls_mgr.h
tls_seed.o: tls.h
tls_seed.o: ../../include/vstream.h
tls_server.o: tls_server.c
tls_server.o: ../../include/sys_defs.h
tls_server.o: ../../include/mymalloc.h
tls_server.o: ../../include/vstring.h
tls_server.o: ../../include/vbuf.h
tls_server.o: ../../include/vstream.h
tls_server.o: ../../include/dict.h
tls_server.o: ../../include/argv.h
tls_server.o: ../../include/stringops.h
tls_server.o: ../../include/msg.h
tls_server.o: ../../include/hex_code.h
tls_server.o: ../../include/mail_params.h
tls_server.o: tls_mgr.h
tls_server.o: tls.h
tls_session.o: tls_session.c
tls_session.o: ../../include/sys_defs.h
tls_session.o: ../../include/vstream.h
tls_session.o: ../../include/vbuf.h
tls_session.o: ../../include/msg.h
tls_session.o: ../../include/mymalloc.h
tls_session.o: tls.h
tls_session.o: ../../include/vstring.h
tls_stream.o: tls_stream.c
tls_stream.o: ../../include/sys_defs.h
tls_stream.o: ../../include/iostuff.h
tls_stream.o: ../../include/vstream.h
tls_stream.o: ../../include/vbuf.h
tls_stream.o: ../../include/msg.h
tls_stream.o: tls.h
tls_stream.o: ../../include/vstring.h
tls_temp.o: tls_temp.c
tls_temp.o: ../../include/sys_defs.h
tls_temp.o: tls.h
tls_temp.o: ../../include/vstream.h
tls_temp.o: ../../include/vbuf.h
tls_temp.o: ../../include/vstring.h
tls_verify.o: tls_verify.c
tls_verify.o: ../../include/sys_defs.h
tls_verify.o: ../../include/msg.h
tls_verify.o: tls.h
tls_verify.o: ../../include/vstream.h
tls_verify.o: ../../include/vbuf.h
tls_verify.o: ../../include/vstring.h
