# @(#) $Revision: 76.1 $
# $Source: /hpux/shared/supp//usr/src/cmd/shl/./makefile,v $
#
# Common makefile for shl (and vt for s300)
#

PTYLIBFILES = ptyrequest.o ptyerrlst.o readline.o sigbl.o

PTYLIBFILES_C = ptyrequest.c ptyerrlst.c readline.c sigbl.c

VTLIBFILES =  vtrequest.o setuplan.o getaddress.o getnodenam.o \
	      setndelay.o doio.o vtproto.o setaddress.o vtcommand.o \
	      vtexit.o vtdata.o ftdoio.o hpux_rel.o sigbl.o

VTLIBFILES_C =  vtrequest.c setuplan.c getaddress.c getnodenam.c \
	      setndelay.c doio.c vtproto.c setaddress.c vtcommand.c \
	      vtexit.c vtdata.c ftdoio.c hpux_rel.c sigbl.c

default: shlfiles vtfiles

metrics: shlfiles_M vtfiles_M

shlfiles: shl

shlfiles_M: shl.M

vtfiles: libptyreq.a vt vtserver vtdaemon vtgateway ptydaemon

vtfiles_M: vt.M vtserver.M vtdaemon.M vtgateway.M ptydaemon.M

libptyreq.a: $(PTYLIBFILES)
	@rm -f $@
	ar qc $@ $(PTYLIBFILES)

libvtreq.a: $(VTLIBFILES)
	@rm -f $@
	ar qc $@ $(VTLIBFILES)

vt: hpux_rel.o vt.o libptyreq.a libvtreq.a
	cc $(LDFLAGS) -o $@ hpux_rel.o vt.o libptyreq.a libvtreq.a -lsec

vtdaemon: hpux_rel.o vtdaemon.o libptyreq.a libvtreq.a
	cc $(LDFLAGS) -o $@ hpux_rel.o vtdaemon.o libptyreq.a libvtreq.a

vtserver: hpux_rel.o vtserver.o libptyreq.a libvtreq.a
	cc $(LDFLAGS) -o $@ hpux_rel.o vtserver.o libptyreq.a libvtreq.a -lsec

vtgateway: hpux_rel.o vtgateway.o libptyreq.a libvtreq.a
	cc $(LDFLAGS) -o $@ hpux_rel.o vtgateway.o libptyreq.a libvtreq.a

ptydaemon: hpux_rel.o ptydaemon.o libptyreq.a
	cc $(LDFLAGS) -o $@ hpux_rel.o ptydaemon.o libptyreq.a -lsec

shl: shl.o libptyreq.a
	cc $(LDFLAGS) -o $@ shl.o libptyreq.a

vt.M: vt.c $(PTYLIBFILES_C) $(VTLIBFILES_C)
	$(METRICS) $(CFLAGS) -o $@ vt.c $(PTYLIBFILES_C) $(VTLIBFILES_C)

vtdaemon.M: vtdaemon.c  $(PTYLIBFILES_C) $(VTLIBFILES_C)
	$(METRICS) $(CFLAGS) -o $@ vtdaemon.c $(PTYLIBFILES_C) $(VTLIBFILES_C)

vtserver.M: vtserver.c $(PTYLIBFILES_C) $(VTLIBFILES_C)
	$(METRICS) $(CFLAGS) -o $@ vtserver.c $(PTYLIBFILES_C) $(VTLIBFILES_C)

vtgateway.M: vtgateway.c $(PTYLIBFILES_C) $(VTLIBFILES_C)
	$(METRICS) $(CFLAGS) -o $@ vtgateway.c $(PTYLIBFILES_C) $(VTLIBFILES_C)

ptydaemon.M: ptydaemon.c $(PTYLIBFILES_C)
	$(METRICS) $(CFLAGS) -o $@ ptydaemon.c $(PTYLIBFILES_C)

shl.M: shl.c $(PTYLIBFILES_C)
	$(METRICS) $(CFLAGS) -o $@ shl.c $(PTYLIBFILES_C)

clean:
	rm -f *.o

clobber: clean
	rm -f libptyreq.a libvtreq.a \
		   vt vtdaemon vtgateway vtserver vtgateway shl ptydaemon *.M
