#############################################################################
#
#                   Copyright (C) 1993 Kendall Bennett.
#                           All rights reserved.
#
# Descripton:   Makefile for the Universal VESA VBE.
#               MSDOS version for Borland C++ 3.1
#
# $Id: makefile 1.1 1993/09/19 01:32:18 kjb Exp $
#
#############################################################################

# Turn on autodependency checking

.AUTODEPEND

# Let make know where to find all the appropriate files

.PATH.asm       = .
.PATH.lib       = .
.PATH.obj       = .
.PATH.exe       = .

CC              = bcc               # Name of C compiler
ASM             = tasm              # Name of assembler
LINK            = tlink             # Name of linker
LIB             = tlib              # Name of librarian
LIB_FLAGS       = /C /E

!if $d(debug)
CC_DOPT         = -v                # Turn on debugging for C compiler
ASM_DOPT        = /ZI               # Turn on debugging for assembler
LINK_OPT        = /v /m /s          # Turn on debugging for linker, and mapfile
DEBUG           = -Ddebug
!endif

# We must assemble the test programs in the large memory model

MODEL           = l
ASM_MODEL       = /d__LARGE__

ASM_FLAGS       = /MX /m /i$(.PATH.asm) $(ASM_DOPT) $(ASM_MODEL)
CC_FLAGS        = -m$(MODEL) $(CC_DOPT)

# Implicit rules to make the object files for the test code

.c.obj:
    $(CC) $(CC_FLAGS) -c {$< }

.asm.obj:
    $(ASM) $(ASM_FLAGS) $<, $(.PATH.obj)\$&

# Object files required to build the TSR

OBJECTS         = vesavbe.obj main.obj detect.obj ports.obj getopt.obj

all: univbe.exe testvbe.exe

univbe.exe: $(OBJECTS)
    $(LINK) $(LINK_OPT) @univbe.rsp

testvbe.exe: test.c
    $(CC) $(CC_FLAGS) -DTESTING -DSTANDALONE -etestvbe.exe test.c

# Clean up directory removing all files not needed to make the library

clean:
    @del *.sym *.bak *.tdk *.map *.dsk *.obj

realclean:  clean
    @del *.exe

stamp:
    @foreach "rcs -N$(VERSION): -srelease" files.lst

rcsclean:
    @foreach rcsclean files.lst

# Check in the latest revisions of source files with RCS

ci:
    @foreach "ci -q -u $(RCSOPT)" files.lst

# Check out the latest revisions of source files from RCS

co:
    @foreach "co -q $(RCSOPT)" files.lst
