SUBDIRS=asm
INCLUDES=-I$(top_srcdir)/crypto

noinst_LIBRARIES=libbf.a
TESTS=bftest
EXTRA_PROGRAMS=bfspeed bftest

libbf_a_SOURCES=bf_cbc.c bf_cfb64.c bf_ecb.c bf_ofb64.c bf_skey.c
libbf_a_LIBADD=$(BF_ENC)
libbf_a_DEPENDENCIES=$(BF_ENC)

bftest_SOURCES=bftest.c
bftest_LDADD=-lcrypto
bftest_LDFLAGS=-L$(top_builddir)/crypto
bftest_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a

bfspeed_SOURCES=bfspeed.c
bfspeed_LDADD=-lcrypto
bfspeed_LDFLAGS=-L$(top_builddir)/crypto
bfspeed_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a

EXTRA_libbf_a_SOURCES=bf_enc.c
EXTRA_DIST=COPYRIGHT INSTALL Makefile.ssl Makefile.uni README VERSION \
	bf_locl bf_locl.h bf_locl.org bf_pi.h blowfish.doc blowfish.h

if ASM_BF_ENC
$(BF_ENC):
	cd asm; $(MAKE) $(MFLAGS) "`basename $(BF_ENC)`"
endif

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