#############################################################################
#
#                   Copyright (C) 1996 SciTech Software
#                           All rights reserved.
#
# Descripton:   Generic makefile for the MGL version of Mesa.
#
# $Date:   09 Jul 1997 19:48:22  $ $Author:   KendallB  $
#
#############################################################################

# DOS extender dependant flags

CFLAGS          += $(DX_CFLAGS) -DNO_GL_MACROS -DPC_HEADER
ASFLAGS         += $(DX_ASFLAGS)

# Name of library and object files required to build it

.IF $(BUILD_DLL)
DLLFILE         = mesagl$D
LIBFILE         = mesagl$L
.ELSE
.IF $(STKCALL)
LIBFILE         = smesagl$L
.ELSE
LIBFILE         = mesagl$L
.ENDIF
.ENDIF
LIBCLEAN        = mesagl.lib mesagl.a smesagl.lib

CORE_OBJS   = accum$O alpha$O alphabuf$O api1$O api2$O attrib$O bitmap$O \
              blend$O clip$O colortab$O context$O copypix$O depth$O \
              dlist$O drawpix$O enable$O eval$O feedback$O fog$O \
              get$O hash$O image$O light$O lines$O logic$O masking$O matrix$O \
              misc$O mmath$O pb$O pixel$O points$O pointers$O polygon$O \
              quads$O rastpos$O readpix$O rect$O scissor$O shade$O span$O \
              stencil$O teximage$O texobj$O texstate$O texture$O triangle$O \
              varray$O winpos$O vb$O vbfill$O vbrender$O vbxform$O xform$O \
              mthreads$O

DRIVER_OBJS = mmesa8$O mmesa16$O mmesa24$O mmesa32$O halftone$O mglmesa$O

ASM_OBJS    =

OBJECTS     = $(CORE_OBJS) $(DRIVER_OBJS) $(ASM_OBJS)

# Tell dmake where to find source files

.SOURCE: mgl

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

DEPEND_OBJ      = $(OBJECTS)
DEPEND_SRC      = mgl

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

# Target to build all DOS 32-bit libraries

.SWAP .PHONY mkdos32:
	@+build wc10-d32 install -u OPT=1 NO_PCH=1
	@+build wc11-d32 install -u OPT=1 NO_PCH=1
	@+build bc45-d32 install -u OPT=1
	@+build dj20-d32 install -u OPT=1

# Target to build all DOS libraries

.PHONY mkdos: mkdos32 cleanexe

# Target to build Windows 32-bit DLL's

.SWAP .PHONY mkdll32:
    @+build bc50-w32 install -u BUILD_DLL=1 OPT=1

# Target to build all Windows libraries

.PHONY mkwin: mkdll32 cleanexe

# Target to build all libraries

.PHONY mkall: mkdos32 mkdll32 cleanexe

