# This file was generated automatically by configure.  Do not edit.
VPATH = .
links = 
host_alias = mips-sgi-irix5.2
host_cpu = mips
host_vendor = sgi
host_os = irix5.2
host_canonical = mips-sgi-irix5.2
target_alias = mips-sgi-irix5.2
target_cpu = mips
target_vendor = sgi
target_os = irix5.2
target_canonical = mips-sgi-irix5.2
package_makefile_frag = config/common
target_makefile_frag = config/mt-irix5
host_makefile_frag = config/host
### Makefile for kerberos tree -- maximal passed arguments
srcdir = .

prefix = /usr/local

program_transform_name = 

##

SHELL = /bin/sh

SUBDIRS = util util/makedepend util/et util/ss include lib lib/des lib/krb lib/kdb lib/kadm lib/acl lib/kstream kuser kadmin server slave admin appl appl/bsd man tests appl/tftp appl/sample appl/telnet appl/telnet/libtelnet appl/telnet/telnet appl/telnet/telnetd appl/ftp appl/ftp/ftp appl/ftp/ftpd email email/movemail email/pfrom email/POP  appl/rdist
OTHERS = 

INSTALL_TARGET = install

RUNTEST = runtest
RUNTESTFLAGS =

##DOS!include config\common
##DOS!include config\mt-win
#### host and target specific makefile fragments come in here.
## common makefile fragment
# Directory syntax: R=root, C=current, S=Separator, U=Up one level
R=/
C=.
S=/
U=../

# The default system to build
WHAT=unix

# from Imake.tmpl
SRCTOP=$(srcdir)$(S)$(BUILDTOP)
# There must be some spaces after the tab in the second line of
# INCLUDEFLAGS, otherwise it looks like <TAB><dash> at the start of a
# shell command line, to the MPW Makefile conversion scripts.
INCLUDEFLAGS= $(LOCALINCLUDE) \
	      -I$(BUILDTOP)include -I$(SRCTOP)include -I$(srcdir)
GLOBAL_CDEFS=$(TARGET_CDEFS) $(SHMFLAG) $(SITE_CDEFS) $(NOENCFLAG)
CFLAGS_LINK=$(DBG)
CFLAGS=$(CFLAGS_LINK) $(INCLUDEFLAGS) $(DEFINES) $(GLOBAL_CDEFS)
DEPEND=$(BUILDTOP)util$(S)makedepend$(S)makedepend

INSTALL = $(SRCTOP)$(U)install.sh -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644

srcdir = .
VPATH=$(srcdir)
prefix = /usr/local

# prefix will have been set by configure
USRDIR= $(prefix)
SVRDIR= $(USRDIR)$(S)etc
DAEMDIR= $(USRDIR)$(S)etc
PROGDIR=$(USRDIR)$(S)bin
LIBDIR= $(USRDIR)$(S)lib
INCLDIR= $(USRDIR)$(S)include
MANDIR= $(USRDIR)$(S)man
### /* KDBDIR has the acl's and the key database */
KDBDIR=$(USRDIR)$(S)database
### /* KLOGDIR has the security related logs */
KLOGDIR=$(USRDIR)$(S)database
SITE_KRB_REALM=error-default-realm
SRVTAB_FILE =$(R)etc$(S)krb-srvtab
### /* this is where krb.realms and krb.conf go. */
CONFDIR=$(LIBDIR)
### /* this is where installation and testing scripts go */
INSTDIR=$(USRDIR)$(S)install

### /*
###  * Define NOENCRYPTION if you do not have the DES library.
###  */
### /* #define NOENCRYPTION */

### /*
###  * Define NEED_SETENV if you don't have setenv() in your libc.
###  * (likely for older 4.3 systems and pre-4.3 systems)
###  */
# used in lib/krb/Imakefile
#define NEED_SETENV
SETENVSRCS = setenv.c
SETENVOBJS = setenv.$(OBJEXT)

### /*
###  * Define TKT_SHMEM if you want to use shared memory for the session
###  * keys in your ticket caches.
###  */
# used in lib/krb/Imakefile, 
# via SHM_FLAG: dest_tkt.c, in_tkt.c, tf_util.c, 
### /* #define TKT_SHMEM */

### if you don't have flock() (ie, posix) then clear this
FLOCK=-DMAIL_USE_FLOCK

