# Microsoft Windows configuration file for Cygnus Kerberos
# ***copy from K4***

WHAT=windows

all:: all-$(WHAT)

clean:: clean-$(WHAT)

install:: install-$(WHAT)

check:: check-$(WHAT)

all-windows::
clean-windows::
install-windows::
check-windows::


# Directory syntax:
R=\		# root
C=.\		# current
S=\		# seperator
U=..\		# up one level

srcdir = .
SRCTOP = $(srcdir)\$(BUILDTOP)

# /* The name of the C compiler for the target */
CC=cl /nologo
CL=
#
# CCOPTS for DLL functions
#
##WIN16##CCOPTS=/ALw /Zp /GD2s /Os /Zi /Od /W3 $(XTRA)
##WIN32##CCOPTS=/Os /Zi /Od /W3 $(XTRA) -DKRB5_DLL_FILE
#
# CCOPTS for non-DLL compiles
#
##WIN16##CCOPTS2=/AL /Zp /G2s  /Os /Zi /Od /W3 -DINTERFACE= -DINTERFACE_C= $(XTRA)
##WIN32##CCOPTS2=/Os /Zi /Od /W3 -DINTERFACE= -DINTERFACE_C= $(XTRA)
CPPFLAGS =  -I$(SRCTOP)\include -I$(SRCTOP)\include\krb5
DEFS = $(CPPFLAGS)
CFLAGS2 = $(CCOPTS2) $(DEFS)

# /Zi gives debug info in each object file.
# /Zp packs structures: Required for Windows API (but is not default!!!)
# /Za strict ansi compliance
# /ALw memory model:  Large model for Windows DLL (SS != DS)
# /GD DLL code generation for Windows 3.0 and up, and defines _WINDOWS
# /Gs Avoid stack probes (they don't seem to work anyway)
# /Os optimize for space.  FIXME:  Do not use /Ox; it miscompiles the DES lib!
# /G2 generate 286 instructions (it complains if you ask for 386!)
# /Od disable optimization (for debugging)

DBG_LIB=/nologo /Zp /ALw /GD /Gs /Os /G2 /Zi /Od
# /Zi gives debug info in each object file.
# /Zp packs structures: Required for Windows API (but is not default!!!)
# /AL large memory model
# /Mq quickwin ascii stdio window, and defines _WINDOWS
DBG=/nologo /Zp /AL /Os /Mq /Zi /Od

RM=$(BUILDTOP)\config\rm.bat
LIBECHO=$(BUILDTOP)\util\windows\libecho
CP=copy
MV=ren
LN=copy
LIBCMD=lib
PAGESIZE=/pagesize:128
AWK=rem
RC = rc
CVTRES = cvtres

##WIN16##KLIB=$(BUILDTOP)\lib\krb5_16.lib
##WIN32##KLIB=$(BUILDTOP)\lib\krb5_32.lib
##WIN16##GLIB=$(BUILDTOP)\lib\gssapi.lib
##WIN32##GLIB=$(BUILDTOP)\lib\gssapi32.lib

ARADD=rem
RANLIB=rem
ARCHIVE=rem

LIBEXT=lib
OBJEXT=obj
EXEEXT=.exe

MFLAGS=$(MAKEFLAGS)

#
# End of Microsoft Windows config lines
#

CFLAGS = $(CCOPTS) $(DEFS)

BUILDTOP = .

SRCS =  
HDRS = 

DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in

all-unix::

all-mac::

all-windows:: makefile-windows
	@echo Making in util\windows
	cd util\windows
	-$(MAKE) -$(MAKEFLAGS)
	@echo Making in include
	cd ..\..\include
	-$(MAKE) -$(MAKEFLAGS) 
	@echo Making in util\et
	cd ..\util\et
	-$(MAKE) -$(MAKEFLAGS) 
	@echo Making in util\profile
	cd ..\profile
	-$(MAKE) -$(MAKEFLAGS) 
	@echo Making in lib
	cd ..\..\lib
	-$(MAKE) -$(MAKEFLAGS) 
	@echo Making in windows
	cd ..\windows
	-$(MAKE) -$(MAKEFLAGS) 
	cd ..

world::
	date
	make $(MFLAGS) all
	date

INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \
		$(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \
		$(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \
		$(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \
		$(KRB5_INCSUBDIRS)

install-recurse: install-mkdirs

install-mkdirs:
	@for i in $(INSTALLMKDIRS); do \
		if test -d $(DESTDIR)$$i; then :; else (set -x; mkdir -p $(DESTDIR)$$i); fi ; \
	done

# install::
#	$(MAKE) $(MFLAGS) install.man

.c.o:
	$(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $<

TAGS: $(SRCS)
	etags $(SRCS)

clean-:: clean-windows
clean-mac:: clean-unix
clean-unix::
	$(RM) *.o core

mostlyclean: clean

distclean: clean
	rm -f Makefile config.status

realclean: distclean
	rm -f TAGS

dist: $(DISTFILES)
	echo cpio-`sed -e '/version_string/!d' \
	-e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	-ln $(DISTFILES) `cat .fname`
	for file in $(DISTFILES); do \
	  test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \
	done
	tar chzf `cat .fname`.tar.gz `cat .fname`
	rm -rf `cat .fname` .fname

GZIPPROG= gzip -9v
PKGDIR=`pwd`/pkgdir
pkgdir:
	if test ! -d $(PKGDIR); then mkdir $(PKGDIR); else true; fi
tgz-bin: pkgdir
	rm -rf $(PKGDIR)/install cns5-bin.tgz
	mkdir $(PKGDIR)/install
	$(MAKE) install DESTDIR=$(PKGDIR)/install
	(cd $(PKGDIR)/install && tar cf - usr/cygnus) | $(GZIPPROG) > cns5-bin.tgz
	rm -rf $(PKGDIR)/install

# Macintosh build process...

# Build all things for the Mac build, which need to be built on
# Unix first.
unixmac:
	(cd lib/krb5/error_tables; make -f Makefile.in unixmac)
	(cd lib/gssapi/generic; make -f Makefile.in unixmac)


# Microsoft Windows build process...
#

config-windows:: makefile-windows
	@echo Making in include
	cd include
	-$(MAKE) -$(MAKEFLAGS)
	cd ..

MKFDEP= wconfig.exe config\pre.in config\post.in \
	config\windows.in config\win-post.in

makefile-windows:: $(MKFDEP) makefile \
		include\makefile include\krb5\makefile \
		lib\makefile lib\crypto\makefile \
		lib\crypto\crc32\makefile lib\crypto\des\makefile \
		lib\crypto\sha\makefile \
		lib\crypto\md4\makefile lib\crypto\md5\makefile \
		lib\crypto\os\makefile lib\des425\makefile \
		lib\gssapi\makefile lib\gssapi\generic\makefile \
		lib\gssapi\krb5\makefile lib\gssapi\mechglue\makefile \
		lib\kadm\makefile lib\krb5\makefile \
		lib\krb5\asn.1\makefile lib\krb5\ccache\makefile \
		lib\krb5\ccache\file\makefile \
		lib\krb5\ccache\stdio\makefile \
		lib\krb5\error_tables\makefile \
		lib\krb5\free\makefile lib\krb5\keytab\makefile \
		lib\krb5\keytab\file\makefile lib\krb5\krb\makefile \
		lib\krb5\os\makefile lib\krb5\posix\makefile \
		lib\krb5\rcache\makefile \
		util\et\makefile util\profile\makefile \
		util\windows\makefile \
		windows\Makefile \
		windows\cns\Makefile windows\gina\Makefile \
		windows\gss\Makefile windows\wintel\Makefile
	config\rm.bat wconfig.obj msvc.pdb

makefile: makefile.in $(MKFDEP)
	.\wconfig config <makefile.in >makefile
include\makefile: include\makefile.in $(MKFDEP)
	.\wconfig config <include\makefile.in >include\makefile
include\krb5\makefile: include\krb5\makefile.in $(MKFDEP)
	.\wconfig config <include\krb5\makefile.in >include\krb5\makefile
lib\makefile: lib\makefile.in $(MKFDEP)
	.\wconfig config <lib\makefile.in >lib\makefile
lib\crypto\makefile: lib\crypto\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\makefile.in >lib\crypto\makefile
lib\crypto\crc32\makefile: lib\crypto\crc32\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\crc32\makefile.in >lib\crypto\crc32\makefile
lib\crypto\des\makefile: lib\crypto\des\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\des\makefile.in >lib\crypto\des\makefile
lib\crypto\sha\makefile: lib\crypto\sha\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\sha\makefile.in >lib\crypto\sha\makefile
lib\crypto\md4\makefile: lib\crypto\md4\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\md4\makefile.in >lib\crypto\md4\makefile
lib\crypto\md5\makefile: lib\crypto\md5\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\md5\makefile.in >lib\crypto\md5\makefile
lib\crypto\os\makefile: lib\crypto\os\makefile.in $(MKFDEP)
	.\wconfig config <lib\crypto\os\makefile.in >lib\crypto\os\makefile
lib\des425\makefile: lib\des425\makefile.in $(MKFDEP)
	.\wconfig config <lib\des425\makefile.in >lib\des425\makefile
lib\gssapi\makefile: lib\gssapi\makefile.in $(MKFDEP)
	.\wconfig config <lib\gssapi\makefile.in >lib\gssapi\makefile
lib\gssapi\generic\makefile: lib\gssapi\generic\makefile.in $(MKFDEP)
	.\wconfig config <lib\gssapi\generic\makefile.in >lib\gssapi\generic\makefile
lib\gssapi\mechglue\makefile: lib\gssapi\mechglue\makefile.in $(MKFDEP)
	.\wconfig config <lib\gssapi\mechglue\makefile.in >lib\gssapi\mechglue\makefile
lib\gssapi\krb5\makefile: lib\gssapi\krb5\makefile.in $(MKFDEP)
	.\wconfig config <lib\gssapi\krb5\makefile.in >lib\gssapi\krb5\makefile
lib\kadm\makefile: lib\kadm\makefile.in $(MKFDEP)
	.\wconfig config <lib\kadm\makefile.in >lib\kadm\makefile
lib\krb4\makefile: lib\krb4\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb4\makefile.in >lib\krb4\makefile
lib\krb5\makefile: lib\krb5\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\makefile.in >lib\krb5\makefile
lib\krb5\asn.1\makefile: lib\krb5\asn.1\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\asn.1\makefile.in >lib\krb5\asn.1\makefile
lib\krb5\ccache\makefile: lib\krb5\ccache\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\ccache\makefile.in >lib\krb5\ccache\makefile
lib\krb5\ccache\file\makefile: lib\krb5\ccache\file\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\ccache\file\makefile.in >lib\krb5\ccache\file\makefile
lib\krb5\ccache\stdio\makefile: lib\krb5\ccache\stdio\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\ccache\stdio\makefile.in >lib\krb5\ccache\stdio\makefile
lib\krb5\error_tables\makefile: lib\krb5\error_tables\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\error_tables\makefile.in >lib\krb5\error_tables\makefile
lib\krb5\free\makefile: lib\krb5\free\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\free\makefile.in >lib\krb5\free\makefile
lib\krb5\keytab\makefile: lib\krb5\keytab\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\keytab\makefile.in >lib\krb5\keytab\makefile
lib\krb5\keytab\file\makefile: lib\krb5\keytab\file\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\keytab\file\makefile.in >lib\krb5\keytab\file\makefile
lib\krb5\krb\makefile: lib\krb5\krb\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\krb\makefile.in >lib\krb5\krb\makefile
lib\krb5\os\makefile: lib\krb5\os\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\os\makefile.in >lib\krb5\os\makefile
lib\krb5\posix\makefile: lib\krb5\posix\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\posix\makefile.in >lib\krb5\posix\makefile
lib\krb5\rcache\makefile: lib\krb5\rcache\makefile.in $(MKFDEP)
	.\wconfig config <lib\krb5\rcache\makefile.in >lib\krb5\rcache\makefile
util\et\makefile: util\et\makefile.in $(MKFDEP)
	.\wconfig config <util\et\makefile.in >util\et\makefile
util\profile\makefile: util\profile\makefile.in $(MKFDEP)
	.\wconfig config <util\profile\makefile.in >util\profile\makefile
util\windows\makefile: util\windows\makefile.in $(MKFDEP)
	.\wconfig config <util\windows\makefile.in >util\windows\makefile
windows\Makefile:  windows\Makefile.in $(MKFDEP)
	.\wconfig config <windows\Makefile.in >windows\Makefile
windows\cns\Makefile:  windows\cns\Makefile.in $(MKFDEP)
	.\wconfig config <windows\cns\Makefile.in >windows\cns\Makefile
windows\gina\Makefile:  windows\gina\Makefile.in $(MKFDEP)
	.\wconfig config <windows\gina\Makefile.in >windows\gina\Makefile
windows\gss\Makefile:  windows\gss\Makefile.in $(MKFDEP)
	.\wconfig config <windows\gss\Makefile.in >windows\gss\Makefile
windows\wintel\Makefile:  windows\wintel\Makefile.in $(MKFDEP)
	.\wconfig config <windows\wintel\Makefile.in >windows\wintel\Makefile

wconfig.exe: wconfig.c
	SET CL=/nologo
	$(CC) /AL wconfig.c

clean-windows::
	@echo Making clean in include
	cd include
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in util\et
	cd ..\util\et
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in util\profile
	cd ..\profile
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in lib
	cd ..\..\lib
	-$(MAKE) -$(MAKEFLAGS) clean
	@echo Making clean in windows
	cd ..\windows
	-$(MAKE) -$(MAKEFLAGS) clean
	cd ..
	@echo Making clean in root
	config\rm.bat *.obj msvc.pdb *.err wconfig.obj wconfig.exe

#
# Renames DOS 8.3 filenames back to their proper, longer names.
#
ren2long:
	-sh config/ren2long

#
# Builds the file that distributes Kerberos sources for DOS and 
# Macintosh sites from the source tree on Unix.
#
ZIP=zip
FILES= ./* \
	config/* include/* include/krb5/* include/krb5/asn.1/* \
	include/krb5/stock/* include/sys/* lib/* lib/crypto/* \
	lib/crypto/crc32/* lib/crypto/des/* lib/crypto/sha/* lib/crypto/md4/* \
	lib/crypto/md5/* lib/crypto/os/* lib/des425/* lib/gssapi/* \
	lib/gssapi/generic/* lib/gssapi/krb5/* lib/gssapi/mechglue/* \
	lib/kadm/* lib/krb4/* lib/krb425/* \
	lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
	lib/krb5/ccache/* lib/krb5/ccache/file/* \
	lib/krb5/ccache/stdio/* lib/krb5/error_tables/* \
	lib/krb5/free/* lib/krb5/keytab/* lib/krb5/keytab/file/* \
	lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* util/et/* \
	util/profile/* util/windows/*

WINFILES= windows/* windows/cns/* windows/wintel/* windows/gss/* windows/gina/*

MACFILES= mac/* mac/kconfig/* mac/libraries/* mac/telnet-k5-auth/* \
	mac/gss-sample/* config/* include/* include/krb5/* \
	include/krb5/asn.1/* include/krb5/stock/* include/sys/* \
	./patchlevel.h

WINBINARYFILES=windows/cns/*.ico windows/wintel/*.ico windows/gss/*.ico

CLEANUP= util/profile/profile.h util/profile/prof_err.[ch] \
	lib/krb5/error_tables/asn1_err.c lib/krb5/error_tables/kdb5_err.c \
	lib/krb5/error_tables/krb5_err.c lib/krb5/error_tables/kv5m_err.c \
	lib/krb5/error_tables/adm_err.c \
	include/asn1_err.h include/kdb5_err.h \
	include/krb5_err.h include/kv5m_err.h \
	include/adm_err.h include/profile.h include/krb5.h \
	include/krb5/osconf.h \
	lib/gssapi/generic/gssapi_err_generic.[ch] \
	lib/gssapi/krb5/gssapi_err_krb5.[ch] winfile.list macfile.list

kerbsrc.win: kerbsrc.zip

winfile.list:
	echo $(FILES) $(WINFILES) | tr ' ' \\012 | \
		sed -f config/winexclude.sed > winfile.list

MAC_SUBDIRS = lib util
macfile.list:
	/bin/sh mac/macfiles.sh $(MAC_SUBDIRS) > macfile.list
	find $(MACFILES) -prune -type f -print | \
		sed -f config/winexclude.sed >> macfile.list

Makefile.sav:
	rm -f Makefile.sav
	mv Makefile Makefile.sav
	cat config/windows.in Makefile.in config/win-post.in | \
		sed -e 's/^##DOS##//' -e 's/^##DOS//' > Makefile

kerbsrc.zip: Makefile.sav awk-windows-mac winfile.list
	rm -f kerbsrc.zip
	$(ZIP) -Dlk kerbsrc.zip `cat winfile.list`
	$(ZIP) -Dk kerbsrc.zip $(WINBINARYFILES)
	mv Makefile.sav Makefile
	rm -f $(CLEANUP)

kerbsrc-nt.zip: Makefile.sav awk-windows-mac winfile.list
	rm -f kerbsrc-nt.zip
	$(ZIP) -Dl kerbsrc-nt.zip `cat winfile.list`
	$(ZIP) -D kerbsrc-nt.zip $(WINBINARYFILES)
	mv Makefile.sav Makefile
	rm -f $(CLEANUP)

dos-zipfiles: Makefile.sav awk-windows-mac winfile.list
	rm -f kerbsrc.zip
	$(ZIP) -Dlk kerbsrc.zip `cat winfile.list`
	$(ZIP) -Dk kerbsrc.zip $(WINBINARYFILES)
	rm -f kerbsrc-nt.zip
	$(ZIP) -Dl kerbsrc-nt.zip `cat winfile.list`
	$(ZIP) -D kerbsrc-nt.zip $(WINBINARYFILES)
	mv Makefile.sav Makefile
	rm -f $(CLEANUP)

Macfile: macfile.list Makefile.sav
	rm -f Macfile
	sed -e 's|/|:|g' -e 's/^/:/' -e '/:.:/d' -e '/:mac:/d' macfile.list > macfile.maclist
	grep '\.c$$' macfile.maclist > macsrcsgss
	grep -v ':gssapi:' macsrcsgss > macsrcsk5
	echo SRCS = `cat macsrcsgss` >> Macfile
	echo GSSOBJS68K = `sed -e 's/$$/.68K.o/' -e 's/.*://' \
		-e 's/^/:bin:68K:/' macsrcsgss` >> Macfile
	echo GSSOBJS68KCFM = `sed -e 's/$$/.68K.o/' -e 's/.*://' \
		-e 's/^/:bin:CFM-68K:/' macsrcsgss` >> Macfile
	echo GSSOBJSPPC = `sed -e 's/$$/.PPC.o/' -e 's/.*://' \
		-e 's/^/:bin:PPC:/' macsrcsgss` >> Macfile
	echo K5OBJS68K = `sed -e 's/$$/.68K.o/' -e 's/.*://' \
		-e 's/^/:bin:68K:/' macsrcsk5` >> Macfile
	echo K5OBJS68KCFM = `sed -e 's/$$/.68K.o/' -e 's/.*://' \
		-e 's/^/:bin:CFM-68K:/' macsrcsk5` >> Macfile
	echo K5OBJSPPC = `sed -e 's/$$/.PPC.o/' -e 's/.*://' \
		-e 's/^/:bin:PPC:/' macsrcsk5` >> Macfile
	echo INCLUDES = `sed -n -e 's/\(.*:\)[^:]*\.h$$/-i \1/p' macfile.maclist | sort -u` >> Macfile
	echo "" >> Macfile
	tr '/:\\' ':\304\266'< mac/Makefile.tmpl >> Macfile

kerbsrc.mac: awk-windows-mac macfile.list Macfile
	cp mac/libraries/autoconf.h include/autoconf.h
	mv Macfile Makefile
	tar cvf kerbsrc.tar Makefile include/autoconf.h `cat macfile.list`
	rm -f $(CLEANUP)
	rm -f include/autoconf.h Makefile macsrc* macfile.maclist
	mv Makefile.sav Makefile

#
# Part of building the PC release has to be done on Unix. This includes
# anything the requires awk.
#
AH  = util/et/et_h.awk
AC  = util/et/et_c.awk
INC = include/
ET  = lib/krb5/error_tables/
GG  = lib/gssapi/generic/
GK  = lib/gssapi/krb5/
PR  = util/profile/

awk-windows-mac:
	gawk -f $(AH) outfile=$(INC)asn1_err.h $(ET)asn1_err.et
	gawk -f $(AH) outfile=$(INC)kdb5_err.h $(ET)kdb5_err.et
	gawk -f $(AH) outfile=$(INC)krb5_err.h $(ET)krb5_err.et
	gawk -f $(AH) outfile=$(INC)kv5m_err.h $(ET)kv5m_err.et
	gawk -f $(AH) outfile=$(INC)adm_err.h $(ET)adm_err.et
	cat $(INC)/krb5.hin $(INC)/krb5_err.h $(INC)/kdb5_err.h \
		$(INC)/kv5m_err.h $(INC)/asn1_err.h > $(INC)/krb5.h
	gawk -f $(AC) outfile=$(ET)asn1_err.c $(ET)asn1_err.et
	gawk -f $(AC) outfile=$(ET)kdb5_err.c $(ET)kdb5_err.et
	gawk -f $(AC) outfile=$(ET)krb5_err.c $(ET)krb5_err.et
	gawk -f $(AC) outfile=$(ET)kv5m_err.c $(ET)kv5m_err.et
	gawk -f $(AC) outfile=$(ET)adm_err.c $(ET)adm_err.et
	gawk -f $(AH) outfile=$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.et
	gawk -f $(AC) outfile=$(GG)gssapi_err_generic.c $(GG)gssapi_err_generic.et
	cat $(GG)gssapi.hin > $(GG)gssapi.h
	gawk -f $(AH) outfile=$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.et
	gawk -f $(AC) outfile=$(GK)gssapi_err_krb5.c $(GK)gssapi_err_krb5.et
	gawk -f $(AH) outfile=$(PR)prof_err.h $(PR)prof_err.et
	gawk -f $(AC) outfile=$(PR)prof_err.c $(PR)prof_err.et
	cat $(PR)/profile.hin $(PR)prof_err.h > $(PR)profile.h
	$(RM) include/profile.h
	cp $(PR)profile.h include/profile.h
	-chmod +w include/profile.h
	$(RM) $(INC)/krb5/osconf.h
	cp $(INC)/krb5/stock/osconf.h $(INC)/krb5
	-chmod +w $(INC)/krb5/osconf.h
# config/post.in
# put all:: first just in case no other rules occur here
#
all::

.c.obj:
	$(CC) $(CFLAGS) /c $*.c
!if defined(LIBNAME)
##WIN16##	$(LIBCMD) $(PAGESIZE) /nologo $(LIBNAME) -+$@;

##WIN32##!if !defined(OBJFILELIST)
##WIN32##OBJFILELIST=@$(OBJFILE)
##WIN32##!endif
##WIN32##!if !defined(OBJFILEDEP)
##WIN32##OBJFILEDEP=$(OBJFILE)
##WIN32##!endif

##WIN32##all-windows:: $(LIBNAME)
##WIN32##$(LIBNAME): $(OBJFILEDEP)
##WIN32##	$(LIBCMD) /out:$(LIBNAME) /nologo $(OBJFILELIST)

!endif

check::
check-windows::

.depend: $(SRCS) $(SRCTOP)/util/depfix.sed
	if test -n "$(SRCS)" ; then \
		$(CC) -M $(CFLAGS) $(SRCS) | \
			sed -f $(SRCTOP)/util/depfix.sed | \
			sed -e 's; $(SRCTOP)/; $$(SRCTOP)/;g' | \
			sed -e 's; $(srcdir)/; $$(srcdir)/;g' | \
			sed -e 's; $(BUILDTOP)/; $$(BUILDTOP)/;g' | \
			sed -e 's; \./; ;g' > .depend; \
	else :; fi

depend:: .depend
	if test -n "$(SRCS)" ; then \
		sed -e '/^# +++ Dependency line eater +++/,$$d' \
			< $(srcdir)/Makefile.in | cat - .depend \
			> $(srcdir)/Makefile.in.new; \
	$(MV) $(srcdir)/Makefile.in $(srcdir)/Makefile.in.old; \
	$(MV) $(srcdir)/Makefile.in.new $(srcdir)/Makefile.in; \
	else :; fi

clean:: clean-$(WHAT)
	$(RM) config.log pre.out post.out Makefile.out

clean-unix::
	if test -n "$(OBJS)" ; then $(RM) $(OBJS); else :; fi
	$(RM) .depend

clean-windows::
	$(RM) *.$(OBJEXT)
	$(RM) msvc.pdb *.err *.exe

!if defined(LIBNAME)
clean-windows::
	$(RM) $(LIBNAME)
!endif
!if defined(OBJFILE)
clean-windows::
	$(RM) $(OBJFILE)
!endif
