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

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


## Uncomment the following lines if you're using xview (and comment out the
##  motif section
INCLUDES = -I/usr/openwin/include       # for standard xview
##      we have to link in libc before libxview to get the right version of
##      the read syscall
LIBXVIEW = -L/usr/openwin/lib -L/usr/lib -lc -lxview -lolgx -lX11 -lm 
TOOLKIT_SRC = xview.c
TOOLKIT_OBJ = xview.o
## End of xview specific definitions

## Uncomment the following lines if you're using Motif
# *NOTE* Motif doesn't work yet... alarms need to be added, and the rest 
# debugged. Don't uncomment these lines unless you know what you're doing!
#
#INCLUDES = -I/usr/local/X11R6/include
#LIBMOTIF = -L/usr/local/X11R6/lib -lXm -lXmu -lXt -lX11 -lSM -lICE -lm
#TOOLKIT_SRC = motif.c XmATerm.c
#TOOLKIT_OBJ = motif.o XmATerm.o
## End of Motif specific definitions

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

CC = gcc
#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 \
	$(TOOLKIT_SRC)

WATCH_OBJ = main.o readpacket.o init.o sendpacket.o hash.o common.o curses.o \
	$(TOOLKIT_OBJ)

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
