########################################################################
#
# Makefile     : Comserv Clients
#
# Author       : Patrick Small
#
# Last Revised : December 17, 1998
#
########################################################################


########################################################################
# Solaris 2 definitions
#
CC	= cc
INCL	= ../include
CFLAGS_DEBUG	= -g -I$(INCL) +w -DSOLARIS2
CFLAGS		= -I$(INCL) +w -DSOLARIS2
LDFLAGS_DEBUG	= -g
LDFLAGS		= -R /opt/SUNWspro/lib
CSUDIR	= ../util
CSULIB	= $(CSUDIR)/libutil.a
LDLIBS	= -lposix4 -lnsl -lsocket

########################################################################
# SunOS definitions
#
#CC	= acc
#INCL	= ../include
#CFLAGS	= -I$(INCL)
#LDFLAGS	=
#CSUDIR	= ../util
#CSULIB	= $(CSUDIR)/libutil.a
#LDLIBS	=

########################################################################

ALL =		config msgmon dpda dataread

all:		$(ALL)

config:		config.o $(CSULIB)
		$(CC) $(LDFLAGS) -o config config.o $(CSULIB) $(LDLIBS)

msgmon:		msgmon.o $(CSULIB)
		$(CC) $(LDFLAGS) -o msgmon msgmon.o $(CSULIB) $(LDLIBS)

dpda:		dpda.o $(CSULIB)
		$(CC) $(LDFLAGS) -o dpda dpda.o $(CSULIB) $(LDLIBS)

dataread:	dataread.o $(CSULIB)
		$(CC) $(LDFLAGS) -o dataread dataread.o $(CSULIB) $(LDLIBS)

config.o:	$(INCL)/dpstruc.h $(INCL)/service.h \
		$(INCL)/cfgutil.h $(INCL)/stuff.h config.c
		$(CC) -c $(CFLAGS) config.c

msgmon.o:	$(INCL)/dpstruc.h $(INCL)/service.h \
		$(INCL)/cfgutil.h $(INCL)/stuff.h msgmon.c
		$(CC) -c $(CFLAGS) msgmon.c

dpda.o:		$(INCL)/dpstruc.h $(INCL)/service.h \
		$(INCL)/cfgutil.h $(INCL)/stuff.h dpda.c
		$(CC) -c $(CFLAGS) dpda.c

dataread.o:	$(INCL)/dpstruc.h $(INCL)/service.h \
		$(INCL)/seedstrc.h $(INCL)/stuff.h $(INCL)/timeutil.h dataread.c
		$(CC) -c $(CFLAGS) dataread.c

$(CSULIB):	FORCE
	(cd $(CSUDIR); make)

FORCE:

clean:
		-rm *.o $(ALL)

install:	$(ALL)
		cp -p $(ALL) $(BINDIR)

