pull up r24469, r24530, r24533, r24534, r24535, r24537 from trunk
[krb5.git] / src / Makefile.in
index 3a94a769e8ef9bd43ca8d00a27d005cc9eef035d..4ff1299be4289d7c7549187adc0ab33404bf1164 100644 (file)
@@ -1,16 +1,33 @@
 datadir=@datadir@
 
-thisconfigdir=.
-myfulldir=.
 mydir=.
-SUBDIRS=util include lib @krb524@ kdc kadmin slave clients appl tests \
+# Don't build sample by default, and definitely don't install them
+# for production use:
+#      plugins/locate/python
+#      plugins/preauth/wpse
+#      plugins/preauth/cksum_body
+#      plugins/authdata/greet
+SUBDIRS=util include lib \
+       @ldap_plugin_dir@ \
+       @sam2_plugin@ \
+       plugins/kadm5_hook/test \
+       plugins/kdb/db2 \
+       plugins/preauth/pkinit \
+       plugins/preauth/encrypted_challenge \
+       kdc kadmin slave clients appl tests \
        config-files gen-manpages
-BUILDTOP=$(REL)$(C)
+WINSUBDIRS=include util lib ccapi windows clients appl
+BUILDTOP=$(REL).
 LOCALINCLUDES = -I$(srcdir) 
+PROG_LIBPATH=-L$(TOPLIBD)
+PROG_RPATH=$(KRB5_LIBDIR)
 
 SRCS =  
 HDRS = 
 
+# Why aren't these flags showing up in Windows builds?
+##DOS##CPPFLAGS=$(CPPFLAGS) -D_X86_=1  -DWIN32 -D_WIN32 -W3 -D_WINNT
+
 DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in
 
 all-unix:: krb5-config
@@ -19,36 +36,16 @@ all-unix:: krb5-config
 # needs autoconf.h, but building "all" in include requires that util/et
 # have been built first.  Until we can untangle this, let's just check
 # that autoconf.h is up to date before going into any of the subdirectories.
-all-prerecurse: update-autoconf-h
+all-prerecurse generate-files-mac-prerecurse: update-autoconf-h
 update-autoconf-h:
-       (cd include && $(MAKE) krb5/autoconf.h)
+       (cd include && $(MAKE) autoconf.h osconf.h)
+
+##DOS##!if 0
+# This makefile doesn't use lib.in, but we still need shlib.conf here.
+config.status: $(top_srcdir)/config/shlib.conf
+##DOS##!endif
 
 all-windows:: maybe-awk Makefile-windows
-       @echo Making autoconf.h in include\krb5
-       cd include\krb5
-       $(MAKE) -$(MFLAGS) autoconf.h
-       @echo Making in util
-       cd ..\..\util
-       $(MAKE) -$(MFLAGS)
-       @echo Making in include
-       cd ..\include
-       $(MAKE) -$(MFLAGS) 
-       @echo Making in lib
-       cd ..\lib
-       $(MAKE) -$(MFLAGS) 
-       @echo Making in windows
-       cd ..\windows
-       $(MAKE) -$(MFLAGS) 
-       @echo Making in clients
-       cd ..\clients
-       $(MAKE) -$(MFLAGS)
-       @echo Making in appl\gss-sample
-       cd ..\appl\gss-sample
-       $(MAKE) -$(MFLAGS)
-       @echo Making in appl\gssftp\ftp
-       cd ..\..\appl\gssftp\ftp
-       $(MAKE) -$(MFLAGS)
-       cd ..\..\..
 
 world::
        date
@@ -59,6 +56,10 @@ INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
                $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
                $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
                $(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \
+               $(KRB5_DB_MODULE_DIR) $(KRB5_PA_MODULE_DIR) \
+               $(KRB5_AD_MODULE_DIR) \
+               $(KRB5_LIBKRB5_MODULE_DIR) \
+               @localstatedir@ @localstatedir@/krb5kdc \
                $(KRB5_INCSUBDIRS) $(datadir) $(EXAMPLEDIR)
 
 install-strip:
@@ -75,18 +76,33 @@ install-headers-mkdirs:
        $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)
        $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssapi
        $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/gssrpc
-       $(srcdir)/config/mkinstalldirs $(DESTDIR)$(KRB5_INCDIR)/kerberosIV
 install-headers-prerecurse: install-headers-mkdirs
 
 # install::
 #      $(MAKE) $(MFLAGS) install.man
 
