#############################################################################
#
#               Copyright (C) 1991-1997 SciTech Software, Inc.
#                            All rights reserved.
#
# Descripton:   Generic makefile for the gm library. Requires the
#               SciTech Software makefile definitions package to be
#               installed.
#
# $Date:   05 Oct 1997 15:58:42  $ $Author:   KendallB  $
#
#############################################################################

# DOS extender dependant flags

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

# In order to avoid pulling in all the OpenGL libraries under DOS,
# we require USE_OPENGL to be enabled in order to build the Game
# Framework libraries with OpenGL support.

.IF $(USE_OPENGL)
CFLAGS          += -DUSE_OPENGL
.ENDIF

# Name of library and object files required to build it

OBJECTS         = gm$O getopt$O rlebmp$O dlist$O sprmgr$O  \
				  sprbmp$O sprite$O mglrgn$O

.IF $(BUILD_DLL)
DLLFILE         = mglgm$D
LIBFILE         = mglgm$L
EXELIBS         = mglfxi$L

.ELSE
.IF $(STKCALL)
LIBFILE         = sgm$L
.ELSE
LIBFILE         = gm$L
.ENDIF
OBJECTS         += winmain$O

.ENDIF
LIBCLEAN        = mglgm.lib gm.lib gm.a sgm.lib

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

DEPEND_OBJ      = $(OBJECTS)

.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 all win 32-bit libraries

.SWAP .PHONY mkwin32:
    @+build bc50-w32 BUILD_DLL=1 OPT=1
    @+build wc10-w32 install -u OPT=1 NO_PCH=1
	@+build wc11-w32 install -u OPT=1 NO_PCH=1
	@+build bc45-w32 install -u OPT=1
	@+build bc50-w32 install -u OPT=1
	@+build vc40-w32 install -u OPT=1
	@+build vc50-w32 install -u OPT=1

# Target to build all Windows libraries

.PHONY mkwin: mkwin32 cleanexe

# Target to build all libraries

.PHONY mkall: mkdos mkwin

