#
# Makefile for ttc and ttc daemon.
# You may have to edit this for some systems.
#
# Change INST_DEST if you want to install programs somewhere else.
#
# Tested on 	Linux,
#		SunOS 4.x,
#		SunOS 5.4,
#		Solaris
#

INST_DEST = /usr/local/bin

srcdir		= .
prefix		= /usr
libdir		= $(prefix)/lib
includedir	= $(prefix)/include

CC		= gcc
CFLAGS		=
CPPFLAGS	= -I. -I$(includedir)
CCFLAGS		= $(CFLAGS) $(CPPFLAGS)

# Some systems may need here 'LIBS = -L$(libdir) -lsocket'
# At least SunOS 4.x and 5.x and Solaris may need that line.
LIBS		=
#LIBS		= -L$(libdir) -lsocket

TTC_OBJS	= ttc.o options.o
TTCD_OBJS	= ttcd.o
TTC_SRCS	= $(TTC_OBJS:.o=.c)

PROGRAMS 	= ttc ttcd

all: $(PROGRAMS)

ttc:	$(TTC_OBJS)
	-rm -f ttc
	$(CC) -o ttc $(TTC_OBJS) $(LIBS)

ttcd:	$(TTCD_OBJS)
	-rm -f ttcd
	$(CC) -o ttcd $(TTCD_OBJS) $(LIBS)

install:
	install -o 0 -g 0 -m 0755 ./ttc $(INST_DEST)/ttc
	install -o 0 -g 0 -m 0755 ./ttcd $(INST_DEST)/ttcd
clean:
	-rm -f *.o rm ttc ttcd

