thisconfigdir=.
myfulldir=util/pty
mydir=.
BUILDTOP=$(REL)..$(S)..
RELDIR=../util/pty

SED = sed

KRB5_RUN_ENV= @KRB5_RUN_ENV@
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)

LIB=pty
LIBMAJOR=1
LIBMINOR=2

STLIBOBJS= cleanup.o getpty.o init_slave.o open_ctty.o open_slave.o \
	update_utmp.o update_wtmp.o vhangup.o void_assoc.o pty_err.o \
	logwtmp.o init.o sane_hostname.o

STOBJLISTS=OBJS.ST

INSTALLFILE = cp

# for pty-int.h
LOCALINCLUDES=-I. -I$(srcdir)

FILES= Makefile cleanup.c getpty.c init_slave.c open_ctty.c open_slave.c update_utmp.c update_wtmp.c vhangup.c void_assoc.c pty_err.h pty_err.c\
logwtmp.c init.c

CFILES=$(srcdir)/cleanup.c $(srcdir)/getpty.c $(srcdir)/init_slave.c \
	$(srcdir)/open_ctty.c $(srcdir)/open_slave.c \
	$(srcdir)/update_utmp.c $(srcdir)/update_wtmp.c $(srcdir)/vhangup.c \
	$(srcdir)/void_assoc.c $(srcdir)/logwtmp.c \
	$(srcdir)/init.c $(srcdir)/sane_hostname.c


SRCS=pty_err.c $(CFILES)
SHLIB_EXPDEPS = \
	$(COM_ERR_DEPLIB)
SHLIB_EXPLIBS= -lcom_err 
SHLIB_DIRS=-L$(TOPLIBD)
SHLIB_RDIRS=$(KRB5_LIBDIR)

DEPLIBS=

#
all-unix:: includes pty_err.h

all-unix:: all-liblinks

dump-utmp: dump-utmp.o
	$(CC) $(LDFLAGS) -o dump-utmp dump-utmp.o
dump-utmp.o: dump-utmp.c

pty_paranoia: pty_paranoia.o $(COM_ERR_DEPLIB) $(PTY_DEPLIB)
	$(CC_LINK) -o pty_paranoia pty_paranoia.o $(PTY_LIB) $(COM_ERR_LIB) $(LIBS)

check-paranoia: pty_paranoia
	$(KRB5_RUN_ENV) ./pty_paranoia

install-unix:: install-libs

clean-unix::
	$(RM) libpty.a $(BUILDTOP)/include/libpty.h pty_err.c pty_err.h
clean-unix:: clean-liblinks clean-libs clean-libobjs

depend::  pty_err.h

#install:: libpty.h
#	$(INSTALL_DATA) $(srcdir)/libpty.h  $(DESTDIR)$(KRB5_INCDIR)/libpty.h

clean-mac::
	$(RM) libpty.a
	$(RM) $(LIBOBJS)

## 

includes:: libpty.h
	if cmp $(srcdir)/libpty.h \
	$(BUILDTOP)/include/libpty.h >/dev/null 2>&1; then :; \
	else \
		(set -x; $(RM) $(BUILDTOP)/include/libpty.h; \
		 $(CP) $(srcdir)/libpty.h \
			$(BUILDTOP)/include/libpty.h) ; \
	fi

includes:: $(BUILDTOP)/include/krb5/autoconf.h

clean-unix::
	$(RM) $(BUILDTOP)/include/libpty.h



clean-unix:: clean-liblinks clean-libs clean-libobjs clean-files

clean-mac:: clean-files

clean-files::
	rm -f *~ \#* *.bak \
		*.otl *.aux *.toc *.PS *.dvi *.x9700 *.ps \
		*.cp *.fn *.ky *.log *.pg *.tp *.vr \
		*.o profiled/?*.o libcom_err.a libcom_err_p.a \
		com_err.o compile_et \
		et.ar TAGS y.tab.c lex.yy.c error_table.c \
		et_lex.lex.c \
		test1.h test1.c test2.h test2.c test_et \
		eddep makedep *.ln

pty_err.o: pty_err.c
pty_err.h: pty_err.et
pty_err.c: pty_err.et

$(BUILDTOP)/include/krb5/autoconf.h: $(SRCTOP)/include/krb5/autoconf.h.in
	(cd $(BUILDTOP)/include; $(MAKE) krb5/autoconf.h)


# @lib_frag@
# @libobj_frag@

# +++ Dependency line eater +++
# 
# Makefile dependencies follow.  This must be the last section in
# the Makefile.in file
#
pty_err.so pty_err.po $(OUTPRE)pty_err.$(OBJEXT): pty_err.c $(COM_ERR_DEPS)
cleanup.so cleanup.po $(OUTPRE)cleanup.$(OBJEXT): cleanup.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
getpty.so getpty.po $(OUTPRE)getpty.$(OBJEXT): getpty.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
init_slave.so init_slave.po $(OUTPRE)init_slave.$(OBJEXT): init_slave.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
open_ctty.so open_ctty.po $(OUTPRE)open_ctty.$(OBJEXT): open_ctty.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
open_slave.so open_slave.po $(OUTPRE)open_slave.$(OBJEXT): open_slave.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
update_utmp.so update_utmp.po $(OUTPRE)update_utmp.$(OBJEXT): update_utmp.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
update_wtmp.so update_wtmp.po $(OUTPRE)update_wtmp.$(OBJEXT): update_wtmp.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
vhangup.so vhangup.po $(OUTPRE)vhangup.$(OBJEXT): vhangup.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
void_assoc.so void_assoc.po $(OUTPRE)void_assoc.$(OBJEXT): void_assoc.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
logwtmp.so logwtmp.po $(OUTPRE)logwtmp.$(OBJEXT): logwtmp.c $(COM_ERR_DEPS) \
  libpty.h pty-int.h pty_err.h
init.so init.po $(OUTPRE)init.$(OBJEXT): init.c $(COM_ERR_DEPS) libpty.h \
  pty-int.h pty_err.h
sane_hostname.so sane_hostname.po $(OUTPRE)sane_hostname.$(OBJEXT): sane_hostname.c $(COM_ERR_DEPS) \
  pty-int.h pty_err.h libpty.h $(SRCTOP)/include/socket-utils.h \
  $(BUILDTOP)/include/krb5/autoconf.h $(SRCTOP)/include/fake-addrinfo.h \
  $(SRCTOP)/include/port-sockets.h

