# $Id: Makefile.in,v 1.9 1997/03/18 21:35:17 ghudson Exp $

SHELL=/bin/sh
INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
RANLIB=@RANLIB@
VPATH=@srcdir@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
bindir=@bindir@
libdir=@libdir@
includedir=@includedir@
mandir=@mandir@
sysconfdir=@sysconfdir@
lbindir=@lbindir@

CC=@CC@
CPPFLAGS=@CPPFLAGS@
CFLAGS=@CFLAGS@
LDFLAGS=@LDFLAGS@
LIBS=@LIBS@
ALL_CFLAGS=-I. -DSYSCONFDIR=\"${sysconfdir}\" ${CPPFLAGS} ${CFLAGS}
OBJS=hesiod.o hesmailhost.o hespwnam.o hesservbyname.o hescompat.o

all: libhesiod.a hesinfo hestest

libhesiod.a: ${OBJS}
	ar cru $@ ${OBJS}
	${RANLIB} $@

hesinfo: hesinfo.o libhesiod.a
	${CC} ${LDFLAGS} -o $@ hesinfo.o libhesiod.a ${LIBS}

hestest: hestest.o libhesiod.a
	${CC} ${LDFLAGS} -o $@ hestest.o libhesiod.a ${LIBS}

${OBJS}: hesiod.h

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

check:
	HESIOD_CONFIG=${srcdir}/hesiod.config.sample \
		./hestest ${srcdir}/hestest.conf

install:
	${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${lbindir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
	${INSTALL} -m 644 libhesiod.a ${DESTDIR}${libdir}
	${RANLIB} ${DESTDIR}${libdir}/libhesiod.a
	chmod u-w ${DESTDIR}${libdir}/libhesiod.a
	${INSTALL_PROGRAM} -m 555 hesinfo ${DESTDIR}${lbindir}
	${INSTALL} -m 444 ${srcdir}/hesiod.h ${DESTDIR}${includedir}
	${INSTALL} -m 444 ${srcdir}/hesinfo.1 ${DESTDIR}${mandir}/man1
	${INSTALL} -m 444 ${srcdir}/hesiod.3 ${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_end.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_free_list.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_free_passwd.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_free_postoffice.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_free_servent.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_getmailhost.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_getpwnam.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_getpwuid.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_getservbyname.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_init.3 ${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_resolve.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod_to_bind.3 \
		${DESTDIR}${mandir}/man3
	${INSTALL} -m 444 ${srcdir}/hesiod.conf.5 ${DESTDIR}${mandir}/man5

clean:
	rm -f ${OBJS} libhesiod.a hesinfo.o hesinfo hestest.o hestest

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