## config/pre.in
## common prefix for all Makefile.in in the Kerberos V5 tree.

WHAT = unix
SHELL=/bin/sh

all:: all-$(WHAT)

clean:: clean-$(WHAT)

install:: install-$(WHAT)

check:: check-$(WHAT)

all-unix:: all-prerecurse
all-unix:: all-recurse
all-unix:: all-postrecurse

all-prerecurse::
all-postrecurse::

clean-unix:: clean-prerecurse
clean-unix:: clean-recurse
clean-unix:: clean-postrecurse

clean-prerecurse::
clean-postrecurse::

distclean-unix:: distclean-prerecurse
distclean-unix:: distclean-recurse
distclean-unix:: distclean-postrecurse

install-unix:: install-prerecurse
install-unix:: install-recurse
install-unix:: install-postrecurse

install-prerecurse::
install-postrecurse::

check-unix:: check-prerecurse
check-unix:: check-recurse
check-unix:: check-postrecurse

check-prerecurse::
check-postrecurse::

Makefiles:: Makefiles-prerecurse
Makefiles:: Makefiles-recurse
Makefiles:: Makefiles-postrecurse

Makefiles-prerecurse::
Makefiles-postrecurse::

# Directory syntax:
#
# begin absolute path
ABS=/
# begin relative path
REL=
# up-directory
U=..
# path separator
S=/
# this is magic... should only be used for preceding a program invocation
C=./

SUBDIRS = @subdirs@ $(LOCAL_SUBDIRS)
srcdir = @srcdir@
SRCTOP = @srcdir@/$(BUILDTOP)
VPATH = @srcdir@
CONFIG_RELTOPDIR = @CONFIG_RELTOPDIR@

ALL_CFLAGS = $(DEFS) $(DEFINES) $(CPPFLAGS) $(LOCALINCLUDES) $(CFLAGS)
CFLAGS = @CCOPTS@
CPPFLAGS = @CPPFLAGS@
DEFS = @DEFS@
CC = @CC@
LD = $(PURE) @LD@
DEPLIBS = @DEPLIBS@
LDFLAGS = @LDFLAGS@
LD_UNRESOLVED_PREFIX = @LD_UNRESOLVED_PREFIX@
LD_SHLIBDIR_PREFIX = @LD_SHLIBDIR_PREFIX@
LDARGS = @LDARGS@
LIBS = @LIBS@
SRVLIBS = @SRVLIBS@
SRVDEPLIBS = @SRVDEPLIBS@
CLNTLIBS = @CLNTLIBS@
CLNTDEPLIBS = @CLNTDEPLIBS@

INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@ -s
INSTALL_DATA=@INSTALL_DATA@
INSTALL_SHLIB=@INSTALL_SHLIB@
INSTALL_SETUID=$(INSTALL) -s -m 4755 -o root
## This is needed because autoconf will sometimes define @exec_prefix@ to be
## ${prefix}.
prefix=@prefix@
INSTALL_PREFIX=$(prefix)
INSTALL_EXEC_PREFIX=@exec_prefix@
exec_prefix=@exec_prefix@
SHLIB_TAIL_COMP=@SHLIB_TAIL_COMP@

KRB5MANROOT = @mandir@
ADMIN_BINDIR = @sbindir@
SERVER_BINDIR = @sbindir@
CLIENT_BINDIR =@bindir@
ADMIN_MANDIR = $(KRB5MANROOT)/man8
SERVER_MANDIR = $(KRB5MANROOT)/man8
CLIENT_MANDIR = $(KRB5MANROOT)/man1
FILE_MANDIR = $(KRB5MANROOT)/man5
KRB5_LIBDIR = @libdir@
KRB5_SHLIBDIR = @libdir@$(SHLIB_TAIL_COMP)
KRB5_INCDIR = $(INSTALL_EXEC_PREFIX)/include
KRB5_INCSUBDIRS = \
	$(KRB5_INCDIR)/asn.1 \
	$(KRB5_INCDIR)/gssapi \
	$(KRB5_INCDIR)/kerberosIV

