#
# $Id: Makefile.in,v 1.4 2007-08-09 20:41:31 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@
sbindir=@sbindir@
datarootdir=@datarootdir@
datadir=@datadir@
# XXX
lispdir=@lispdir@
libexecdir=@libexecdir@

CC=@CC@
DEFS=@DEFS@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=../server/acl.o ../libds/libdsk.a ../usp/libusp.a @KRB4_LIBS@ @KRB5_LIBS@ @LIBS@
ALL_CFLAGS=-I../include ${CPPFLAGS} ${CFLAGS} ${DEFS}

OBJS	= edsc.o parse.o time.o do_quote.o do_trn.o do_mtg.o do_misc.o\
	do_cache.o version.o

SRCS	= edsc.c parse.c time.c do_quote.c do_trn.c do_mtg.c do_misc.c\
	do_cache.c version.c

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

all: edsc discuss.el

clean:
	rm -f edsc *.o version.h discuss.el

distclean: clean
	rm -f Makefile

depend:

install: all
	${MKDIR_P} ${DESTDIR}${libexecdir}
	${MKDIR_P} ${DESTDIR}${lispdir}
	${INSTALL_PROGRAM} edsc ${DESTDIR}${libexecdir}
	${INSTALL_DATA} ${srcdir}/discuss-acl.el ${DESTDIR}${lispdir}
	${INSTALL_DATA} ${srcdir}/discuss-enter.el ${DESTDIR}${lispdir}
	${INSTALL_DATA} ${srcdir}/discuss-ls.el ${DESTDIR}${lispdir}
	${INSTALL_DATA} ${srcdir}/discuss-misc.el ${DESTDIR}${lispdir}
	${INSTALL_DATA} ${srcdir}/discuss.el ${DESTDIR}${lispdir}

version.h: ${SRCS} newvers.sh
	sh newvers.sh

discuss.el: discuss.el.in Makefile
	sed -e 's|#libexecdir#|${libexecdir}|' $< > $@

edsc: $(OBJS)
	${CC} ${LDFLAGS} -o edsc ${OBJS} ${LIBS}

version.o: version.c version.h