+fake-install: runenv.py
+       $(RM) -r $(FAKEPREFIX)
+       @for i in $(INSTALLMKDIRS); do \
+               $(srcdir)/config/mkinstalldirs util/fakedest$$i; \
+       done
+       (w=`pwd`; cd util && $(MAKE) install DESTDIR="$$w/util/fakedest")
+       (w=`pwd`; cd lib && $(MAKE) install DESTDIR="$$w/util/fakedest")
+       (w=`pwd`; cd plugins/kdb/db2 && $(MAKE) install DESTDIR="$$w/util/fakedest")
+       (w=`pwd`; cd plugins/preauth/encrypted_challenge && $(MAKE) install DESTDIR="$$w/util/fakedest")
+       if test -r plugins/preauth/pkinit/Makefile; then \
+         (w=`pwd`; cd plugins/preauth/pkinit && $(MAKE) install DESTDIR="$$w/util/fakedest"); \
+       fi
+
+#      (w=`pwd`; cd plugins/locate/python && $(MAKE) install DESTDIR="$$w/util/fakedest")
+
 TAGS: $(SRCS)
        etags $(SRCS)
 
 clean-:: clean-windows
 clean-unix::
        $(RM) *.o core krb5-config
+       $(RM) -r util/fakedest
 
 mostlyclean: clean
 
@@ -136,32 +152,39 @@ config-windows:: Makefile-windows
 # try to build wconfig on a config-windows.
 #
 ##DOS##$(WCONFIG_EXE): outpre-dir wconfig.c
-##DOS##        $(CC) -Fe$@ -Fo$*.obj wconfig.c
+##DOS##        $(CC) -Fe$@ -Fo$*.obj wconfig.c $(CCLINKOPTION)
+##DOS## $(_VC_MANIFEST_EMBED_EXE)
 
 ##DOS##MKFDEP=$(WCONFIG_EXE) config\win-pre.in config\win-post.in
 
 WINMAKEFILES=Makefile \
-       appl\gss-sample\Makefile \
-       appl\gssftp\ftp\Makefile \
+       appl\Makefile appl\gss-sample\Makefile \
+       ccapi\Makefile \
+       ccapi\lib\win\Makefile \
+       ccapi\server\win\Makefile \
+       ccapi\test\Makefile \
        clients\Makefile clients\kdestroy\Makefile \
        clients\kinit\Makefile clients\klist\Makefile \
        clients\kpasswd\Makefile clients\kvno\Makefile \
        clients\kcpytkt\Makefile clients\kdeltkt\Makefile \
-       include\Makefile include\krb5\Makefile \
-       krb524\Makefile \
-       lib\Makefile lib\crypto\Makefile \
-       lib\crypto\crc32\Makefile lib\crypto\des\Makefile \
-       lib\crypto\dk\Makefile lib\crypto\enc_provider\Makefile \
-       lib\crypto\hash_provider\Makefile \
-       lib\crypto\keyhash_provider\Makefile \
-       lib\crypto\raw\Makefile lib\crypto\old\Makefile \
-       lib\crypto\sha1\Makefile lib\crypto\arcfour\Makefile \
-       lib\crypto\md4\Makefile lib\crypto\md5\Makefile \
-       lib\crypto\yarrow\Makefile lib\crypto\aes\Makefile \
-       lib\des425\Makefile \
+       include\Makefile \
+       lib\Makefile lib\crypto\Makefile lib\crypto\krb\Makefile \
+       lib\crypto\krb\crc32\Makefile lib\crypto\krb\rand2key\Makefile \
+       lib\crypto\krb\prng\Makefile lib\crypto\krb\prng\yarrow\Makefile \
+       lib\crypto\krb\prf\Makefile lib\crypto\krb\checksum\Makefile \
+       lib\crypto\krb\old\Makefile lib\crypto\krb\raw\Makefile \
+       lib\crypto\krb\arcfour\Makefile lib\crypto\krb\dk\Makefile \
+       lib\crypto\builtin\Makefile lib\crypto\builtin\aes\Makefile \
+       lib\crypto\builtin\enc_provider\Makefile \
+       lib\crypto\builtin\des\Makefile lib\crypto\builtin\md5\Makefile \
+       lib\crypto\builtin\camellia\Makefile lib\crypto\builtin\md4\Makefile \
+       lib\crypto\builtin\hash_provider\Makefile \
+       lib\crypto\builtin\sha2\Makefile lib\crypto\builtin\sha1\Makefile \
+       lib\crypto\crypto_tests\Makefile \
        lib\gssapi\Makefile lib\gssapi\generic\Makefile \
        lib\gssapi\krb5\Makefile lib\gssapi\mechglue\Makefile \
-       lib\krb4\Makefile lib\krb5\Makefile \
+       lib\gssapi\spnego\Makefile \
+       lib\krb5\Makefile \
        lib\krb5\asn.1\Makefile lib\krb5\ccache\Makefile \
        lib\krb5\ccache\ccapi\Makefile \
        lib\krb5\error_tables\Makefile \
@@ -169,6 +192,7 @@ WINMAKEFILES=Makefile \
        lib\krb5\krb\Makefile \
        lib\krb5\os\Makefile lib\krb5\posix\Makefile \
        lib\krb5\rcache\Makefile \
+       lib\krb5\unicode\Makefile \
        util\Makefile \
        util\et\Makefile util\profile\Makefile \
        util\support\Makefile \
