
# OS_FLAGS vary according to your operating system.  See INSTALL for details

# Linux 2.4
OS_CFLAGS=-DNEED_PTY_H                       
# FreeBSD, version unknown
#OS_CFLAGS=-DNEED_LIBUTIL_H                  

# -lutil has forkpty() in it in Linux 2.4, and apparently at least
# doesn't break anything in FreeBSD
OS_LOADLIBES=-lutil

INSTALL_DIR=/usr/local/bin

# You probably don't need to edit anything below this line

CFLAGS=-g $(OS_CFLAGS)
LOADLIBES=$(OS_LOADLIBES)

all: detachtty attachtty
clean: 
	-rm *.o *~ attachtty detachtty

install: all
	install detachtty attachtty $(DESTDIR)$(INSTALL_DIR)

deb:
	rm -rf /usr/local/src/Packages/detachtty/ 
	CVSROOT=`cat CVS/Root` cvs-buildpackage -F -uc -us -rfakeroot
	lintian /usr/local/src/Packages/detachtty/detachtty*.changes

detachtty: detachtty.o copy-stream.o errors.o
attachtty: attachtty.o copy-stream.o errors.o
