#
# This is the makefile for the tn3270 program.
# 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 tn3270 program and its dependancies

TN3270          = tn3270.exe
TN3270_SRC      = rspc.c look.c tn3270.c newkeys.c
TN3270_OBJ      = rspc.obj look.obj tn3270.obj newkeys.obj

STARTUP_CODE    = c0l.obj
NEEDED_LIBS     = tcp sess enet over vjc vs tek ncsa cl sys_dos ctlr \
		  ascii general api

all: $(TN3270)

clean:
	-del *.obj
	-del *.map
	-del *.exe
	-del tlink.cfg
	-del libs
		    
$(TN3270): $(TN3270_OBJ) tlink.cfg
	echo $(NEEDED_LIBS) > libs
	$(LINK) $(STARTUP_CODE) $(TN3270_OBJ),$(TN3270),,@libs
	copy $(TN3270) $(BINDIR)\$(TN3270)
	copy tn3270.tbl $(BINDIR)\tn3270.tbl

#
# 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 /seg:255/nodef/stack:4096/e/f/pac >tlink.cfg
	echo /L$(BCCLIBS);$(3270LIBDIR) >tlink.cfg

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

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