#
# This is the makefile for the lpr utilities (lpr, lpq, lprm).
# It may be called on its own to just create and install these programs,
# or it may be called from above by the master makefile.
#

# First we include the general definitions
!include "..\..\gendefs"

# The lpr binaries and their dependancies

LPR		= lpr.exe
LPR_SRC		= lpr.c lp.c
LPR_OBJ		= lpr.obj lp.obj 

LPQ		= lpq.exe
LPQ_SRC		= lpq.c lp.c
LPQ_OBJ		= lpq.obj lp.obj

LPRM		= lprm.exe
LPRM_SRC	= lprm.c lp.c ncsaio.asm
LPRM_OBJ	= lprm.obj lp.obj

STARTUP_CODE	= c0l.obj
NEEDED_LIBS	= tcp.lib sess.lib enet.lib over.lib vjc.lib ncsa.lib cl.lib

all: $(LPR) $(LPQ) $(LPRM)

clean:
	-del *.obj
	-del *.map
	-del *.exe
	-del tlink.cfg

$(LPR): $(LPR_OBJ) tlink.cfg
	$(LINK) $(STARTUP_CODE) $(LPR_OBJ),$(LPR),,$(NEEDED_LIBS)
	copy $(LPR) $(BINDIR)\$(LPR)

$(LPQ): $(LPQ_OBJ) tlink.cfg
	$(LINK) $(STARTUP_CODE) $(LPQ_OBJ),$(LPQ),,$(NEEDED_LIBS)
	copy $(LPQ) $(BINDIR)\$(LPQ)

$(LPRM): $(LPRM_OBJ) tlink.cfg
	$(LINK) $(STARTUP_CODE) $(LPRM_OBJ),$(LPRM),,$(NEEDED_LIBS)
	copy $(LPRM) $(BINDIR)\$(LPRM)
#
# I appologize to all for such cruftiness, but I couldn't think of
# any other way of dealing with both the ^%$%*&^ 128 character
# command line limit, and the need for paths to be dynamicly changed.
# JRM - 4/27/93
#
tlink.cfg:
	echo /L$(BCCLIBS);$(LIBDIR) >tlink.cfg

.c.obj:
	$(CC) $(CCOPTS) {$< }

.asm.obj:
	$(ASM) {$(AFLAGS) $<; }
