# $Id: Makefile.in,v 1.1 1999-12-08 22:06:43 danw Exp $

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

CC=@CC@
DEFS=@DEFS@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@ ${WARN_CFLAGS} ${ERROR_CFLAGS}
LDFLAGS=@LDFLAGS@
LIBS=-lhesiod -lcom_err -lgms @LIBS@
ALL_CFLAGS=${CPPFLAGS} ${CFLAGS} ${DEFS}

all: get_message

OBJS=	get_message.o check_viewable.o gethost_err.o \
	gethost_errors.o get_a_message.o get_fallback_file.o \
	get_message_from_server.o get_servername.o \
	hesiod_err.o hesiod_errors.o \
	put_fallback_file.o read_to_memory.o \
	view_message_by_tty.o view_message_by_zephyr.o

get_message: ${OBJS}
	${CC} ${LDFLAGS} -o get_message ${OBJS} ${LIBS}

gethost_err.h gethost_err.c: gethost_err.et
	compile_et ${srcdir}/gethost_err.et

hesiod_err.h hesiod_err.c: hesiod_err.et
	compile_et ${srcdir}/hesiod_err.et

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

install:
	${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
	${INSTALL_PROGRAM} get_message ${DESTDIR}${bindir}
	${INSTALL} -m 444 ${srcdir}/get_message.1 ${DESTDIR}${mandir}/man1

clean:
	rm -f get_message ${OBJS}
	rm -f gethost_err.c gethost_err.h
	rm -f hesiod_err.c hesiod_err.h

distclean: clean
	rm -f config.cache config.log config.status Makefile

gethost_errors.o: gethost_err.h
hesiod_errors.o get_servername.o: hesiod_err.h
