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

noinst_LIBRARIES=libdes.a
TESTS=destest
EXTRA_PROGRAMS=des des_opts destest rpw speed

libdes_a_SOURCES=cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c \
	cfb_enc.c ecb3_enc.c ecb_enc.c ede_enc.c enc_read.c enc_writ.c \
	fcrypt.c ncbc_enc.c ofb64ede.c ofb64enc.c ofb_enc.c pcbc_enc.c \
	qud_cksm.c rand_key.c read2pwd.c read_pwd.c rpc_enc.c set_key.c \
	str2key.c supp.c xcbc_enc.c
EXTRA_libdes_a_SOURCES=des_enc.c fcrypt_b.c
libdes_a_LIBADD=$(DES_ENC)
libdes_a_DEPENDENCIES=$(DES_ENC)

EXTRA_DIST=COPYRIGHT DES.pm DES.pod DES.xs FILES INSTALL Imakefile KERBEROS \
	MODES.DES Makefile.PL Makefile.lit Makefile.ssl Makefile.uni PC1 \
	PC2 README VERSION des.doc des.h des.man des.org des.pl des_crypt.man \
	des_locl.h des_locl.org des_ver.h doIP doPC1 doPC2 makefile.bc \
	options.txt podd.h rpc_des.h shifts.pl sk.h spr.h testdes.pl \
	typemap vms.com

des_SOURCES=des.c
des_LDADD=-lcrypto
des_LDFLAGS=-L$(top_builddir)/crypto
des_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a

des_opts_SOURCES=des_opts.c set_key.c

destest_SOURCES=destest.c
destest_LDADD=-lcrypto
destest_LDFLAGS=-L$(top_builddir)/crypto
destest_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a

rpw_SOURCES=rpw.c
rpw_LDADD=-lcrypto
rpw_LDFLAGS=-L$(top_builddir)/crypto
rpw_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a

speed_SOURCES=speed.c
speed_LDADD=-lcrypto
speed_LDFLAGS=-L$(top_builddir)/crypto
speed_DEPENDENCIES=$(top_builddir)/crypto/libcrypto.a

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

if ASM_DES_ENC
$(DES_ENC):
	cd asm; $(MAKE) $(MFLAGS) `echo $(DES_ENC) | sed -e 's@asm/@@g'`
endif
