# $Id: Makefile,v 1.5 1992/06/19 00:49:38 aggarwal Exp $
#
# Makefile for 'nsmon'
#
# ETC is used for dumping the HELPFILE in that directory

## SET THIS
# Directories needed by the Makefile. See description in ../Makefile
TOP = 		/usr/nocol
SRCDIR =	$(TOP)/src

BINDIR = 	$(TOP)/bin
ETCDIR = 	$(TOP)/etc
INCLUDEDIR = 	$(SRCDIR)/include

## SET THIS
# Directories needed by the program.
#	DATADIR			for creating the NSMON-OUTPUT
#	NODESFILE		config file for list of nodes to be monitored
#	DOMAINNAME		your host's domain name (berkeley.edu) for
#				which the nameservers tested are authoratative
DATADIR = 	$(TOP)/data
NODESFILE =	$(ETCDIR)/nsmon-confg
DOMAINNAME =	jvnc.net

## SET THIS
# Set the various defines for compile time defines:
#
#       -DNFS           if you are using NFS for file locking.
#
SYSDEFS =  -DNFS

####
#### Can leave the rest alone #######
####

##
# The various directories that are needed in the program. Should NOT
# have trailing '/'.
DIRDEFS =	-DDATADIR=\"$(DATADIR)\" \
		-DNODESFILE=\"$(NODESFILE)\" \
		-DQUERYDATA=\"$(DOMAINNAME)\"

# Compilation definitions
# The 'libresolv' lib might be needed here...
CC =		cc
CDEFS =		$(DIRDEFS) $(SYSDEFS)
LIBS =		-lresolv
CFLAGS = 	-g -I$(INCLUDEDIR)

OBJECTS = 	fgetline.o  main.o nsmon.o poll_sites.o standalone.o

NSMON	=	nsmon

$(NSMON): $(OBJECTS) Makefile
	$(CC) $(CFLAGS) $(OBJECTS) $(LIBS) -o $@

######
# small testing program to demonstrate the throughput() function
###
test nstest:	nstest.o nsmon.o
	$(CC) $(CFLAGS) -o nstest nsmon.o nstest.o

.c.o:
	$(CC) -c $(CFLAGS) $(CDEFS) $<

## The dependencies in case 'mkdep' not used
#
$(OBJECTS): $(INCLUDEDIR)/nocol.h  $(INCLUDEDIR)/nsmon.h

install: $(NSMON)
	install -c -m 751 $(NSMON) $(BINDIR)/
	@echo "___Update $(NODESFILE) with nameserver test information___"

clean:
	/bin/rm -f $(NSMON) $(OBJECTS) core a.out

rcs:
	@echo "Doing 'rcs' in 'nsmon'
	@-for i in $(OBJS); do \
		$(CO) -q `basename $$i .o`.c ;\
	  done
