# $Id: Makefile.in,v 1.13 2005-04-06 19:35:55 ghudson Exp $

SHELL=/bin/sh
INSTALL=@INSTALL@
RANLIB=@RANLIB@
VPATH=@srcdir@
srcdir=@srcdir@
top_srcdir=@top_srcdir@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
mandir=@mandir@
sysconfdir=@sysconfdir@
top_builddir=.

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

.SUFFIXES: .lo

all: libhesiod.la hestest

libhesiod.la: ${OBJS}
	${LIBTOOL} --mode=link ${CC} -rpath ${libdir} -version-info 0:0:0 \
	  -o $@ ${OBJS} ${LIBS}

hestest: hestest.lo libhesiod.la
	${LIBTOOL} --mode=link ${CC} -o $@ hestest.lo libhesiod.la

${OBJS}: hesiod.h

.c.lo:
	${LIBTOOL} --mode=compile ${CC} -c -o $@ ${ALL_CFLAGS} $<

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

install:
	${top_srcdir}/mkinstalldirs ${DESTDIR}${libdir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${includedir}
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man3
	${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man5
	${LIBTOOL} --mode=install ${INSTALL} -m 644 libhesiod.la \
	  ${DESTDIR}${libdir}
	${INSTALL} -m 444 ${srcdir}/hesiod.h ${DESTDIR}${includedir}
	${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_free_string.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_parse_result.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:
	${LIBTOOL} --mode=clean rm -f ${OBJS} libhesiod.la hestest.lo hestest

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