#############################################################################
#
#                   Copyright (C) 1994 SciTech Software.
#                           All rights reserved.
#
# Descripton:   Generic makefile for the PMODE library. Builds the library
#               file and all example programs.
#
# $Id: makefile 1.1 1995/02/06 12:45:38 kjb Exp $
#
#############################################################################

# Add DOS extender dependant flags to command line

CFLAGS          += $(DX_CFLAGS)
ASFLAGS         += $(DX_ASFLAGS)

# Name of library and object files required to build it

LIBFILE         = pmode$L
OBJECTS         = pmlite$O _pmlite$O

# Change destination for library file depending on extender being used

.IF $(USE_TNT)
LIB_DEST        := $(LIB_BASE)\tnt
.ELIF $(USE_DOS4GW)
LIB_DEST        := $(LIB_BASE)\dos4gw
.ELIF $(USE_X32)
LIB_DEST        := $(LIB_BASE)\x32
.ELIF $(USE_DPMI16)
LIB_DEST        := $(LIB_BASE)\dpmi16
.ELIF $(USE_DPMI32)
LIB_DEST        := $(LIB_BASE)\dpmi32
.ELIF $(USE_DOSX)
LIB_DEST        := $(LIB_BASE)\dosx
.ELIF $(USE_WIN16)
LIB_DEST        := $(LIB_BASE)\win16
.ELIF $(USE_WIN32)
LIB_DEST        := $(LIB_BASE)\win32
.END

# Names of all executable files built

EXEFILES        = memtest$E biosptr$E video$E isvesa$E callreal$E

# Extra files for the professional version

.IMPORT .IGNORE: PRO

.IF $(PRO)
OBJECTS         += pmpro$O _pmpro$O
PROEXEFILES     = mouse$E timer$E key$E break$E critical$E vesaint$E
EXEFILES        += $(PROEXEFILES)
RCSFILES        += pmpro.c _pmpro.asm
.ENDIF

all: $(EXEFILES)

pro: $(PROEXEFILES)

$(EXEFILES): $(LIBFILE)

memtest$E:  memtest$O
biosptr$E:  biosptr$O
video$E:    video$O
isvesa$E:   isvesa$O
mouse$E:    mouse$O
timer$E:    timer$O
key$E:      key$O
break$E:    break$O
critical$E: critical$O
callreal$E: callreal$O
vesaint$E: vesaint$O _vesaint$O

# Source files to check in with RCS (RCSFILES_H are in SCITECH\INCLUDE)

RCSFILES        += biosptr.c break.c callreal.c critical.c isvesa.c  \
                   key.c memtest.c mouse.c pmlite.c timer.c video.c  \
                   _pmlite.asm pmpro.c _pmpro.asm
RCSFILES_H      += pmode.h pmpro.h

# Define the list of object files to create dependency information for

DEPEND_OBJ      = $(OBJECTS) memtest$O biosptr$O video$O isvesa$O mouse$O   \
                  timer$O key$O break$O critical$O callreal$O

.INCLUDE: "$(SCITECH)\makedefs\common.mk"

