# Copyright (C) 1989 by Kenneth Almquist.

FILES=atty.o output.o ed.o edfuncs.o update.o dftbind.o regex.o

#CC=gcc
DEBUG=-g
CFLAGS=$(DEBUG)
LIBS=-ltermcap
#P=&	# for Sequent's parallel make

all:$P kbind atty fmatch atty.1 atty.bindc

clean:
	rm -f *.o

clobber:
	rm -f *.o atty kbind fmatch edfuncs.c dftbind.c atty.1 atty.bindc

atty:$P $(FILES)
	$(CC) -o temp $(FILES) $(LIBS)
	mv -f temp $@

kbind: kbind.o
	$(CC) -o $@ kbind.o

edfuncs.c: kbind
	./kbind -makefuncs

dftbind.c:
	echo "char dftbind[] = \"`pwd`/atty.bindc\";" > $@

atty.bindc: atty.bind kbind
	./kbind atty.bind

fmatch: fmatch.o
	$(CC) -g -o $@ fmatch.o

atty.1: atty.1.mk
	sh atty.1.mk > atty.1

atty.o: atty.h attyed.h
ed.o: attyed.h ed.h bind.h regex.h
kbind.o: bind.h
output.o: atty.h attyed.h
update.o: attyed.h ed.h