#
# Macros used by the KADM5 (OV-based) unit test system.
# XXX check which of these are actually used!
#
TESTDIR		= $(BUILDTOP)/kadmin/testing
STESTDIR	= $(SRCTOP)/kadmin/testing
COMPARE_DUMP	= $(TESTDIR)/scripts/compare_dump.pl
FIX_CONF_FILES	= $(TESTDIR)/scripts/fixup-conf-files.pl
INITDB		= $(STESTDIR)/scripts/init_db
MAKE_KEYTAB	= $(TESTDIR)/scripts/make-host-keytab.pl
LOCAL_MAKE_KEYTAB= $(TESTDIR)/scripts/make-host-keytab.pl
RESTORE_FILES	= $(STESTDIR)/scripts/restore_files.sh
SAVE_FILES	= $(STESTDIR)/scripts/save_files.sh
ENV_SETUP	= $(TESTDIR)/scripts/env-setup.sh
CLNTTCL		= $(TESTDIR)/util/ovsec_kadm_clnt_tcl
SRVTCL		= $(TESTDIR)/util/ovsec_kadm_srv_tcl
# Dejagnu variables.
# We have to set the host with --host so that setup_xfail will work.
# If we don't set it, then the host type used is "native", which
# doesn't match "*-*-*".
host=@host@
DEJAFLAGS	= $(DEJALFLAGS) $(CLFLAGS) --debug --srcdir $(srcdir) --host \
		   $(host)
RUNTEST		= runtest $(DEJAFLAGS)

START_SERVERS	= $(STESTDIR)/scripts/start_servers $(TEST_SERVER) $(TEST_PATH)
START_SERVERS_LOCAL = $(STESTDIR)/scripts/start_servers_local

STOP_SERVERS	= $(STESTDIR)/scripts/stop_servers $(TEST_SERVER) $(TEST_PATH)
STOP_SERVERS_LOCAL = $(STESTDIR)/scripts/stop_servers_local
#
# End of macros for the KADM5 unit test system.
#

transform = @program_transform_name@

RM = rm -f
CP  = cp
MV = mv -f
CHMOD=chmod
RANLIB = @RANLIB@
ARCHIVE = @ARCHIVE@
ARADD = @ARADD@
LN = @LN_S@
AWK = @AWK@
LEX = @LEX@
LEXLIB = @LEXLIB@
YACC = @YACC@
AUTOCONF = @AUTOCONF@

HOST_TYPE = @HOST_TYPE@
SHEXT = @SHEXT@
STEXT=@STEXT@
VEXT=@VEXT@
DO_MAKE_SHLIB = @DO_MAKE_SHLIB@
SHLIB_STATIC_TARGET=@SHLIB_STATIC_TARGET@

TOPLIBD = $(BUILDTOP)/lib

OBJEXT = o
LIBEXT = a
EXEEXT =

#
# variables for libraries, for use in linking programs
# -- this may want to get broken out into a separate frag later
#
#
# Note: the following variables must be set in any Makefile.in that
# uses KRB5_BUILD_PROGRAM
#
# PROG_LIBPATH	list of dirs, in -Ldir form, to search for libraries at link
# PROG_RPATH	list of dirs, in dir1:dir2 form, for rpath purposes
#
# invocation is like:
# prog: foo.o bar.o $(KRB5_BASE_DEPLIBS)
# 	$(CC_LINK) -o $@ foo.o bar.o $(KRB5_BASE_LIBS)


CC_LINK=@CC_LINK@

# this gets set by configure to either $(STLIBEXT) or $(SHLIBEXT),
# depending on whether we're building with shared libraries.
DEPLIBEXT=@DEPLIBEXT@

KADMCLNT_DEPLIB	= $(TOPLIBD)/libkadm5clnt$(DEPLIBEXT)
KADMSRV_DEPLIB	= $(TOPLIBD)/libkadm5srv$(DEPLIBEXT)
KDB5_DEPLIB	= $(TOPLIBD)/libkdb5$(DEPLIBEXT)
GSSRPC_DEPLIB	= $(TOPLIBD)/libgssrpc$(DEPLIBEXT)
GSS_DEPLIB	= $(TOPLIBD)/libgssapi_krb5$(DEPLIBEXT)
KRB4_DEPLIB	= @KRB4_DEPLIB@		# $(TOPLIBD)/libkrb4$(DEPLIBEXT)
DES425_DEPLIB	= @DES425_DEPLIB@	# $(TOPLIBD)/libdes425$(DEPLIBEXT)
KRB5_DEPLIB	= $(TOPLIBD)/libkrb5$(DEPLIBEXT)
CRYPTO_DEPLIB	= $(TOPLIBD)/libk5crypto$(DEPLIBEXT)
COM_ERR_DEPLIB	= $(TOPLIBD)/libcom_err$(DEPLIBEXT)
DYN_DEPLIB	= $(TOPLIBD)/libdyn$(DEPLIBEXT)

