#  Copyright, 1988-1992, Russell Nelson, Crynwr Software
#
#   This program is free software; you can redistribute it and/or modify
#   it under the terms of the GNU General Public License as published by
#   the Free Software Foundation, version 1.
#
#   This program is distributed in the hope that it will be useful,
#   but WITHOUT ANY WARRANTY; without even the implied warranty of
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#   GNU General Public License for more details.
#
#   You should have received a copy of the GNU General Public License
#   along with this program; if not, write to the Free Software
#   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
################################################################
#
#       File : Makefile
#
#       Jan 17, 1996 - aherrera
#               Added this header.
#               Allows version number to be set in Makefile.
#               Allows IBMEIPKT driver to be built as well as the EPKTISA driver.
#               Allows enabling/disabling development debugging features.
#       Jan 23, 1996 - aherrera
#               Added CSDEBUG debug define.
#               Added LFLAG for link flags.
#               Added test: for using softice for debugging.
#       Feb 13, 1996 - aherrera
#               Bumped version to 2.34
#       Feb 27, 1996 - aherrera
#               Bumped version to 2.35
#       Mar 04, 1996 - aherrera
#               Bumped to version 2.36
#       Mar 04, 1996 - aherrera
#               Bumped to version 2.37
#               Corrected date of previous log.
#       Mar 13, 1996 - aherrera
#               Bumped to version 2.38
#       Apr 26, 1996 - aherrera
#               Bumped to version 2.50B1
#               Added a version qualifier.
#       Jun 07, 1996 - aherrera
#               Changed version to 2.50
#       30-Jul-96       aherrera
#               Changed version to 2.51 for Crystal driver.
#       17-Oct-96       aherrera
#               Changed version to 2.56 for Crystal driver.
#               Added line to pack up source.zip.
#       21-Oct-96       aherrera
#               Changed version to 2.57.
#       02-Nov-96       aherrera
#               Changed version to 2.58.

################################################################
#
# Values to change for each driver
#
# DNAME is the base name of the driver without extension and the 
#       value used for adding conditional code in the driver itself 
#       for a particular implementation.
#
# MAJOR, MINOR : A version number is assumed to be of the form 1.32 
#       where the 1 is the major number and the 32 is the minor 
#       version number. Set the MAJOR number and MINOR number and 
#       those values to be passed to the driver on the assembler 
#       command line.
#
 
# For IBM Etherjet
#DNAME=IBMEIPKT
#MAJOR=2
#MINOR=50

# For Crystal Semiconductor Drivers
DNAME=EPKTISA
MAJOR=2
MINOR=58

# qualifier such as a Beta tag or string B1 or D1, etc.
QUAL=

ASM=tasm
LINK=tlink
INC=epktisa.inc messages.inc options.inc \
	defs.asm getea.asm timeout.asm \
	printnum.asm decout.asm digout.asm crlf.asm chrout.asm \
	verifypi.asm getnum.asm getdig.asm skipblk.asm \
	printea.asm getenv.asm pkterr.asm \
	Makefile
VERFLAGS=/dmajver=$(MAJOR) /dminver=$(MINOR) /dqual=$(QUAL)
#DEBUG=/Zi /dCSDEBUG
#DEBUGCMD=d:\bin\s-ice\msym $(DNAME)
AFLAGS=$(VERFLAGS) /d$(DNAME) $(DEBUG)
LFLAGS=/t /m
TARGET=$(DNAME).COM

.asm.obj:
	$(ASM) $(AFLAGS) $* ;
	

$(TARGET): head.obj tcom.obj \
			epktisar.obj epktisal.obj tail.obj \
			Makefile 
	$(LINK) $(LFLAGS) head+tcom+epktisar+epktisal+tail,$(TARGET);
	dir $(TARGET)
	grep -i bios_signature $(DNAME).map
	$(DEBUGCMD)

epktisar.obj: epktisar.asm defs.asm $(INC)
	$(ASM) $(AFLAGS) epktisar /w+;

epktisal.obj: epktisal.asm defs.asm $(INC)
	$(ASM) $(AFLAGS) epktisal /w+;
	
head.obj:       head.asm $(INC)
tcom.obj:       tcom.asm $(INC)
tail.obj:       tail.asm $(INC)

clean:
	del *.obj
	del *.map
	del *.sym

clobber: clean
	del $(TARGET)

labels:
	dolabels

packup:
	md tmp
	copy *.asm tmp
	copy *.inc tmp
	copy makefile tmp
	copy dolabels.bat tmp
	copy labels.bat tmp
	copy labels.awk tmp
	copy readme.txt tmp
	copy history.txt tmp
	cd tmp
	pkzip -a source.zip *.*
	copy source.zip ..

test:
	ldr $(DNAME).sym
	ldr $(DNAME) 0x60 0x210

