CURSEOBJ = addbytes.o addch.o addstr.o box.o clear.o clrtobot.o clrtoeol.o \
	cr_put.o cr_tty.o curses.o delch.o deleteln.o delwin.o endwin.o \
	erase.o fullname.o getch.o getstr.o id_subwin.o idlok.o \
	initscr.o insch.o insertln.o longname.o move.o mvprintw.o \
	mvscanw.o mvwin.o newwin.o overlay.o overwrite.o printw.o \
	putchar.o refresh.o scanw.o scroll.o standout.o toucholap.o \
	touchwin.o tstp.o unctrl.o

TERMOBJ =	tgetent.o tgetflag.o tgetnum.o tgetstr.o tgoto.o \
		tputs.o fgetlr.o

OTHER = xconsole.o

all: $(ALL)

$(CURSES) : $(CURSEOBJ) $(TERMOBJ) $(OTHER)
	rm -f $@
	$(AR) rs $@ $^

$(TERMCAP): $(TERMOBJ) $(OTHER)
	rm -f $@
	$(AR) rs $@ $^

install: $(ALL)
	cp $(ALL) $(LIB)
	cp curses.h $(INC)
	cp termcap.h $(INC)

clean :
	rm -f $(CURSEOBJ) $(TERMOBJ) $(OTHER) $(TESTS)

realclean : clean
	rm -f $(ALL) report core

tests: $(TESTS)

testtcp.ttp: testtcp.o
	$(CC) $(MODEL) -o testtcp.ttp testtcp.o -l$(CURSES)

twinkle.ttp: twinkle.o
	$(CC) $(MODEL) -o twinkle.ttp twinkle.o -l$(CURSES)

worms.ttp: worms.o
	$(CC) $(MODEL) -o worms.ttp worms.o -l$(CURSES)

.PHONY: install clean realclean tests all
