########################################################################
#
# Makefile     : Comserv
#
# Author       : Phil Maechling
#
# Last Revised : December 18, 1998
#
########################################################################



########################################################################
# Solaris 2 definitions
#
CC	= cc
INCL	= ../include
CFLAGS_DEBUG	= -I$(INCL) +w -DSOLARIS2 -g
CFLAGS		= -I$(INCL) +w -DSOLARIS2 -xO3
LDFLAGS_DEBUG	=
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 =	comserv


all:		$(ALL)

comserv:	server.o cscfg.o buffers.o comlink.o commands.o $(CSULIB)
		$(CC) $(LDFLAGS) -o comserv server.o cscfg.o buffers.o \
		comlink.o commands.o $(CSULIB) $(LDLIBS)

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

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

buffers.o:	$(INCL)/dpstruc.h $(INCL)/quanstrc.h $(INCL)/service.h \
		$(INCL)/stuff.h server.h buffers.c
		$(CC) -c $(CFLAGS) buffers.c

comlink.o:	$(INCL)/dpstruc.h $(INCL)/quanstrc.h $(INCL)/service.h \
		$(INCL)/stuff.h server.h comlink.c
		$(CC) -c $(CFLAGS) comlink.c

commands.o:	$(INCL)/dpstruc.h $(INCL)/quanstrc.h $(INCL)/service.h \
		$(INCL)/stuff.h server.h commands.c
		$(CC) -c $(CFLAGS) commands.c

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

FORCE:

clean:
		-rm *.o $(ALL)

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

