#
# $Id: Makefile.in,v 1.3 2007-08-09 20:41:30 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@
datadir=@datadir@
ssinfodir=${datadir}/discuss/info

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

OBJS=	discuss.o edit.o output.o trn_expr.o list.o trn_select.o \
	status.o new_trans.o print.o lsm.o addmtg.o list_acl.o \
	interrupt.o goto.o reply.o ckm.o anm.o time.o data.o \
	cmds.o rn.o randrp.o catchup.o set.o ../ets/discuss_err.o

# Pairs of symlink source and destination.
INFOLINKS=	add_mtg.info add_meeting.info \
		am.info add_meeting.info \
		anm.info announce_meeting.info \
		ann_mtg.info announce_meeting.info \
		ckm.info check_meetings.info \
		d.info delete.info \
		da.info delete_acl.info \
		dl.info delete.info \
		enter.info talk.info \
		exit.info quit.info \
		g.info goto.info \
		go.info goto.info \
		la.info list_acl.info \
		ls.info list.info \
		lsm.info list_meetings.info \
		next.info print.info \
		nm.info next_meeting.info \
		nref.info print.info \
		p.info print.info \
		pr.info print.info \
		pref.info print.info \
		prev.info print.info \
		q.info quit.info \
		read_new.info rn.info \
		rp.info reply.info \
		sa.info set_acl.info \
		send.info talk.info \
		spec.info transaction_specifiers.info \
		specifiers.info transaction_specifiers.info \
		swf.info switch_off.info \
		swn.info switch_on.info \
		w.info write.info

.SUFFIXES: .ct

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

.y.o:
	yacc $<
	mv -f y.tab.c $*.c
	${CC} -c ${ALL_CFLAGS} $*.c

.ct.o:
	mk_cmds $<
	${CC} -c ${ALL_CFLAGS} $*.c

# cmds.o: cmds.ct
#	mk_cmds cmds.ct
#	${CC} -c ${ALL_CFLAGS} cmds.c

all: discuss

clean:
	rm -f *.o *~ \#* *.bak
	rm -f discuss cmds.c trn_expr.c y.tab.c TAGS info.tar

distclean: clean
	rm -f Makefile

depend:

install:
	${MKDIR_P} ${DESTDIR}${ssinfodir}
	${MKDIR_P} ${DESTDIR}${bindir}
	${INSTALL_DATA} ${srcdir}/info/access.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/add_meeting.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/announce_meeting.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/check_meetings.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/del_mtg.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/delete.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/delete_acl.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/goto.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/help.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/list.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/list_acl.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/list_meetings.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/next_meeting.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/print.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/quit.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/reply.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/retrieve.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/rn.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/set.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/set_acl.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/status.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/switch_off.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/switch_on.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/talk.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/transaction_specifiers.info ${DESTDIR}${ssinfodir}
	${INSTALL_DATA} ${srcdir}/info/write.info ${DESTDIR}${ssinfodir}
	${INSTALL_PROGRAM} discuss ${DESTDIR}${bindir}
	@set $(INFOLINKS); \
	while [ $$# -ge 2 ]; do \
		rm -f ${DESTDIR}${ssinfodir}/$$1; \
		echo ln -s $$2 ${DESTDIR}${ssinfodir}/$$1; \
		ln -s $$2 ${DESTDIR}${ssinfodir}/$$1; \
		shift 2; \
	done

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

