EXTRA_PROGRAMS=cli inetdsrv serv
SUFFIXES=.cpp .c .o

cli_SOURCES=cli.c
cli_LDFLAGS=-L$(top_builddir)/crypto -L$(top_builddir)/ssl
cli_LDADD=-lssl -lcrypto
cli_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a \
$(top_builddir)/ssl/libssl.a

inetdsrv_SOURCES=inetdsrv.c
inetdsrv_LDFLAGS=-L$(top_builddir)/crypto -L$(top_builddir)/ssl
inetdsrv_LDADD=-lssl -lcrypto
inetdsrv_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a \
$(top_builddir)/ssl/libssl.a

serv_SOURCES=serv.c
serv_LDFLAGS=-L$(top_builddir)/crypto -L$(top_builddir)/ssl
serv_LDADD=-lssl -lcrypto
serv_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a \
$(top_builddir)/ssl/libssl.a

EXTRA_DIST=cli.cpp inetdsrv.cpp serv.cpp

# Somebody was being silly.
.cpp.c:
	rm -f $@
	$(LN_S) $< $@

$(top_builddir)/crypto/libcrypto.a:
	cd $(top_builddir)/crypto; $(MAKE) $(MFLAGS) libcrypto.a

$(top_builddir)/ssl/libssl.a:
	cd $(top_builddir)/ssl; $(MAKE) $(MFLAGS) libssl.a
