##########################################################################
#                       BUILD ENVIRONMENT
#
#   The BORLAND C version 4.5 compiler and TASM v3.1 assembler are used to
#   build the TEST.EXE image.  The following environment variables must contain
#   the given settings for this makefile to execute properly:
#
#       PATH=<BorlandC_4.5 Path>\BIN;<TASM v3.1 path>
#       LIB=<BorlandC_4.5 Path>\LIB
#       INCLUDE=<BorlandC_4.5 Path>\INCLUDE
#
#       The following two addtional utilities are needed to build this 
#       code:
#               RAMFIX.EXE
#               NASM.EXE
#       These should be located in the path.
#
#   The sample batch file SETVENV.BAT will set the appropriate environment
#   variables for the build of this code
#   Note that the if macro OBJECTS is modified the object file list
#   in the VALTLINK.RSP must be modified to match this.
#
################################################################################

#
# Macros
#
# Use this if you want debug info in the objs
CC_DEBUG = -N -v
# Use this if you don't want debug info in the objs
# CC_DEBUG =

# Use this if you want debug info in the exe
LINK_DEBUG = -v
# Use this if you don't want debug info in the exe
#LINK_DEBUG = 

CC = bcc 
LINK = tlink 
NASM = nasm
RAMFIX = ramfix

# If this macro is modified then the list in valtlink.rsp must be
# modified as well
OBJECTS = validate.obj test.obj pci.obj 8xx_scsi.obj 8xx_tool.obj \
	  gen_tool.obj 8xx_pci.obj
.c.obj:
	$(CC) $(CC_DEBUG) -I$(INCLUDE) @valbcc.rsp $<

test.exe: $(OBJECTS)
	$(LINK) $(LINK_DEBUG) -L$(LIB) @valtlink.rsp,$<,$*,@vallib.rsp

validate.obj: valtypes.h pci.h test.h 8xx_pci.h 8xx_tool.h 8xx_scsi.h \
	      validate.h gen_tool.h

test.obj: valtypes.h gen_tool.h pci.h 8xx_pci.h 8xx_tool.h 8xx_scsi.h \
	  test.h validate.h

pci.obj: valtypes.h pci.h gen_tool.h

8xx_scsi.obj: rw_scr.h maint_scr.h valtypes.h pci.h gen_tool.h 8xx_pci.h \
	      8xx_tool.h 8xx_scsi.h

8xx_tool.obj: valtypes.h pci.h 8xx_pci.h 8xx_tool.h gen_tool.h

gen_tool.obj: valtypes.h gen_tool.h

8xx_pci.obj: valtypes.h pci.h 8xx_pci.h gen_tool.h

maint_scr.h: maint_scr.ss
	$(NASM) $** -p $< -l maint_scr.xrf -u

rw_scr.h: rw_scr.ss
	$(NASM) $** -p rw_scr.1 -l rw_scr.xrf
	$(RAMFIX) rw_scr.1 $<
	del rw_scr.1