@@ -176,15 +200,23 @@ WINMAKEFILES=Makefile \
        windows\Makefile windows\lib\Makefile \
        windows\cns\Makefile windows\gina\Makefile \
        windows\gss\Makefile windows\ms2mit\Makefile \
-       windows\wintel\Makefile
+       windows\wintel\Makefile windows\kfwlogon\Makefile
 
 ##DOS##Makefile-windows:: $(MKFDEP) $(WINMAKEFILES)
 
 ##DOS##Makefile: Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##appl\Makefile: appl\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##appl\gss-sample\Makefile: appl\gss-sample\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##appl\gssftp\ftp\Makefile: appl\gssftp\ftp\Makefile.in $(MKFDEP)
+##DOS##ccapi\Makefile: ccapi\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##ccapi\lib\win\Makefile: ccapi\lib\win\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##ccapi\server\win\Makefile: ccapi\server\win\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##ccapi\test\Makefile: ccapi\test\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##clients\Makefile: clients\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
@@ -204,43 +236,55 @@ WINMAKEFILES=Makefile \
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##include\Makefile: include\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##include\krb5\Makefile: include\krb5\Makefile.in $(MKFDEP)
-##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##krb524\Makefile: krb524\Makefile.in $(MKFDEP)
-##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##lib\Makefile: lib\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##lib\crypto\Makefile: lib\crypto\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\crc32\Makefile: lib\crypto\crc32\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\crc32\Makefile: lib\crypto\krb\crc32\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\krb\rand2key\Makefile: lib\crypto\krb\rand2key\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\krb\prng\fortuna\Makefile: lib\crypto\krb\prng\fortuna\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\krb\prng\yarrow\Makefile: lib\crypto\krb\prng\yarrow\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\krb\prng\Makefile: lib\crypto\krb\prng\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\des\Makefile: lib\crypto\des\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\prf\Makefile: lib\crypto\krb\prf\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\dk\Makefile: lib\crypto\dk\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\checksum\Makefile: lib\crypto\krb\checksum\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\enc_provider\Makefile: lib\crypto\enc_provider\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\Makefile: lib\crypto\krb\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\hash_provider\Makefile: lib\crypto\hash_provider\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\old\Makefile: lib\crypto\krb\old\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\keyhash_provider\Makefile: lib\crypto\keyhash_provider\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\raw\Makefile: lib\crypto\krb\raw\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\sha1\Makefile: lib\crypto\sha1\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\arcfour\Makefile: lib\crypto\krb\arcfour\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\arcfour\Makefile: lib\crypto\arcfour\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\krb\dk\Makefile: lib\crypto\krb\dk\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\md4\Makefile: lib\crypto\md4\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\aes\Makefile: lib\crypto\builtin\aes\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\md5\Makefile: lib\crypto\md5\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\enc_provider\Makefile: lib\crypto\builtin\enc_provider\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\yarrow\Makefile: lib\crypto\yarrow\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\des\Makefile: lib\crypto\builtin\des\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\aes\Makefile: lib\crypto\aes\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\md5\Makefile: lib\crypto\builtin\md5\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\old\Makefile: lib\crypto\old\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\camellia\Makefile: lib\crypto\builtin\camellia\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\crypto\raw\Makefile: lib\crypto\raw\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\md4\Makefile: lib\crypto\builtin\md4\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\des425\Makefile: lib\des425\Makefile.in $(MKFDEP)
+##DOS##lib\crypto\builtin\hash_provider\Makefile: lib\crypto\builtin\hash_provider\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\builtin\sha2\Makefile: lib\crypto\builtin\sha2\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\builtin\sha1\Makefile: lib\crypto\builtin\sha1\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\builtin\Makefile: lib\crypto\builtin\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\crypto\crypto_tests\Makefile: lib\crypto\crypto_tests\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##lib\gssapi\Makefile: lib\gssapi\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
@@ -248,9 +292,9 @@ WINMAKEFILES=Makefile \
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##lib\gssapi\mechglue\Makefile: lib\gssapi\mechglue\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP)
+##DOS##lib\gssapi\spnego\Makefile: lib\gssapi\spnego\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
-##DOS##lib\krb4\Makefile: lib\krb4\Makefile.in $(MKFDEP)
+##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##lib\krb5\Makefile: lib\krb5\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
@@ -272,6 +316,8 @@ WINMAKEFILES=Makefile \
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##lib\krb5\rcache\Makefile: lib\krb5\rcache\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##lib\krb5\unicode\Makefile: lib\krb5\unicode\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##util\Makefile: util\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##util\et\Makefile: util\et\Makefile.in $(MKFDEP)
@@ -296,31 +342,10 @@ WINMAKEFILES=Makefile \
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##windows\wintel\Makefile: windows\wintel\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##windows\kfwlogon\Makefile: windows\kfwlogon\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
 
 clean-windows:: Makefile-windows
