# The entire TTYWatcher Project is:
# Copyright 1995  En Garde Systems
#
# Makefile for the Watcher Project
# Mike Neuman mcn@EnGarde.com 6/12/95
#
#  Makefile for SunOS 4.x
#

CCOPT = -g -O -Itwtch -I/usr/5include   # For gcc
#CCOPT = -O -Itwtch -I/usr/5include     # For cc


INCLUDES = -I/usr/openwin/include       # for standard xview
#INCLUDES = -I/usr/local/X11R6/include  # For user installed Xview

# we have to link in libc before libxview to get the right version of
# the read syscall

#LIBXVIEW = -L/usr/local/X11R6/lib/xview -L/usr/local/X11R6/lib \
#		   -L/usr/lib -lc -lxview -lolgx -lX11
# ^^^^ For User installed Xview

LIBXVIEW = -L/usr/openwin/lib -L/usr/lib -lc -lxview -lolgx -lX11 -lm 

LIB = $(LIBXVIEW) /usr/5lib/libcurses.a /usr/5lib/libtermcap.a
CFLAGS = $(CCOPT) $(INCLUDES)

CC = gcc -traditional
#CC = cc

LD = gcc
#LD = cc

MAKE = make

.c.o:
	$(CC) $(CFLAGS) -c $*.c

WATCH_SRC = main.c readpacket.c init.c sendpacket.c hash.c common.c curses.c \
	xview.c

WATCH_OBJ = main.o readpacket.o init.o sendpacket.o hash.o common.o curses.o \
	xview.o

all: ttywatcher

common.o: ses_packet.h
hash.o: ses_packet.h
main.o: ses_packet.h
xview.o: ses_packet.h
motif.o: ses_packet.h
patterns.o: ses_packet.h
readpacket.o: ses_packet.h 

ttywatcher: $(WATCH_OBJ)
	$(LD) $(LDFLAGS) $(CFLAGS) -o $@ $(WATCH_OBJ) $(LIB)

clean:
	rm -f *.o ttywatcher

install:
	chown root ttywatcher
	chmod 4755 ttywatcher