# Filename extensions for file types
LIBEXT=a
OBJEXT=o
EXEEXT=

KRB_LIB=$(BUILDTOP)lib$(S)krb$(S)libkrb.$(LIBEXT)
KRB_LIBDEP=$(KRB_LIB)
KADM_LIB=$(BUILDTOP)lib$(S)kadm$(S)libkadm.$(LIBEXT)
KADM_LIBDEP=$(KADM_LIB)
ACL_LIB=$(BUILDTOP)lib$(S)acl$(S)libacl.$(LIBEXT)
ACL_LIBDEP=$(ACL_LIB)
KSTREAM_LIB=$(BUILDTOP)lib$(S)kstream$(S)libkstream.$(LIBEXT)
KSTREAM_LIBDEP=$(KSTREAM_LIB)

# Since this is just a Makefile, these #ifdefs are really comments:
#ifdef NOENCRYPTION
#NOENCFLAG=-DNOENCRYPTION
#DES_LIBDEP=
#DES_LIB=$(BSDLIB)
#else
NOENCFLAG=
DES_LIBDEP=$(BUILDTOP)lib$(S)des$(S)libdes.$(LIBEXT)
DES_LIB=$(DES_LIBDEP) $(BSDLIB)
#endif

KDB_LIBDEP=$(BUILDTOP)lib$(S)kdb$(S)libkdb.$(LIBEXT)
KDB_LIB=$(BUILDTOP)lib$(S)kdb$(S)libkdb.$(LIBEXT) $(LIBNDBM)

## a target should include the line SHMFLAG=-DTKT_SHMEM if they use SHMEM.
### /*
###  * The name of a command which compiles error tables.
###  */
AWK=awk
### /* these are invoked as $(...) foo.et, which works, but could be better */
COMPILE_ET_H= $(AWK) -f $(SRCTOP)util$(S)et$(S)et_h.awk outfile=$@
COMPILE_ET_C= $(AWK) -f $(SRCTOP)util$(S)et$(S)et_c.awk outfile=$@
.SUFFIXES:  .h .c .et .ct

.et.h:
	$(AWK) -f $(SRCTOP)util$(S)et$(S)et_h.awk outfile=$*.h $<

.et.c:
	$(AWK) -f $(SRCTOP)util$(S)et$(S)et_c.awk outfile=$*.c $<

### /*
###  * The name of a command which compiles command tables.
###  */
MAKE_COMMANDS= $(BUILDTOP)util$(S)ss$(S)mk_cmds
.ct.c:
	$(MAKE_COMMANDS) -o $@ $<
### /*
###  * Loader argument to get the com_err library
###  */
COM_ERR = $(BUILDTOP)util$(S)et$(S)libcom_err.$(LIBEXT)
### /*
###  * Dependency name for COM_ERR, if any
###  */
COM_ERR_DEP = $(COM_ERR)
### /*
###  * Loader argument to get the ss library
###  */
SS_LIB = $(BUILDTOP)util$(S)ss$(S)libss.$(LIBEXT)
### /*
###  * Dependency name for SS_LIB, if any
###  */
SS_LIBDEP = $(SS_LIB)

### /* 
###  * Define OLD_COMPAT if you want to be able to link old binaries with
###  * the new library names
###  */ 
# used in lib/des/Imakefile, lib/krb/Imakefile
### /* #define OLD_COMPAT */

### /*
###  * Define DEBUG_LIBS if you want to create versions of the libraries
###  * that have useful debugging information (the default rules will strip
###  * out extra symbols, including debugging symbols, from the symbol
###  * table.)  NOTE:  This only works if you do NOT turn on PROFILED_LIBS
###  * below.
###  * NOTE:  this doesn't turn on the debugging flag for your compiler; do
###  * that with the DBG make variable, below.
###  */
#define DEBUG_LIBS

### /*
###  * Define PROFILED_LIBS if you want to create profiled versions of the
###  * libraries used in Kerberos
###  */
### /* #define PROFILED_LIBS */

### /*
###  * Define PROF_FLAG to be the flag to be passed to your C compiler to
###  * turn on profiling.  For 4.3BSD on a VAX, this should probably be -pg.
###  * For most other systems, it should probably be -p
###  */
### /* #define PROF_FLAG -p */

