#----------------------------------------------------------------------
# XCallerID, copyright (c) 1998 Joe Yandle <yandle@cs.unc.edu>
#----------------------------------------------------------------------
#
#----------------------------------------------------------------------
# C O M P I L A T I O N :
#----------------------------------------------------------------------
#
# To compile it all, just type:
#
#   $ make
#
#----------------------------------------------------------------------
# C O N F I G U R A T I O N   S E C T I O N :
#----------------------------------------------------------------------

#----------------------------------------------------------------------
# C++ Compiler
#
CC = g++

#----------------------------------------------------------------------
# Compiler flags
#
CCFLAGS = -ansi -g
#CCFLAGS = -ansi -g -Wall
#CCFLAGS = -ansi -Wall -O4

#----------------------------------------------------------------------
# Modem
#
MODEM = -DMODEM=\"/dev/modem\"

#----------------------------------------------------------------------
# Modem reset string
#
MODEM_RESET = -DMODEM_RESET=\"atz\"

#----------------------------------------------------------------------
# CallerID init string
#
MODEM_INIT = -DMODEM_INIT=\"at\#cid=1\"

#----------------------------------------------------------------------
# Type of CallerID service.  Uncomment NMBR if you only have 
# number service, or NMNB if you have name and number
#
# WARNING - name and number support has NOT been tested.  I
# don't get it where I live, so I wrote the code based on how
# I thought it worked.  If you do get this service, I welcome
# any comments on how the code worked, but if all you want is 
# for the program to work correctly, use number support only.
#
SERVICE = -DSERVICE=\"NMBR\"
#SERVICE = -DSERVICE=\"NMNB\"

#----------------------------------------------------------------------
# XCallerID installation directory
#
XCID_HOME = -DXCID_HOME=\"/usr/local/XCallerID-1.2\"

#----------------------------------------------------------------------
# X11 home directory
#
X11_HOME = /usr/X11R6

#----------------------------------------------------------------------
# mSQL home directory
#
MSQL_HOME = /usr/local/Hughes

#----------------------------------------------------------------------
# End of configuration
#----------------------------------------------------------------------

SERVERINCS = -I$(MSQL_HOME)/include
CLIENTINCS = -I$(MSQL_HOME)/include `gtk-config --cflags`

SERVERDEFS = $(MODEM) $(MODEM_RESET) $(MODEM_INIT) $(XCID_HOME) $(SERVICE)
CLIENTDEFS = $(XCID_HOME)

SERVERLIBS = -L$(X11_HOME)/lib -lX11 -lXext -L$(MSQL_HOME)/lib -lmsql
CLIENTLIBS = `gtk-config --libs` -L$(MSQL_HOME)/lib -lmsql

SERVEROPTS = $(CCFLAGS) $(SERVERINCS) $(SERVERDEFS)
CLIENTOPTS = $(CCFLAGS) $(CLIENTINCS) $(CLIENTDEFS)

all: xcid XCallerID

xcid: xcid.C
	$(CC) $(SERVEROPTS) xcid.C $(SERVERLIBS) -o xcid

XCallerID: XCallerID.C
	$(CC) $(CLIENTOPTS) XCallerID.C $(CLIENTLIBS) -o XCallerID

gtk: GCallerID.C
	$(CC) $(CLIENTOPTS) GCallerID.C $(CLIENTLIBS) `gtk-config --cflags` `gtk-config --libs` -o GCallerID

clean:
	rm -f xcid XCallerID

rclean:
	rm -f xcid XCallerID *~