-       @echo Making clean in util
-       cd util
-       $(MAKE) -$(MFLAGS) clean
-       @echo Making clean in include
-       cd ..\include
-       $(MAKE) -$(MFLAGS) clean
-       @echo Making clean in lib
-       cd ..\lib
-       $(MAKE) -$(MFLAGS) clean
-       @echo Making clean in windows
-       cd ..\windows
-       $(MAKE) -$(MFLAGS) clean
-       @echo Making clean in clients
-       cd ..\clients
-       $(MAKE) -$(MFLAGS) clean
-       @echo Making in appl\gss-sample
-       cd ..\appl\gss-sample
-       $(MAKE) -$(MFLAGS) clean
-       @echo Making in appl\gssftp\ftp
-       cd ..\..\appl\gssftp\ftp
-       $(MAKE) -$(MFLAGS) clean
-       cd ..\..\..
-       @echo Making clean in root
 
 #
 # Renames DOS 8.3 filenames back to their proper, longer names.
@@ -333,30 +358,43 @@ ren2long:
 # Macintosh sites from the source tree on Unix.
 #
 ZIP=zip
-FILES= ./* \
-       clients/* clients/kdestroy/* clients/kinit/* clients/klist/* \
-       clients/kpasswd/* clients/kcpytkt/* clients/kdeltkt/* \
-       config/* include/* include/kerberosIV/* \
-       include/krb5/* include/krb5/stock/* include/sys/* krb524/* lib/* \
-       lib/crypto/* lib/crypto/crc32/* lib/crypto/des/* lib/crypto/dk/* \
-       lib/crypto/enc_provider/* lib/crypto/hash_provider/* \
-       lib/crypto/keyhash_provider/* lib/crypto/old/* lib/crypto/raw/* \
-       lib/crypto/sha1/* lib/crypto/arcfour/* lib/crypto/md4/* \
-       lib/crypto/md5/* lib/crypto/yarrow/* \
-       lib/des425/* lib/gssapi/* lib/gssapi/generic/* lib/gssapi/krb5/* \
-       lib/gssapi/mechglue/* lib/krb4/* \
+FILES= ./* appl/* appl/gss-sample/* \
+    clients/* clients/kdestroy/* clients/kinit/* clients/klist/* \
+       clients/kpasswd/* clients/kvno/* clients/kcpytkt/* clients/kdeltkt/* \
+       config/* include/* \
+       include/krb5/* lib/* lib/crypto/* lib/crypto/krb/* \
+       lib/crypto/krb/crc32/* lib/crypto/krb/rand2key/* \
+       lib/crypto/krb/prng/fortuna/* lib/crypto/krb/prng/nss/* \
+       lib/crypto/krb/prng/yarrow/* lib/crypto/krb/prng/* \
+       lib/crypto/krb/prf/* lib/crypto/krb/checksum/* lib/crypto/krb/old/* \
+       lib/crypto/krb/raw/* lib/crypto/krb/arcfour/* lib/crypto/krb/dk/* \
+       lib/crypto/builtin/aes/* lib/crypto/builtin/enc_provider/* \
+       lib/crypto/builtin/des/* lib/crypto/builtin/md5/* \
+       lib/crypto/builtin/camellia/* lib/crypto/builtin/md4/* \
+       lib/crypto/builtin/hash_provider/* lib/crypto/builtin/sha2/* \
+       lib/crypto/builtin/sha1/* lib/crypto/builtin/* \
+       lib/crypto/crypto_tests/* \
+       lib/gssapi/* lib/gssapi/generic/* lib/gssapi/krb5/* \
+       lib/gssapi/mechglue/* lib/gssapi/spnego/* \
        lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
        lib/krb5/ccache/* lib/krb5/ccache/ccapi/* \
        lib/krb5/error_tables/* \
-       lib/krb5/keytab/* lib/krb5/keytab/file/* lib/krb5/keytab/srvtab/* \
-       lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* \
-       util/* util/et/* util/profile/*
-
-WINFILES= util/windows/* windows/* windows/lib/* windows/cns/* \
-       windows/wintel/* windows/gss/* windows/gina/* windows/ms2mit/*
+       lib/krb5/keytab/* lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* \
+       lib/krb5/unicode/* lib/krb5/unicode/utbm/* lib/krb5/unicode/ure/* \
+       lib/krb5/unicode/ucdata/* \
+       util/* util/et/* util/profile/* util/support/*
+
+WINFILES= \
+    ccapi/* ccapi/common/* ccapi/common/win/* ccapi/common/win/OldCC/* \
+    ccapi/lib/* ccapi/lib/win/* ccapi/lib/win/OldCC/* \
+    ccapi/server/* ccapi/server/win/* \
+    ccapi/test/* \
+    util/windows/* windows/* windows/lib/* windows/cns/* \
+       windows/wintel/* windows/gss/* windows/gina/* windows/ms2mit/* \
+       windows/kfwlogon/*
 
 WINBINARYFILES=        windows/*/*.ico windows/*/*.doc windows/*/*.hlp \
