#sccs	"@(#)termlib:Makefile	1.3"

include $(MAKEINC)/Makepre.h

CFLAGS=	-O -DCM_N -DCM_GT -DCM_B -DCM_D
DEPENDLIST=termcap.c tgoto.c tputs.c tc1.c tc2.c tc3.c

all: Makeincludes termcap.a

Makeincludes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes
	$(MAKE)

includes: $(DEPENDLIST)
	$(INCCMD) $(DEPENDLIST) | $(SORT) | $(FILTER) > Makeincludes

termcap.a: termcap.o tgoto.o tputs.o
	ar cr termcap.a `lorder termcap.o tgoto.o tputs.o | tsort`
	rm -f libtermcap.a libtermlib.a
	-ln termcap.a libtermcap.a; ln termcap.a libtermlib.a

clean:
	rm -f *.o

clobber: clean
	rm -f termcap.a libtermcap.a libtermlib.a

# this lib needs to be installed to both / and $ROOT
install:
	$(INSTALL) -i$(EXITFLAG) libtermcap.a $(INSDIR) $(PROTOFILE)
	ls libtermcap.a libtermlib.a | cpio -pumv /usr/lib

populate:
	getunit

include Makeincludes
include $(MAKEINC)/Makepost.h
