# $Id: Makefile,v 1.8 1994/05/16 02:03:00 vikas 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
LIBDIR =	$(SRCDIR)/lib

## SET THIS
# Directories needed by the program.


## SET THIS
# Set the various defines for compile time defines:
#
SYSDEFS =

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

##
# The various directories that are needed in the program. Should NOT
# have trailing '/'.
DIRDEFS =	

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

TARG	=	nsmon
OBJECTS = 	main.o nsmon.o


$(TARG): $(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: $(TARG)
	$(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
	@echo ""; echo "___Update CONFIG with nameserver test information___"

clean:
	/bin/rm -f $(TARG) $(OBJECTS) core a.out nstest.o nstest

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