-       windows/*/*.hpj windows/lib/*.lib
+       windows/*/*.hpj
 
 #
 # Part of building the PC release has to be done on Unix. This includes
@@ -371,24 +409,24 @@ GG  = lib/gssapi/generic/
 GK  = lib/gssapi/krb5/
 PR  = util/profile/
 CE  = util/et/
+CCL = ccapi/lib/
 
 ETOUT =        \
        $(INC)asn1_err.h $(ET)asn1_err.c \
        $(INC)kdb5_err.h $(ET)kdb5_err.c \
        $(INC)krb5_err.h $(ET)krb5_err.c \
+       $(INC)k5e1_err.h $(ET)k5e1_err.c \
        $(INC)kv5m_err.h $(ET)kv5m_err.c \
        $(INC)krb524_err.h $(ET)krb524_err.c \
-       $(INC)/kerberosIV/kadm_err.h lib/krb4/kadm_err.c \
-       $(INC)/kerberosIV/krb_err.h lib/krb4/krb_err.c \
        $(PR)prof_err.h $(PR)prof_err.c \
        $(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.c \
        $(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c \
-       lib/krb4/krb_err_txt.c
+       $(CCL)ccapi_err.h $(CCL)ccapi_err.c
 
-HOUT = $(INC)krb5.h $(GG)gssapi.h $(PR)profile.h
+HOUT = $(INC)krb5/krb5.h $(GG)gssapi.h $(PR)profile.h
 
 CLEANUP= Makefile $(ETOUT) $(HOUT) \
-       include/profile.h include/krb5/osconf.h \
+       include/profile.h include/osconf.h \
        winfile.list
 
 
@@ -434,20 +472,20 @@ $(INC)kdb5_err.h: $(AH) $(ET)kdb5_err.et
        $(AWK) -f $(AH) outfile=$@ $(ET)kdb5_err.et
 $(INC)krb5_err.h: $(AH) $(ET)krb5_err.et
        $(AWK) -f $(AH) outfile=$@ $(ET)krb5_err.et
+$(INC)k5e1_err.h: $(AH) $(ET)k5e1_err.et
+       $(AWK) -f $(AH) outfile=$@ $(ET)k5e1_err.et
 $(INC)kv5m_err.h: $(AH) $(ET)kv5m_err.et
        $(AWK) -f $(AH) outfile=$@ $(ET)kv5m_err.et
 $(INC)krb524_err.h: $(AH) $(ET)krb524_err.et
        $(AWK) -f $(AH) outfile=$@ $(ET)krb524_err.et
-$(INC)/kerberosIV/kadm_err.h: $(AH) lib/krb4/kadm_err.et
-       $(AWK) -f $(AH) outfile=$@ lib/krb4/kadm_err.et
-$(INC)/kerberosIV/krb_err.h: $(AH) lib/krb4/krb_err.et
-       $(AWK) -f $(AH) outfile=$@ lib/krb4/krb_err.et
 $(PR)prof_err.h: $(AH) $(PR)prof_err.et
        $(AWK) -f $(AH) outfile=$@ $(PR)prof_err.et
 $(GG)gssapi_err_generic.h: $(AH) $(GG)gssapi_err_generic.et
        $(AWK) -f $(AH) outfile=$@ $(GG)gssapi_err_generic.et
 $(GK)gssapi_err_krb5.h: $(AH) $(GK)gssapi_err_krb5.et
        $(AWK) -f $(AH) outfile=$@ $(GK)gssapi_err_krb5.et
+$(CCL)ccapi_err.h: $(AH) $(CCL)ccapi_err.et
+       $(AWK) -f $(AH) outfile=$@ $(CCL)ccapi_err.et
 $(CE)test1.h: $(AH) $(CE)test1.et
        $(AWK) -f $(AH) outfile=$@ $(CE)test1.et
 $(CE)test2.h: $(AH) $(CE)test2.et
@@ -459,33 +497,29 @@ $(ET)kdb5_err.c: $(AC) $(ET)kdb5_err.et
        $(AWK) -f $(AC) outfile=$@ $(ET)kdb5_err.et
 $(ET)krb5_err.c: $(AC) $(ET)krb5_err.et
        $(AWK) -f $(AC) outfile=$@ $(ET)krb5_err.et
+$(ET)k5e1_err.c: $(AC) $(ET)k5e1_err.et
+       $(AWK) -f $(AC) outfile=$@ $(ET)k5e1_err.et
 $(ET)kv5m_err.c: $(AC) $(ET)kv5m_err.et
        $(AWK) -f $(AC) outfile=$@ $(ET)kv5m_err.et
 $(ET)krb524_err.c: $(AC) $(ET)krb524_err.et
        $(AWK) -f $(AC) outfile=$@ $(ET)krb524_err.et
-lib/krb4/kadm_err.c: $(AC) lib/krb4/kadm_err.et
-       $(AWK) -f $(AC) outfile=$@ lib/krb4/kadm_err.et
-lib/krb4/krb_err.c: $(AC) lib/krb4/krb_err.et
-       $(AWK) -f $(AC) outfile=$@ lib/krb4/krb_err.et
 $(PR)prof_err.c: $(AC) $(PR)prof_err.et
        $(AWK) -f $(AC) outfile=$@ $(PR)prof_err.et
 $(GG)gssapi_err_generic.c: $(AC) $(GG)gssapi_err_generic.et
        $(AWK) -f $(AC) outfile=$@ $(GG)gssapi_err_generic.et
 $(GK)gssapi_err_krb5.c: $(AC) $(GK)gssapi_err_krb5.et
        $(AWK) -f $(AC) outfile=$@ $(GK)gssapi_err_krb5.et
+$(CCL)ccapi_err.c: $(AC) $(CCL)ccapi_err.et
+       $(AWK) -f $(AC) outfile=$@ $(CCL)ccapi_err.et
 $(CE)test1.c: $(AC) $(CE)test1.et
        $(AWK) -f $(AC) outfile=$@ $(CE)test1.et
 $(CE)test2.c: $(AC) $(CE)test2.et
        $(AWK) -f $(AC) outfile=$@ $(CE)test2.et
 
-lib/krb4/krb_err_txt.c: lib/krb4/krb_err.et
-       $(AWK) -f lib/krb4/et_errtxt.awk outfile=$@ \
-               lib/krb4/krb_err.et
-
-KRBHDEP = $(INC)krb5.hin $(INC)krb5_err.h $(INC)kdb5_err.h \
-       $(INC)kv5m_err.h $(INC)krb524_err.h $(INC)asn1_err.h
+KRBHDEP = $(INC)krb5/krb5.hin $(INC)krb5_err.h $(INC)k5e1_err.h \
+       $(INC)kdb5_err.h $(INC)kv5m_err.h $(INC)krb524_err.h $(INC)asn1_err.h
 
-$(INC)krb5.h: $(KRBHDEP)
+$(INC)krb5/krb5.h: $(KRBHDEP)
        rm -f $@
        cat $(KRBHDEP) > $@
 $(PR)profile.h: $(PR)profile.hin $(PR)prof_err.h
@@ -517,49 +551,204 @@ distclean-windows:
        config\rm.bat $(KBINDIR)\*.dll $(KBINDIR)\*.exe
        @if exist $(KBINDIR)\nul rmdir $(KBINDIR)
 
+# Avoid using $(CP) here because the nul+ hack breaks implicit
+# destination filenames.
 install-windows::
        @if "$(KRB_INSTALL_DIR)"=="" @echo KRB_INSTALL_DIR is not defined!  Please define it.
        @if "$(KRB_INSTALL_DIR)"=="" @dir /b \nul\nul
        @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @echo The directory $(KRB_INSTALL_DIR) does not exist.  Please create it.
        @if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @dir /b $(KRB_INSTALL_DIR)\nul
        @if not exist "$(KRB_INSTALL_DIR)\include\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include"
+       @if not exist "$(KRB_INSTALL_DIR)\include\krb5\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\krb5"
        @if not exist "$(KRB_INSTALL_DIR)\include\gssapi\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\gssapi"
        @if not exist "$(KRB_INSTALL_DIR)\lib\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\lib"
        @if not exist "$(KRB_INSTALL_DIR)\bin\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin"
-       $(CP) include\krb5.h "$(KRB_INSTALL_DIR)\include\."
-       $(CP) include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
-       $(CP) include\profile.h "$(KRB_INSTALL_DIR)\include\."
-       $(CP) include\com_err.h "$(KRB_INSTALL_DIR)\include\."
-       $(CP) include\gssapi\gssapi.h "$(KRB_INSTALL_DIR)\include\gssapi\."
-       $(CP) include\gssapi\gssapi_krb5.h "$(KRB_INSTALL_DIR)\include\gssapi\."
-       $(CP) lib\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
-       $(CP) lib\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) windows\cns\$(OUTPRE)krb5.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) windows\wintel\$(OUTPRE)telnet.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) windows\gss\$(OUTPRE)gss.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) appl\gss-sample\$(OUTPRE)gss-server.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) appl\gss-sample\$(OUTPRE)gss-client.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) windows\ms2mit\$(OUTPRE)ms2mit.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) appl\gssftp\ftp\$(OUTPRE)ftp.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\kvno\$(OUTPRE)kvno.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\klist\$(OUTPRE)klist.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\kinit\$(OUTPRE)kinit.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\kdestroy\$(OUTPRE)kdestroy.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\kcpytkt\$(OUTPRE)kcpytkt.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\kdeltkt\$(OUTPRE)kdeltkt.exe "$(KRB_INSTALL_DIR)\bin\."
-       $(CP) clients\kpasswd\$(OUTPRE)kpasswd.exe "$(KRB_INSTALL_DIR)\bin\."
-       @if exist "$(KRB_INSTALL_DIR)\bin\krb4_32.dll" del "$(KRB_INSTALL_DIR)\bin\krb4_32.dll"
-       @if exist "$(KRB_INSTALL_DIR)\lib\krb4_32.lib" del "$(KRB_INSTALL_DIR)\lib\krb4_32.lib"
+       copy include\krb5.h "$(KRB_INSTALL_DIR)\include\."
+       copy include\krb5\krb5.h "$(KRB_INSTALL_DIR)\include\krb5\."
+       copy include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
+       copy include\profile.h "$(KRB_INSTALL_DIR)\include\."
+       copy include\com_err.h "$(KRB_INSTALL_DIR)\include\."
+       copy include\gssapi\gssapi.h "$(KRB_INSTALL_DIR)\include\gssapi\."
+       copy include\gssapi\gssapi_krb5.h "$(KRB_INSTALL_DIR)\include\gssapi\."
+       copy include\gssapi\gssapi_ext.h "$(KRB_INSTALL_DIR)\include\gssapi\."
+       copy lib\$(OUTPRE)*.lib "$(KRB_INSTALL_DIR)\lib\."
+       copy lib\$(OUTPRE)*.dll "$(KRB_INSTALL_DIR)\bin\."
+       copy windows\cns\$(OUTPRE)krb5.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy windows\gss\$(OUTPRE)gss.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy appl\gss-sample\$(OUTPRE)gss-server.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy appl\gss-sample\$(OUTPRE)gss-client.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy windows\ms2mit\$(OUTPRE)ms2mit.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy ccapi\lib\win\srctmp\$(OUTPRE)ccapi.dll "$(KRB_INSTALL_DIR)\bin\."
+       copy ccapi\server\win\srctmp\$(OUTPRE)ccapiserver.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\kvno\$(OUTPRE)kvno.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\klist\$(OUTPRE)klist.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\kinit\$(OUTPRE)kinit.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\kdestroy\$(OUTPRE)kdestroy.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\kcpytkt\$(OUTPRE)kcpytkt.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\kdeltkt\$(OUTPRE)kdeltkt.exe "$(KRB_INSTALL_DIR)\bin\."
+       copy clients\kpasswd\$(OUTPRE)kpasswd.exe "$(KRB_INSTALL_DIR)\bin\."
 
 install-unix:: 
        $(INSTALL_SCRIPT) krb5-config \
                $(DESTDIR)$(CLIENT_BINDIR)/krb5-config
        $(INSTALL_DATA) $(srcdir)/krb5-config.M $(DESTDIR)$(CLIENT_MANDIR)/krb5-config.1
 
