# $Id: Makefile,v 1.6 1994/05/23 04:00:38 vikas Exp $
#
# Makefile for 'tpmon' (thruput monitor)
#

## 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 =
INSTALL =	install

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

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

# Compilation definitions
CC =		cc
CDEFS =		$(DIRDEFS) $(SYSDEFS)
LIBS =		-lnocol $(SYSLIBS)
CFLAGS = 	-g -I$(INCLUDEDIR) -L$(LIBDIR)

TARG	=	tpmon
OBJECTS = 	main.o poll_sites.o tpmon.o


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

######
# small testing program to demonstrate the throughput() function
###
test tptest:	tptest.o tpmon.o tptest.h
	$(CC) $(CFLAGS) -o tptest tpmon.o tptest.o

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

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

install: $(TARG)
	$(INSTALL) -c -m 751 $(TARG) $(BINDIR)/
	@echo ""; echo "___Update config file in $(ETCDIR)___"

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

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