# $Id: Makefile,v 1.2 1994/05/16 02:12:09 vikas Exp $
#
# Makefile for 'portmon'
#
# 
# ETC is used for the config file and error log file.
# DATA is used for the data directory

## SET THIS
# Directories needed by the 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 =	

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

TARG =		portmon
OBJECTS = 	portmon.o

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

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

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

install:	$(TARG)
	@[ -d $(TOP) ] || mkdir  $(TOP)
	@[ -d $(ETCDIR) ] || mkdir $(ETCDIR)
	@[ -d $(BINDIR) ] || mkdir $(BINDIR)
	$(INSTALL) -c -m 751 $(TARG)  $(BINDIR)/
	@echo ""; echo "___Update config file for $(TARG) daemon in $(ETCDIR) ___"

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

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