### /*
###  * Delete a library file. This broken out so that it may be 
###  * selectively turned off (for example under DOS).
###  */
RMLIB= $(RM)
### /*
###  * The name of a command which builds an object library.
###  */
ARCHIVE= ar cru
### /*
###  * The name of another program needed to post-process the archive.
###  */
RANLIB= ranlib

### /* 
###  * Install commands:  installs a file into the destination tree.
###  * These commands are called with two arguments: the source and the
###  * destination of the install.
###  */
# since fix-prot sets the modes, never use install at all.
### /* install a file */
INSTALLFILE= $(INSTALL_DATA)
### /* install a library */ 
INSTALLLIB= $(INSTALL_DATA)
### /* install a program */
INSTALLPROG= $(INSTALL_PROGRAM)
### /* invoke raw install program */
INSTALLRAW= $(INSTALL_DATA)
### /* install a program which should run as root */
INSTALLSUID= echo "FIX UID:"; $(INSTALL_PROGRAM)

# /* The name of the target's linker */
LD=ld

# /* The name of the target's assembler */
AS=as

# /* The name of the C compiler for the target */
CC=gcc

# /* Compile with initialized data read-only [cc -R]
# & shared (if possible) */
CCRO=$(CC)

# /* A command which invokes the C preprocessor */
CPP=$(CC) -E

# /* Debug or optimize? */
DBG=-g -O
DBG_LIB=-g -O

# /* Program to index source files */
TAGGER=etags

# /* delete one or more files/directories/links */
RM=rm -f

# /* rename/move a file */
MV=mv

# /* copy a file */
CP=cp

# /* create a link */
LN=ln -s

# /* print a file or files */
LPR=lpr -p

# /* change mode of a file */
CHMOD=chmod

################### end of config.Imakefile stuff ######################
BISON = `if [ -f $$(rootme)/byacc/byacc ] ; \
	    then echo $$(rootme)/byacc/byacc ; \
	    else echo byacc ; \
	fi`

FLEX = `if [ -f $$(rootme)/flex/flex ] ; \
	then echo $$(rootme)/flex/flex ; \
	else echo flex ; fi`

LEXLIB=-ll
TERMLIB=-ltermcap
# /*  sgi */

# Host support files
DES_TIME_SRCS=unix_time.c
DES_TIME_OBJS=unix_time.o
LIB_KRB_HOSTSRCS=unix_glue.c
LIB_KRB_HOSTOBJS=unix_glue.o

#define HAVE_PUTENV
SETENVSRCS = fakeenv.c
SETENVOBJS = fakeenv.o

RPROGS=-DRPROGS_IN_USR_BSD
# /* noone else puts them there... */
SHELL = /bin/sh
TARGET_CDEFS= -DBSD42 -DATHENA -DHAVE_VSPRINTF \
	-DNOTTYENT -DPOSIX -DNOSTBLKSIZE -DNOVFORK -DNOUTHOST \
	-DNO_GETUSERSHELL -DHAS_STRDUP -DWAIT_USES_INT -DUSE_SIGPROCMASK \
	-DHAS_SETUPTERM
#define NOINSTALL
RANLIB=true
# WARNING! Cheating!
CC=cc -xansi -DSTDARG
# makedepend can't grok irix system headers...
DEPEND=true
# empty host config
###


# The first rule in the file had better be this one.  Don't put any above it.
all: all-$(WHAT)

