# $Id: Makefile,v 1.4 1992/06/18 21:19:44 aggarwal 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

## SET THIS
# Directories needed by the program.
#	DATADIR			for creating the TPMON-OUTPUT
#	NODESFILE		config file for list of nodes to be monitored
DATADIR = 	$(TOP)/data
NODESFILE =	$(ETCDIR)/tpmon-confg

## SET THIS
# Set the various defines for compile time defines:
#
#       -DNFS           if you are using NFS for file locking.
#	-DSEND_WSIGNAL	if you want it to send a signal to the watchdog
#			program when a site changes severity (to warning)
#
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)\"

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

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

TPMON	=	tpmon

$(TPMON): $(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: $(TPMON)
	install -c -m 751 $(TPMON) $(BINDIR)/

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

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