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_subwi.o idlok.o \
	initscr.o insch.o insertln.o longname.o move.o mvprintw.o \
	mvscanw.o mvwin.o newwin.o overlay.o overwrit.o printw.o \
	putchar.o refresh.o scanw.o scroll.o standout.o touchola.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 ident.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)

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

tests: $(TESTS)

ttcp$(ST).ttp: testtcp.c
	$(CC) $(CFLAGS) -o $@ $^ -l$(CURSES)

twinkl$(ST).ttp: twinkle.c
	$(CC) $(CFLAGS) -o $@ $^ -l$(CURSES)

worms$(ST).ttp: worms.c
	$(CC) $(CFLAGS) -o $@ $^ -l$(CURSES)

.PHONY: install clean realclean tests all top