PTY_DEPLIB	= $(TOPLIBD)/libpty$(DEPLIBEXT)

# These are forced to use ".a" as an extension because they're never
# built shared.
UTIL_DEPLIB	= $(TOPLIBD)/libkrb5util.a
SS_DEPLIB	= $(TOPLIBD)/libss.a
DB_DEPLIB	= $(TOPLIBD)/libdb.a
KRB524_DEPLIB	= @KRB524_DEPLIB@

KRB5_BASE_DEPLIBS	= $(KRB5_DEPLIB) $(CRYPTO_DEPLIB) $(COM_ERR_DEPLIB)
KRB4COMPAT_DEPLIBS	= $(KRB4_DEPLIB) $(DES425_DEPLIB) $(KRB5_BASE_DEPLIBS)
KDB5_DEPLIBS		= $(KDB5_DEPLIB) $(DB_DEPLIB)
GSS_DEPLIBS		= $(GSS_DEPLIB)
GSSRPC_DEPLIBS		= $(GSSRPC_DEPLIB) $(DYN_DEPLIB) $(GSS_DEPLIBS)
KADM_COMM_DEPLIBS	= $(UTIL_DEPLIB) $(KDB5_DEPLIBS) $(GSSRPC_DEPLIBS)
KADMSRV_DEPLIBS		= $(KADMSRV_DEPLIB) $(KADM_COMM_DEPLIBS)
KADMCLNT_DEPLIBS	= $(KADMCLNT_DEPLIB) $(KADM_COMM_DEPLIBS)

# LIBS gets substituted in... e.g. -lnsl -lsocket

# GEN_LIB is -lgen if needed for regexp
GEN_LIB		= @GEN_LIB@

DB_LIB		= $(TOPLIBD)/libdb.a
SS_LIB		= $(TOPLIBD)/libss.a
KDB5_LIB	= -lkdb5

# KRB4_LIB is -lkrb4 if building --with-krb4
KRB4_LIB	= @KRB4_LIB@

# DES425_LIB is -ldes425 if building --with-krb4
DES425_LIB	= @DES425_LIB@

# KRB524_LIB is $(BUILDTOP)/krb524/libkrb524.a if building --with-krb4
KRB524_LIB	= @KRB524_LIB@

# HESIOD_LIBS is -lhesiod...
HESIOD_LIBS	= @HESIOD_LIBS@

KRB5_BASE_LIBS	= -lkrb5 -lk5crypto -lcom_err $(GEN_LIB) $(LIBS)
KRB4COMPAT_LIBS	= $(KRB4_LIB) -lkrb5 $(DES425_LIB) -lk5crypto -lcom_err $(GEN_LIB) $(LIBS)
KDB5_LIBS	= $(KDB5_LIB) $(DB_LIB)
GSS_LIBS	= -lgssapi_krb5
GSSRPC_LIBS	= -lgssrpc -ldyn $(GSS_LIBS)
KADM_COMM_LIBS	= $(KDB5_LIBS) $(GSSRPC_LIBS)
KADMSRV_LIBS	= -lkadm5srv $(HESIOD_LIBS) $(KADM_COMM_LIBS)
KADMCLNT_LIBS	= -lkadm5clnt $(KADM_COMM_LIBS)

UTIL_LIB	= -lkrb5util
PTY_LIB		= -lpty

#
# some more stuff for --with-krb4
KRB4_LIBPATH	= @KRB4_LIBPATH@
KRB4_INCLUDES	= @KRB4_INCLUDES@

#
# variables for --with-tcl=
TCL_LIBS	= @TCL_LIBS@
TCL_LIBPATH	= @TCL_LIBPATH@
TCL_RPATH	= @TCL_RPATH@
TCL_INCLUDES	= @TCL_INCLUDES@

# error table rules
#
### /* these are invoked as $(...) foo.et, which works, but could be better */
COMPILE_ET_H= $(AWK) -f $(SRCTOP)/util/et/et_h.awk outfile=$@
COMPILE_ET_C= $(AWK) -f $(SRCTOP)/util/et/et_c.awk outfile=$@

.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 $<

# rule to make object files
#
.SUFFIXES: .c .o
.c.o:
	$(CC) $(ALL_CFLAGS) -c $<

# ss command table rules
#
MAKE_COMMANDS= $(BUILDTOP)/util/ss/mk_cmds

.ct.c:
	$(MAKE_COMMANDS) $<

#
# end of pre.in
