DIRS=    CodingData CreatingHash CreatingKeyContainer \
    	 CryptAcquireContext CryptMsgSign CryptMessages DecryptFile \
         DerivingSessionKey DuplicatingHash DuplicatingSessionKey \
	 EncryptContainer\
         EncryptFile EnumeratingProviders ExportInFile ExportingCertificate \
         ExportingSessionKey FindContainerByCertificate KeyCopy PrfKeyMat SessionKeyParameters \
    	 SigningHash SignUtility SILENT StreamMessage EncryptKey DecryptKey MSCA CPCA15 RetrievePending \
	 UnixEnroll InstallCert CPCA20

# Don't build SignUtility in unicode mode.
# CPCA15, CPCA20 require libstdc++, skipping on FreeBSD >= 10
all:
	for d in $(DIRS) ; do \
	    test "$$d" = 'SignUtility' && echo "$$add_CPPFLAGS" | grep 'DUNICODE' >/dev/null 2>&1 && continue ; \
            (test "$$d" = 'CPCA15' || test "$$d" = 'CPCA20' ) && uname -sr | grep "FreeBSD 1" >/dev/null 2>&1 && continue ; \
	    ( cd $$d; $(MAKE) -f Makefile.unix ) || fail=yes ; \
	done ; \
	test -z "$$fail"

clean:
	for d in $(DIRS); do ( cd $$d; $(MAKE) -f Makefile.unix clean) done
