#
# $Id: Makefile.in,v 1.2 2007-08-09 20:41:32 amb Exp $
#

SHELL=/bin/sh
VPATH=@srcdir@
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
MKDIR_P=@MKDIR_P@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
datarootdir=@datarootdir@
mandir=@mandir@

CC=@CC@
DEFS=@DEFS@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
ALL_CFLAGS=-I../include ${CPPFLAGS} ${CFLAGS} ${DEFS}

KLIBS=	../libds/libdsk.a ../usp/libusp.a @KRB4_LIBS@ @KRB5_LIBS@ ${LIBS}

.c.o:
	${CC} -c ${ALL_CFLAGS} $<

all: create_mtg_dir crmtgs mkds pmtg dsmail dspipe

clean:
	rm -f create_mtg_dir crmtgs mkds pmtg dsmail dspipe *.o

distclean: clean
	rm -f Makefile

depend:

install:
	${MKDIR_P} ${DESTDIR}${bindir}
	${MKDIR_P} ${DESTDIR}${mandir}/man1
	${MKDIR_P} ${DESTDIR}${mandir}/man8
	${INSTALL_PROGRAM} create_mtg_dir ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} crmtgs ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} mkds ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} pmtg ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} dsmail ${DESTDIR}${bindir}
	${INSTALL_PROGRAM} dspipe ${DESTDIR}${bindir}
	-rm -f $(DESTDIR)${bindir}/rmds
	-ln -s mkds $(DESTDIR)$(bindir)/rmds
	${INSTALL} -m 755 dsc_setup.sh ${DESTDIR}${bindir}/dsc_setup
	${INSTALL_DATA} crmtgs.1 ${DESTDIR}${mandir}/man1
	${INSTALL_DATA} mkds.8 ${DESTDIR}${mandir}/man8
	${INSTALL_DATA} pmtg.1 ${DESTDIR}${mandir}/man1
	${INSTALL_DATA} dsmail.1 ${DESTDIR}${mandir}/man1
	${INSTALL_DATA} dspipe.8 ${DESTDIR}${mandir}/man8
	${INSTALL_DATA} dsc_setup.1 ${DESTDIR}${mandir}/man1
	${INSTALL_DATA} rmds.8 ${DESTDIR}${mandir}/man8

create_mtg_dir: create_mtg_dir.o
	${CC} ${LDFLAGS} -o create_mtg_dir create_mtg_dir.o

crmtgs: crmtgs.o ../ets/dsc_et.o
	${CC} ${LDFLAGS} -o crmtgs crmtgs.o ../ets/dsc_et.o ${KLIBS}

mkds: mkds.o ../ets/dsc_et.o ../client/edit.o
	${CC} ${LDFLAGS} -o mkds mkds.o ../ets/dsc_et.o ../client/edit.o ${KLIBS}

pmtg: pmtg.o ../ets/dsc_et.o
	${CC} ${LDFLAGS} -o pmtg pmtg.o ../ets/dsc_et.o ${KLIBS}

dsmail: dsmail.o ../ets/dsc_et.o
	${CC} ${LDFLAGS} -o dsmail dsmail.o ../ets/dsc_et.o ${KLIBS}

dspipe: dspipe.o ../ets/dsc_et.o
	${CC} ${LDFLAGS} -o dspipe dspipe.o ../ets/dsc_et.o ${KLIBS}
