
##
## Build file for creating CDROM mini applications
##
## To build a LARGE model,	"nmake S=L M=4 [BCC=1]"
## To build a COMPACT model,	"nmake S=C M=3 [BCC=1]"
## To build a MEDIUM model,	"nmake S=M M=2 [BCC=1]"
## To build a SMALL model,	"nmake S=S M=1 [BCC=1]"
## To build a TINY model,	"nmake S=T M=0 [BCC=1]"
##
## Add BCC=1 to the line if building using Borland C++
##

## The default is to build a small model.

!ifndef S
!ifdef BCC
S= s
!else
S= S
!endif
!endif
!ifndef M
M= 1
!endif

## The following are search paths

INC  = ..\INC
GINC = ..\..\INC

LBO  =
LBB  = ..\inc

#############################################################################

## The following are command line options compiler, assembler selection

!ifdef BCC

BDIR = c:\borlandc
BLB  = $(BDIR)\lib

## tools selection

IP=%include%
MA= tasm /i. /i$(INC) /i$(GINC) /JQUIRKS /JMASM51 /JNOSMART /m2
CL= bcc  /I$(BDIR)\include /I. /I$(INC) /I$(GINC)
LK= tlink
LB= tlib
CMOD= -m$(S)!

## switches

AS= -mx
AO= -DMODELSIZE=$(M) -DBUILD_NONE=1 -v
CS= -c -Ox
CO= $(CMOD)
LS=
LO= /m /c
ONAM= -o

!else

## tools selection

MA= masm
CL= cl
LK= link
LB= lib
CMOD=-A$(S)

## switches

AS= /Mx
AO= /DMODELSIZE=$(M) /DBUILD_NONE=1
CS= /c /Od /Zpi -nologo
CO= $(CMOD)
LO= /Ma
LS=
ONAM= -Fo

!endif

#############################################################################

#
# The default is to build the command-line control apps, until it is
# decided if the "mvcd.obj" and the "outbuf.obj" modules will be
# included in the SDK.
#

DEFAULT: cdromapp

cdromapp: cdpause.exe cdstatus.exe cdstop.exe cdplay.exe cdresume.exe cdreset.exe

cdpause.obj: cdpause.c
    $(CL) $(CS) $(CO) cdpause.c

cdstatus.obj: cdstatus.c
    $(CL) $(CS) $(CO) cdstatus.c

cdstop.obj: cdstop.c
    $(CL) $(CS) $(CO) cdstop.c

cdreset.obj: cdreset.c
    $(CL) $(CS) $(CO) cdreset.c

cdplay.obj: cdplay.c
    $(CL) $(CS) $(CO) cdplay.c

cdresume.obj: cdresume.c
    $(CL) $(CS) $(CO) cdresume.c

############# These programs control the CD from the command line ############

!ifdef BCC

cdpause.exe: cdpause.obj 
    $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) cdpause.obj, cdpause,, $(LBB)\bv$(S)lib.lib+$(BLB)\c$(S).lib;

cdstatus.exe: cdstatus.obj 
    $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) cdstatus, cdstatus,, $(LBB)\bv$(S)lib.lib+$(BLB)\c$(S).lib;

cdstop.exe: cdstop.obj 
    $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) cdstop, cdstop,, $(LBB)\bv$(S)lib.lib+$(BLB)\c$(S).lib;

cdreset.exe: cdreset.obj 
    $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) cdreset, cdreset,, $(LBB)\bv$(S)lib.lib+$(BLB)\c$(S).lib;

cdplay.exe: cdplay.obj 
    $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) cdplay, cdplay,, $(LBB)\bv$(S)lib.lib+$(BLB)\c$(S).lib;

cdresume.exe: cdresume.obj 
    $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) cdresume, cdresume,, $(LBB)\bv$(S)lib.lib+$(BLB)\c$(S).lib;

!else

cdpause.exe: cdpause.obj 
    $(LK) $(LO) $(LS) cdpause.obj, cdpause,, $(LBB)\mv$(S)lib.lib;

cdstatus.exe: cdstatus.obj 
    $(LK) $(LO) $(LS) cdstatus, cdstatus,, $(LBB)\mv$(S)lib.lib ;

cdstop.exe: cdstop.obj 
    $(LK) $(LO) $(LS) cdstop, cdstop,, $(LBB)\mv$(S)lib.lib ;

cdreset.exe: cdreset.obj 
    $(LK) $(LO) $(LS) cdreset, cdreset,, $(LBB)\mv$(S)lib.lib ;

cdplay.exe: cdplay.obj 
    $(LK) $(LO) $(LS) cdplay, cdplay,, $(LBB)\mv$(S)lib.lib ;

cdresume.exe: cdresume.obj 
    $(LK) $(LO) $(LS) cdresume, cdresume,, $(LBB)\mv$(S)lib.lib ;

!endif


####
####!ifdef BCC
#### $(LK) /L$(BLB) $(LS) $(LO) $(BLB)\C0$(S) recfile recfila,recfile,,$(LBB)\bv$(S)lib+$(LBB)\bv$(S)lib+$(BLB)\c$(S).lib;
####!else
#### $(LK) $(LS) $(LO) recfile+recfila,,,$(LBB)\mv$(S)lib+$(LBB)\mv$(S)lib;
####!endif
####

