#! /bin/make -f
#
# Defines:
#   NOUSLEEP	define this if your system has no usleep() function
#   TERMIO      define this if your system uses termio, not termcap
#   TCATTR      define this if your system uses tc(get|set)attr
#               instead of ioctl with termio.
#   USEGETPTY   define this if you system has _getpty()
#   NODTABLE    define this if your system lacks the getdtablesize
#               call
#   NOCONFIG    define this if you're ignoring the autoconfiguration
#   NOPUTENV    define this if your system has no putenv() call.
#   USESETSID   define this if your system has (or needs) setsid().
#   STRUCTWAIT	define this if your system uses "union wait" for
#		wait3()
#   STRING      #include string.h instead of strings.h
#   SYSSELECT   #include <sys/select.h>
#   SYSV        define this for SysV systems (not complete)
#   BSDI        define this for BSDI (not complete)
#
#
# Uncomment this for HP/UX
# 
#CFLAGS =	-DNOCONFIG -DTERMIO -DTCATTR -DNOUSLEEP -DNODTABLE -DUSESETSID
#
#   Use this for Ultrix MIPS
#
#CFLAGS =	-DNOCONFIG -DNOUSLEEP
#
# uncomment this for sgi 
#
#CFLAGS =	-DNOCONFIG -cckr -DTERMIO -DNOUSLEEP -DTCATTR -DUSEGETPTY -DUSESETSID
#
# uncomment the following lines for AIX
#
#CC = 		bsdcc
#CFLAGS = 	-lbsd -DSTRUCTWAIT
#
# uncomment the following lines for Next (3.0)
#CFLAGS =	-DSTRUCTWAIT
#
# the default.. recomment this if you're using something else
# otherwise it will nullify the lines above.
#
CFLAGS =  

# What c compiler to use (recomment this for AIX)
CC =		cc

SOURCES =       main.c openpty.c protocol.c tty.c windows.c lists.c \
usleep.c
OBJECTS =       main.o openpty.o protocol.o tty.o windows.o lists.o \
usleep.o

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

all:    clean config auw 

auw:	project_protos.h $(OBJECTS)
	$(CC) -s $(CFLAGS) -o auw $(OBJECTS)


project_protos.h:	$(SOURCES)
	`sed -n -e "/^proto/ p" *.c > project_protos.h`

clean:
	-rm $(OBJECTS) project_protos.h 

config:
	csh -f ./configure

tar:
	-rm amuw.tar
	tar cf amuw.tar *.[ch] makefile configure README_FIRST

lha:
	-rm uwsrc.lzh	
	lha a uwsrc.lzh *.[ch] makefile configure README_FIRST
