# Makefile for the Project Athena Hesiod Nameserver library
#
# $Id: Imakefile,v 1.2 1996/06/01 18:46:32 ghudson Exp $
#

#if defined(_AIX) && defined(_IBMR2)
OSDEF= -DBIT_ZERO_ON_LEFT
#endif

DEFINES=-I. -DHESIOD $(OSDEF)

SRCS = hesiod.c hespwnam.c hesmailhost.c hesservbyname.c resolve.c cistrcmp.c 
OBJS = hesiod.o hespwnam.o hesmailhost.o hesservbyname.o resolve.o cistrcmp.o 

ProfiledObjectRule()

#ifdef ultrix
libhesiod.a:	${OBJS}
	@echo Building Hesiod library...
	rm -rf tmp
	mkdir tmp
	(cd tmp; ar x $(ATHLIBDIR)/libresolv.a)
	ar rc $@ ${OBJS} tmp//**/*.o
	ranlib $@
	rm -rf tmp
	mkdir tmp
	(cd tmp; ar x $(ATHLIBDIR)/libresolv_p.a)
	cd profiled; ar rc ../libhesiod_p.a ${OBJS} ../tmp//**/*.o
	ranlib libhesiod_p.a
install_library(hesiod,$(ATHLIBDIR))
#else
SimpleLibrary(hesiod,$(OBJS),$(ATHLIBDIR))
#endif

SimpleLint(hesiod,$(SRCS))
SimpleProgram(hesinfo,hesinfo.o libhesiod.a,,$(ATHRBINDIR))
build_program(hestest,hestest.o libhesiod.a,,)

install_man(hesiod.3,hesiod.3)
install_man(hesinfo.1,hesinfo.1)

install_file(hesiod.h,$(ATHINCDIR)/hesiod.h)

$(OBJS):: hesiod.h

hesiod.h: hesiod.h.sed
	$(RM) hesiod.h
	sed s:CONFDIR:$(ATHCONFDIR): < hesiod.h.sed > hesiod.h

check:
	./hestest hestest.conf

