# Copyright (C) 1998-2001  Internet Software Consortium.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
# DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
# INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

# $Id: Makefile.in,v 1.63.4.1 2001/01/09 22:31:48 bwelling Exp $

srcdir =	@srcdir@
VPATH =		@srcdir@
top_srcdir =	@top_srcdir@

@BIND9_VERSION@

@BIND9_INCLUDES@

#
# Add database drivers here.
#
DBDRIVER_OBJS =
DBDRIVER_SRCS =
DBDRIVER_INCLUDES =
DBDRIVER_LIBS =

CINCLUDES =	-I${srcdir}/include -I${srcdir}/unix/include \
		${LWRES_INCLUDES} ${DNS_INCLUDES} ${ISC_INCLUDES} \
		${OMAPI_INCLUDES} ${DBDRIVER_INCLUDES}

CDEFINES =
CWARNINGS =

OMAPILIBS =	../../lib/omapi/libomapi.@A@
DNSLIBS =	../../lib/dns/libdns.@A@ @DNS_OPENSSL_LIBS@ @DNS_GSSAPI_LIBS@
ISCLIBS =	../../lib/isc/libisc.@A@
LWRESLIBS =	../../lib/lwres/liblwres.@A@

OMAPIDEPLIBS =	../../lib/omapi/libomapi.@A@
DNSDEPLIBS =	../../lib/dns/libdns.@A@
ISCDEPLIBS =	../../lib/isc/libisc.@A@
LWRESDEPLIBS =	../../lib/lwres/liblwres.@A@

DEPLIBS =	${LWRESDEPLIBS} ${OMAPIDEPLIBS} ${DNSDEPLIBS} ${ISCDEPLIBS}

LIBS =		${LWRESLIBS} ${OMAPILIBS} ${DNSLIBS} ${ISCLIBS} \
		${DBDRIVER_LIBS} @LIBS@

SUBDIRS =	unix

TARGETS =	named lwresd

OBJS =		aclconf.@O@ client.@O@ interfacemgr.@O@ listenlist.@O@ \
		log.@O@ logconf.@O@ main.@O@ notify.@O@ omapi.@O@ \
		omapiconf.@O@ query.@O@ server.@O@ sortlist.@O@ \
		tkeyconf.@O@ tsigconf.@O@ update.@O@ xfrout.@O@ \
		zoneconf.@O@ \
		lwaddr.@O@ lwresd.@O@ lwdclient.@O@ lwderror.@O@ lwdgabn.@O@ \
		lwdgnba.@O@ lwdgrbn.@O@ lwdnoop.@O@ lwsearch.@O@ \
		$(DBDRIVER_OBJS)

UOBJS =		unix/os.@O@

SRCS =		aclconf.c client.c interfacemgr.c listenlist.c \
		log.c logconf.c main.c notify.c omapi.c \
		omapiconf.c query.c server.c sortlist.c \
		tkeyconf.c tsigconf.c update.c xfrout.c \
		zoneconf.c \
		lwaddr.c lwresd.c lwdclient.c lwderror.c lwdgabn.c \
		lwdgnba.c lwdgrbn.c lwdnoop.c lwsearch.c \
		$(DBDRIVER_SRCS)

@BIND9_MAKE_RULES@

main.@O@: main.c
	${LIBTOOL} ${CC} ${ALL_CFLAGS} -DVERSION=\"${VERSION}\" \
		-DNS_LOCALSTATEDIR=\"${localstatedir}\" \
		-DNS_SYSCONFDIR=\"${sysconfdir}\" -c ${srcdir}/main.c

named: ${OBJS} ${UOBJS} ${DEPLIBS}
	${LIBTOOL} ${CC} ${CFLAGS} -o $@ ${OBJS} ${UOBJS} ${LIBS}

lwresd: named
	rm -f lwresd
	@LN@ named lwresd

clean distclean::
	rm -f ${TARGETS}

installdirs:
	$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${sbindir}

install:: named lwresd installdirs
	${LIBTOOL} ${INSTALL_PROGRAM} named ${DESTDIR}${sbindir}
	(cd ${DESTDIR}${sbindir}; rm -f lwresd; @LN@ named lwresd)
