CC = gcc
CFLAGS = -O
SRCS = pty.c tty.c misc.c mutex.c
HDRS = pty.h tty.h misc.h mutex.h mesg.h
OBJS = pty.o tty.o misc.o mutex.o
REL_DIR = /inst/users/tow/pub


# [mx]
mutex: ${OBJS}
	${CC} ${OBJS} -o mutex

mutex.o:tty.h pty.h mutex.h mesg.h misc.h
tty.o:	tty.h
pty.o:	pty.h
misc.o: misc.h

release:mutex
	cp mutex ${REL_DIR}

mutex.tar: rm.mutex.tar
	tar -cf mutex.tar Makefile $(SRCS) $(HDRS)

DONE:
	rm -f $(SRCS) $(HDRS) $(OBJS) Makefile


# [sx]
sx: sx.o tty.o
	${CC} sx.o tty.o -o sx
sx.o: mesg.h


# [read]
read: read.c
	${CC} read.c -o read

# [send]
send: send.o tty.o misc.o mesg.h
	${CC} send.o tty.o misc.o -o send

# [fake]
fake: fake.o mesg.h misc.o tty.o
	${CC} fake.o misc.o tty.o -o fake

rm.mutex.tar:
	rm -f mutex.tar

clean:
	rm *.o