all-unix:
	@for i in $(SUBDIRS); do \
	  if (cd $$i; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" \
		RESOLV=$(RESOLV) all) ; then \
	    true; \
	  else \
	    exit 1; \
	  fi; \
	done

# Windows nmake is too stupid to be able to iterate over a list, use
# semicolons, or keep track of anything but the current directory.
# unix configure will make all-unix the default in config/common
all-: all-windows
all-windows: makefile-windows
	cd include
	$(MAKE)
	cd ..\lib\des
	$(MAKE)
	cd ..\kadm
	$(MAKE)
	cd ..\kstream
	$(MAKE)
	cd ..\krb
	$(MAKE)
	cd ..\..\kwin
	$(MAKE)
	cd ..\wintel
	$(MAKE)
	cd ..

#
# cygin
#
# The all-in-one program that logs you in to a remote Kerberos site
# in one operation.
#
# These rules are sufficient to build this from a working tree, but don't have
# enough dependencies, so don't use for development!
cygin: appl/bsd/cygin
	 rm -f cygin
	 ln appl/bsd/cygin .

install-cygin:
	$(INSTALLPROG) appl/bsd/cygin $(DESTDIR)$(PROGDIR)/cygin

appl/bsd/cygin: include/krb.h lib/kstream/libkstream.a lib/krb/libkrb.a lib/des/libdes.a
	(cd appl/bsd; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" RESOLV=$(RESOLV) cygin)

include/krb.h:
	(cd include; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" RESOLV=$(RESOLV) all)

lib/kstream/libkstream.a:
	(cd lib/kstream; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" RESOLV=$(RESOLV) all)

lib/krb/libkrb.a:
	(cd lib/krb; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" RESOLV=$(RESOLV) all)

lib/des/libdes.a:
	(cd lib/des; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" RESOLV=$(RESOLV) all)

roll:
	for i in $(SUBDIRS); do \
	(cd $$i; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" RESOLV=$(RESOLV) all);\
	(cd $$i; $(RM) *.o);\
	done

depend:
	for i in $(SUBDIRS); do \
	(cd $$i; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" depend)\
	done

install:: install-$(WHAT)

install-unix:
	@for i in $(SUBDIRS); do \
	  if (cd $$i; $(MAKE) $(MFLAGS) "CC=$(CC)" "DBG=$(DBG)" \
		DESTDIR=$(DESTDIR) install); \
	    then true; \
	  else \
	    exit 1; \
	  fi; \
	done
	if test -d $(DESTDIR)$(S)$(KDBDIR); then \
	  true; \
	else \
	  mkdir $(DESTDIR)$(S)$(KDBDIR); \
	fi

install-windows:
	copy doc\*.txt floppy
	copy doc\*.htm floppy
	cd include
	$(MAKE) install
	cd ..\lib\des
	$(MAKE) install
	cd ..\kadm
	$(MAKE) install
	cd ..\kstream
	$(MAKE) install
	cd ..\krb
	$(MAKE) install
	cd ..\..\kwin
	$(MAKE) install
	cd ..\wintel
	$(MAKE) install
	cd ..

install-mac:
	cp ../doc/*.txt $(DESTDIR)
	cp ../doc/*.html $(DESTDIR)
	(cd include; $(MAKE) -f Makefile.in DESTDIR=$(DESTDIR) install-mac)
	cp lib/krb/mac_stubs.c $(DESTDIR)
	cp driver/'%CNS Kerberos' $(DESTDIR)
	cp driver/'%Kerberos Client Preferences' $(DESTDIR)
	cp kconfig/kconfig/'%CNS Config' $(DESTDIR)
	cp mactelnet/'%CNS Telnet' $(DESTDIR)
	rm -f $(DESTDIR)/README
	echo "Cygnus Network Security release for Macintosh." > $(DESTDIR)/README
	echo "Full instructions are in mac.txt or mac.html." >> $(DESTDIR)/README

dist:: dist-$(WHAT)

dist-unix::

dist-windows::
	cd floppy
	pkzip ..\cns95q1.zip *.*

dist-mac:
	echo "Run StuffIt on the Mac, with the whole DESTDIR"
	

clean: clean-$(WHAT)

clean-:: clean-unix
clean-unix:
	rm -rf tmpdir
	for i in $(SUBDIRS); do \
	(cd $$i; $(MAKE) $(MFLAGS) clean)\
	done

clean-windows:
	cd lib\des
	$(MAKE) clean
	cd ..\kadm
	$(MAKE) clean
	cd ..\kstream
	$(MAKE) clean
	cd ..\krb
	$(MAKE) clean
	cd ..\..\kwin
	$(MAKE) clean
	cd ..\wintel
	$(MAKE) clean
	cd ..
	-del include\makefile
	-del lib\des\makefile
	-del lib\kadm\makefile
	-del lib\kstream\makefile
	-del lib\krb\makefile
	-del floppy\*.exe
	-del floppy\*.dll
	-del floppy\*.lib
	-del floppy\*.h
	-del floppy\*.txt
	-del floppy\*.htm
	-del makefile
	-del cns95q1.zip

uninstall:
	@echo "the uninstall target is not supported in this tree"

# Testsuite targets.
site.exp: config.status Makefile
	if [ -f site.exp ]; then \
	  mv site.exp site.bak; \
	else \
	  touch site.bak; \
	fi
	rm -f site.tmp
	echo "## variables are automatically generated by make ##" > site.tmp
	echo "# Do not edit here. If you wish to override these" >> site.tmp
	echo "# values, add them to the last section" >> site.tmp
	echo "set objdir `pwd`" >> site.tmp
	echo "## Variables generated by configure. Do Not Edit ##" >> site.tmp
	cat site.bak | \
	  sed -e '1,/^## Variables generated by.*##/ d' >> site.tmp
	mv site.tmp site.exp

check: site.exp
	$(RUNTEST) --tool krb --srcdir $(srcdir)/testsuite $(RUNTESTFLAGS)

#
# Part of building the Mac release has to be done on Unix at the moment.
# That's done by `make unixmac'.
#
unixmac:
	(cd include; $(MAKE) -f Makefile.uni unixmac S=/)
	(cd ../doc; $(MAKE) -f Makefile.in macdoc)

#
# Rename 8.3 truncated file names back to thier proper unix names
#
ren2long:
	-(cd config; sh ../lib/krb/ren2long.sh)
	-(cd include; sh ../lib/krb/ren2long.sh)
	-(cd kwin; sh ../lib/krb/ren2long.sh)
	-(cd lib/des; sh ../krb/ren2long.sh)
	-(cd lib/kadm; sh ../krb/ren2long.sh)
	-(cd lib/kstream; sh ../krb/ren2long.sh)
	-(cd lib/krb; sh ren2long.sh)
	-(sh lib/krb/ren2long.sh)

#
# Build the zip file that distributes Kerberos sources for DOS sites.
#
ZIPFILES=config include lib/des lib/krb lib/kadm lib/kstream kwin wintel \
	Makefile.in configure.in floppy \
	wconfig.c ren.msg util/et/et_h.awk util/et/et_c.awk ChangeLog
ZIPBINARYFILES=kwin/*.ico wintel/*.ico 
ZIPEXCLUDE=INCLUDE/.CVS LIB/DES/.CVS LIB/DES/%DESLIB- LIB/KRB/%KRBLIB- \
	CONFIG/CVS/* INCLUDE/CVS/* LIB/KRB/CVS/* LIB/DES/CVS/* \
	LIB/DES/DOC/CVS/* LIB/KADM/CVS/* LIB/KSTREAM/CVS/* KWIN/CVS/* \
	KWIN/*.ICO WINTEL/CVS/* WINTEL/*.ICO
kerbsrc.zip: force
	-rm -f kerbsrc.zip
	awk -f util/et/et_h.awk outfile=lib/krb/krb_err.h lib/krb/krb_err.et
	awk -f util/et/et_h.awk outfile=lib/kadm/kadm_err.h lib/kadm/kadm_err.et
	-mkdir floppy
	cp prototypes/etc.krb.realms floppy/krb.rea
	cp prototypes/etc.krb.conf floppy/krb.con
	(cd ../doc; $(MAKE) -f Makefile.in windoc)
	zip -lrk kerbsrc.zip $(ZIPFILES) -x $(ZIPEXCLUDE)
	zip -rk kerbsrc.zip $(ZIPBINARYFILES)
	(cd ..; zip -lrk src/kerbsrc.zip doc -x DOC/CVS/*)
	rm lib/krb/krb_err.h lib/kadm/kadm_err.h
	rm -r floppy

force:

# with the gnu make, this is done automatically.

Makefile: $(srcdir)$(S)Makefile.in $(host_makefile_frag) $(target_makefile_frag) $(package_makefile_frag)
	$(SHELL) ./config.status

makefile-windows: wconfig.c makefile.in config\common config\mt-win \
	config\host config\postfix lib\des\makefile.in lib\kadm\makefile.in \
	lib\kstream\makefile.in lib\krb\makefile.in include\makefile.in
	SET CL=
	$(CC) /AL /Iinclude wconfig.c
	.\wconfig <makefile.in >makefile
	.\wconfig <include\makefile.in >include\makefile
	.\wconfig <lib\des\makefile.in >lib\des\makefile
	.\wconfig <lib\kadm\makefile.in >lib\kadm\makefile
	.\wconfig <lib\kstream\makefile.in >lib\kstream\makefile
	.\wconfig <lib\krb\makefile.in >lib\krb\makefile
	del wconfig.obj
	del wconfig.exe

# end of Makefile.in
# NOPOSTFIX
