## common makefile fragment from Imake.tmpl
SRCTOP=$(srcdir)/$(BUILDTOP)
INCLUDE= $(LOCALINCLUDE) -I$(BUILDTOP)/include -I$(SRCTOP)/include -I$(srcdir)
GLOBAL_CDEFS=$(TARGET_CDEFS) $(DBMFLAG) $(SHMFLAG) $(SITE_CDEFS)
CFLAGS=$(DBG) $(INCLUDE) $(DEFINES) $(GLOBAL_CDEFS)
DEPEND=true

srcdir=
VPATH=$(srcdir)

BASEDIR = /usr
USRDIR  = $(BASEDIR)/kerberos
SVRDIR  = $(USRDIR)/etc
DAEMDIR = $(USRDIR)/etc
PROGDIR = $(USRDIR)/bin
LIBDIR  = $(USRDIR)/lib
INCLDIR = $(USRDIR)/include
MANDIR  = $(USRDIR)/man
KDBDIR  = $(USRDIR)/database
KLOGDIR = $(USRDIR)/database
CONFDIR = $(USRDIR)/etc
INSTDIR = $(USRDIR)/install
SRVTAB_FILE = /etc/krb-srvtab

SITE_KRB_REALM=error-default-realm

### /*
###  * Set ORGANIZATION to be the desired organization string printed
###  * by the 'kinit' program.  It may have spaces.
###  */
### Used in kuser/Makefile.in, kuser/kinit.c
###
ORGANIZATION=Cygnus Support

### /*
###  * 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/Makefile.in
###
### /* #define NEED_SETENV */
### SETENVSRCS = setenv.c
### SETENVOBJS = setenv.o

### /*
###  * Define TKT_SHMEM if you want to use shared memory for the session
###  * keys in your ticket caches.
###  */
### /* #define TKT_SHMEM */
### SHMFLAG=-DTKT_SHMEM

### if you don't have flock() (ie, posix) then clear this
### Used in email/movemail/Makefile.in, movemail.c
FLOCK=-DMAIL_USE_FLOCK

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

DES_LIBDEP=$(BUILDTOP)/lib/des/libdes.a 
DES_LIB=$(DES_LIBDEP) $(BSDLIB)

DBMFLAG=-DNDBM
KDB_LIBDEP=$(BUILDTOP)/lib/kdb/libkdb.a
KDB_LIB=$(BUILDTOP)/lib/kdb/libkdb.a $(LIBNDBM)

.SUFFIXES:  .h .c .et .ct

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

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

### /*
###  * The name of a command which compiles command tables.
###  */
MAKE_COMMANDS= $(BUILDTOP)/util/ss/mk_cmds
.ct.c:
	$(MAKE_COMMANDS) $*.ct

### /*
###  * Loader argument to get the com_err library
###  */
COM_ERR = $(BUILDTOP)/util/et/libcom_err.a
### /*
###  * Dependency name for COM_ERR, if any
###  */
COM_ERR_DEP = $(COM_ERR)
### /*
###  * Loader argument to get the ss library
###  */
SS_LIB = $(BUILDTOP)/util/ss/libss.a
### /*
###  * Dependency name for SS_LIB, if any
###  */
SS_LIBDEP = $(SS_LIB)

### /*
###  * 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 */

### /*
###  * 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.
###  */
# use install to deal with existing read-only target files.
### /* install a file */
INSTALLFILE=install -c
### /* install a library */ 
INSTALLLIB=install -c
### /* install a program */
INSTALLPROG=install -c
### /* invoke raw install program */
INSTALLRAW=install -c
### /* install a program which should run as root */
INSTALLSUID= echo "FIX UID:"; cp

AWK=awk
LD=ld
AS=as
CC=gcc
CCRO=$(CC)
CPP=$(CC) -E
DBG=-O
TAGGER=etags
MAKE=make
RM=rm -f
MV=mv
CP=cp
LN=ln -s
LPR=lpr -p
CHMOD=chmod
YACC=yacc
LEX=lex