-krb5-config: $(srcdir)/krb5-config.in $(thisconfigdir)/config.status
-       cd $(thisconfigdir) && $(SHELL) config.status krb5-config
+krb5-config: $(srcdir)/krb5-config.in config.status
+       $(SHELL) config.status krb5-config
 
 # Test to ensure that krb5-config does not spit out things like
 # $(PURE) or $(LDFLAGS) in case someone changes config/shlib.conf
 check-unix:: krb5-config
        $(SHELL) $(srcdir)/t_krbconf
+check-prerecurse: fake-install
+
+# Create a test realm and spawn a shell in an environment pointing to it.
+testrealm: fake-install
+       PYTHONPATH=$(BUILDTOP):$(top_srcdir)/util $(PYTHON) $(srcdir)/util/testrealm.py
+
+# environment variable settings to propagate to Python-based tests
+
+pyrunenv.vals: Makefile
+       $(KRB5_RUN_ENV) \
+       for i in $(KRB5_RUN_VARS); do \
+               eval echo 'env['\\\'$$i\\\''] = '\\\'\$$$$i\\\'; \
+       done > $@
+
+runenv.py: pyrunenv.vals
+       echo 'env = {}' > $@
+       cat pyrunenv.vals >> $@
+
+clean-unix::
+       $(RM) runenv.py pyrunenv.vals
+
+COV_BUILD=     cov-build
+COV_ANALYZE=   cov-analyze
+COV_COMMIT=    cov-commit-defects --product "$(COV_PRODUCT)" --user "$(COV_USER)" --target "$(COV_TARGET)" --description "$(COV_DESC)"
+COV_MAKE_LIB=  cov-make-library
+
+COV_PRODUCT=   krb5
+COV_USER=      admin
+COV_DATADIR=
+COV_TARGET=    $(host)
+COV_DESC=
+
+# Set to, e.g., "--all" or "--security".
+COV_ANALYSES=
+# Temporary directory, might as well put it in the build tree.
+COV_TEMPDIR=   cov-temp
+# Sources modeling some functions or macros confusing Prevent.
+COV_MODELS=\
+       $(top_srcdir)/util/coverity-models/threads.c
+
+# Depend on Makefiles to ensure that (in maintainer mode) the configure
+# scripts won't get rerun under cov-build.
+coverity prevent cov: Makefiles
+       $(COV_BUILD) --dir $(COV_TEMPDIR) $(MAKE) all
+       $(COV_ANALYZE) $(COV_ANALYSES) --dir $(COV_TEMPDIR)
+       if test "$(COV_DATADIR)" != ""; then \
+               $(COV_COMMIT) --dir $(COV_TEMPDIR) --datadir $(COV_DATADIR); \
+       else \
+               echo "** Coverity Prevent analysis results not commit to Defect Manager"; \
+       fi
+
+FIND = find
+XARGS = xargs
+EMACS = emacs
+PYTHON = python
+
+INDENTDIRS = \
+       appl \
+       clients \
+       include \
+       kadmin \
+       kdc \
+       lib/apputils \
+       lib/crypto \
+       lib/gssapi \
+       lib/kadm5 \
+       lib/kdb \
+       lib/krb5 \
+       plugins \
+       prototype \
+       slave \
+       tests \
+       util
+
+BSDFILES = \
+       kadmin/cli/strftime.c \
+       kadmin/server/ipropd_svc.c \
+       kadmin/server/kadm_rpc_svc.c \
+       lib/apputils/daemon.c \
+       lib/kadm5/admin_xdr.h \
+       lib/kadm5/clnt/client_rpc.c \
+       lib/kadm5/kadm_rpc.h \
+       lib/kadm5/kadm_rpc_xdr.c \
+       lib/kadm5/srv/adb_xdr.c \
+       lib/krb5/krb/strftime.c \
+       lib/krb5/krb/strptime.c \
+       slave/kpropd_rpc.c \
+       util/support/mkstemp.c \
+       util/support/strlcpy.c \
+       util/windows/getopt.c \
+       util/windows/getopt.h \
+       util/windows/getopt_long.c
+
+OTHEREXCLUDES = \
+       include/iprop.h \
+       include/k5-platform.h \
+       include/gssrpc \
+       lib/apputils/dummy.c \
+       lib/crypto/builtin/aes \
+       lib/gssapi/generic/gssapiP_generic.h \
+       lib/gssapi/generic/gssapi_ext.h \
+       lib/gssapi/krb5/gssapiP_krb5.h \
+       lib/gssapi/mechglue \
+       lib/gssapi/spnego \
+       lib/krb5/krb/deltat.c \
+       lib/krb5/unicode \
+       plugins/kdb/db2/libdb2 \
+       plugins/kdb/db2/pol_xdr.c \
+       plugins/kdb/hdb/hdb.h \
+       plugins/kdb/hdb/hdb_asn1.h \
+       plugins/kdb/hdb/hdb_err.h \
+       plugins/kdb/hdb/windc_plugin.h \
+       plugins/kdb/ldap/libkdb_ldap/princ_xdr.c \
+       plugins/kdb/ldap/libkdb_ldap/princ_xdr.h \
+       plugins/preauth/pkinit/pkcs11.h \
+       plugins/preauth/pkinit/pkinit_accessor.h \
+       plugins/preauth/pkinit/pkinit_crypto.h \
+       plugins/preauth/pkinit/pkinit.h \
+       plugins/preauth/pkinit/pkinit_crypto_openssl.h \
+       tests/asn.1/ktest.h \
+       tests/asn.1/ktest_equal.h \
+       tests/asn.1/utility.h \
+       tests/gss-threads/gss-misc.c \
+       tests/gss-threads/gss-misc.h \
+       tests/hammer/kdc5_hammer.c \
+       util/et/com_err.h \
+       util/profile/prof_int.h \
+       util/profile/profile.hin \
+       util/profile/profile_tcl.c
+
+EXCLUDES = `for i in $(BSDFILES) $(OTHEREXCLUDES); do echo $$i; done | $(AWK) '{ print "-path", $$1, "-o" }'` -path /dev/null
+
+reindent::
+       (cd $(top_srcdir) && \
+       $(FIND) . \
+       \( -name '*.[ch]' -o -name '*.hin' -o -name '*.[ch].in' \) \
+       -print0 | $(XARGS) -0 $(EMACS) -q -batch \
+       -l util/krb5-c-style.el \
+       -l util/krb5-batch-reindent.el)
+
+mark-cstyle:: mark-cstyle-krb5 mark-cstyle-bsd
+
+mark-cstyle-krb5::
+       (cd $(top_srcdir) && \
+       $(FIND) $(INDENTDIRS) \( $(EXCLUDES) \) -prune -o \
+       -name '*.[ch]' \
+       -print0 | $(XARGS) -0 $(PYTHON) util/krb5-mark-cstyle.py \
+       --cstyle=krb5)
+
+mark-cstyle-bsd::
+       (cd $(top_srcdir) && $(FIND) $(BSDFILES) -print0 | $(XARGS) -0 \
+       $(PYTHON) util/krb5-mark-cstyle.py --cstyle=bsd)