SUBDIRS=asn1 bf bio bn buffer conf des dh dsa err evp idea lhash md mdc2 \
	objects pem perlasm pkcs7 rand rc2 rc4 rsa sha stack txt_db x509

lib_LIBRARIES=libcrypto.a

libcrypto_a_SOURCES=cryptlib.c mem.c cversion.c
libcrypto_a_SUBLIBS=asn1/libasn1.a bf/libbf.a bio/libbio.a bn/libbn.a \
	buffer/libbuf.a conf/libconf.a des/libdes.a dh/libdh.a dsa/libdsa.a \
	err/liberr.a evp/libevp.a idea/libidea.a lhash/liblh.a md/libmd.a \
	mdc2/libmdc2.a objects/libobj.a pem/libpem.a pkcs7/libpkcs7.a \
	rand/librand.a rc2/librc2.a rc4/librc4.a rsa/librsa.a sha/libsha.a \
	stack/libstack.a txt_db/libtxt.a x509/libx509.a

LIBOBJECTS=$(libcrypto_a_OBJECTS) @LIBOBJS@ # @ALLOCA@

EXTRA_DIST=Makefile.ssl cryptall.h cryptlib.h crypto.c crypto.h libvms.com

BUILT_SOURCES=date.h

date.h: ../config.status
	echo "#define DATE	\"`date`\"" > date.h

# Bother.
SAFECOMPILE=`echo '$(COMPILE)' | sed -e 's/-DX509[^ ]*//'`

cversion.o: cversion.c
	$(COMPILE) -DCFLAGS="\"$(SAFECOMPILE)\"" -o cversion.o -c cversion.c

libcrypto.a: $(libcrypto_a_SUBLIBS) $(LIBOBJECTS)
	rm -rf allobjs libcrypto.a
	mkdir allobjs
	cp $(LIBOBJECTS) allobjs
	cd allobjs; \
	for x in $(libcrypto_a_SUBLIBS); do ar x "../$$x"; done; \
	ar cr ../libcrypto.a *.o
	$(RANLIB) libcrypto.a
	rm -rf allobjs

asn1/libasn1.a:
	cd asn1; $(MAKE) $(MFLAGS) libasn1.a

bf/libbf.a:
	cd bf; $(MAKE) $(MFLAGS) libbf.a

bio/libbio.a:
	cd bio; $(MAKE) $(MFLAGS) libbio.a

bn/libbn.a:
	cd bn; $(MAKE) $(MFLAGS) libbn.a

buffer/libbuf.a:
	cd buffer; $(MAKE) $(MFLAGS) libbuf.a

conf/libconf.a:
	cd conf; $(MAKE) $(MFLAGS) libconf.a

des/libdes.a:
	cd des; $(MAKE) $(MFLAGS) libdes.a

dh/libdh.a:
	cd dh; $(MAKE) $(MFLAGS) libdh.a

dsa/libdsa.a:
	cd dsa; $(MAKE) $(MFLAGS) libdsa.a

err/liberr.a:
	cd err; $(MAKE) $(MFLAGS) liberr.a

evp/libevp.a:
	cd evp; $(MAKE) $(MFLAGS) libevp.a

idea/libidea.a:
	cd idea; $(MAKE) $(MFLAGS) libidea.a

lhash/liblh.a:
	cd lhash; $(MAKE) $(MFLAGS) liblh.a

md/libmd.a:
	cd md; $(MAKE) $(MFLAGS) libmd.a

mdc2/libmdc2.a:
	cd mdc2; $(MAKE) $(MFLAGS) libmdc2.a

objects/libobj.a:
	cd objects; $(MAKE) $(MFLAGS) libobj.a

pem/libpem.a:
	cd pem; $(MAKE) $(MFLAGS) libpem.a

pkcs7/libpkcs7.a:
	cd pkcs7; $(MAKE) $(MFLAGS) libpkcs7.a

rand/librand.a:
	cd rand; $(MAKE) $(MFLAGS) librand.a

rc2/librc2.a:
	cd rc2; $(MAKE) $(MFLAGS) librc2.a

rc4/librc4.a:
	cd rc4; $(MAKE) $(MFLAGS) librc4.a

rsa/librsa.a:
	cd rsa; $(MAKE) $(MFLAGS) librsa.a

sha/libsha.a:
	cd sha; $(MAKE) $(MFLAGS) libsha.a

stack/libstack.a:
	cd stack; $(MAKE) $(MFLAGS) libstack.a

txt_db/libtxt.a:
	cd txt_db; $(MAKE) $(MFLAGS) libtxt.a

x509/libx509.a:
	cd x509; $(MAKE) $(MFLAGS) libx509.a

