#
# Makefile for VSIMPLED.386 using VMMWRAP.LIB 2.0.
#
# Copyright (C) 1994, Woodruff Software Systems. All rights reserved.
#

#
# NOTE! This makefile defaults to use the C8 NT compiler, define
# WATCOM_C to use Watcom C/C++ 386 (see below).
#

RETAIL=TRUE

#
# Compiler and assembler selections
#

MASM6=TRUE
#WATCOM_C=TRUE


#
# Make sure LIB and INCLUDE variables are set
#

MASM=c:\tools\masm6
VXDLITE=c:\tools\vxd-lite

!ifdef WATCOM_C
CBIN=c:\tools\watcom\bin
CINC=c:\tools\watcom\h
CLIB=c:\tools\watcom\lib386
!else
CBIN=c:\tools\c8nt\bin
CINC=c:\tools\c8nt\inc
CLIB=c:\tools\c8nt\lib
!endif

!if [set INCLUDE=;]
!endif
!if [set LIB=;]
!endif

PATH    = $(MASM)\bin;$(VXDLITE)\tools;$(CBIN);$(PATH)
INCLUDE = $(VXDLITE)\inc;..\inc;$(CINC);$(INCLUDE)
LIB     = ..\lib;$(CLIB);$(LIB)

#
# Target and dependancies
#

!IFNDEF RETAIL
DEF=-DDEBUG
!ENDIF

!ifdef WATCOM_C
CC=wcc386
COPTS=-mf -s -3r -zc -zl -zq -w4 -ox
WCLCODE=-g=_LGROUP -nt=_LTEXT -nc=CODE 
WCICODE=-g=_IGROUP -nt=_ITEXT -nc=ICODE
!else
CC=cl
COPTS=-nologo -c -Zp -Gs -d2omf -bzalign -Ze -Ox
!endif

!ifdef MASM6
ASM=ml
AOPTS=-nologo -DMASM6 -c -Zm -W3 -Zd -Fo $@
!endif

.asm.obj:
        @$(ASM) $(DEF) $(AOPTS) $(@B).asm

.asm.lst:
        @$(ASM) $(DEF) $(ALST) $(AOPTS) $(@B).asm

!ifdef WATCOM_C
.c.obj:
        $(CC) $(DEF) $(COPTS) $(WCLCODE) $(@B).c
!else
.c.obj:
        $(CC) $(DEF) $(COPTS) $(@B).c
!endif


OBJS =         vsimpled.obj vsdinit.obj

#
# NOTE! Until I have found or developed a tool that cleans up
# the WATCOM 32-bit OMF .OBJs, we need to link VMMWRAP.OBJ first!  
# This is to avoid some of the problems with the OMF and LINK386
# incompatibilities and _ALSO_ guarantee that the segment attributes 
# are defined correctly.
#

!ifdef WATCOM_C
OBJS =         ..\lib\vmmwrap.obj $(OBJS)
!endif

all:           vsimpled.386

!ifdef WATCOM_C

vsdinit.obj:   vsdinit.c
               $(CC) $(DEF) $(COPTS) $(WCICODE) $(@B).c
!else
vsdinit.obj:   vsdinit.c
!endif

vsimpled.obj:  vsimpled.c

vsimpled.386:  vsimpled.def $(OBJS)
               link386 /NOD /NOP /MAP @<<
$(OBJS)
vsimpled.386
vsimpled.map
vmmwrap.lib
vsimpled.def
<<
               addhdr vsimpled.386
               mapsym32 vsimpled

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

