#############################################################################
#
#                   Copyright (C) 1994 SciTech Software
#                           All rights reserved.
#
# Descripton:   Generic makefile for the Quick2D transform Library. Requires
#               the SciTech Software makefile definitions package to be
#               installed.
#
#               Creates a number of different libraries depending on the
#               options used to create them with the following format:
#
#                   q2d<db>_<flt>.lib
#
#               where <db> is either empty or 'd' for the debugging versions
#               of the library compiled with DEBUG=2. You should set DEBUG=1
#               or DEBUG=2 in your own code to add the debugging stuff in
#               the header files. <flt> is the type of real numbers the
#               library is compiled for and will be one of the following:
#
#                   fix - 16.16 fixed point
#                   fl  - IEEE float's
#                   fl7 - IEEE float's for 80387+
#                   db  - IEEE double's
#                   db7 - IEEE double's for 80387+
#
#               The standard fl and db libraries use the default compiler
#               supplied floating point options, so work on all machines
#               with or without and FPU. The fl7 and db7 libraries are
#               compiled with the FPU387=1 flag and contain direct
#               co-processor support for 80387+ FPU's.
#
# $Date:   26 Jun 1996 01:33:44  $ $Author:   KendallB  $
#
#############################################################################

# DOS Extender dependant flags

CFLAGS          += $(DX_CFLAGS)

# Name of library and object files required to build it

.IMPORT .IGNORE : FX_FLOAT FX_DOUBLE FX_FIXED CHECKS

# Turn on the debugging version if desired

.IF $(CHECKS)
CFLAGS          += -DDEBUG=2
LIBSTART        = q2dd
VECSTART        = vecd
.ELSE
.IF $(STKCALL)
LIBSTART        = sq2d
VECSTART        = svec
.ELSE
LIBSTART        = q2d
VECSTART        = vec
.ENDIF
.ENDIF

# Set up the type of vectors and matrices being created if any

OBJECTS         = circle$O quick2d$O line$O polygon$O polyline$O        \
				  rectangl$O text$O

# Set up to use 80387 assembler routines if specified

.IF $(FPU)
LIBFPU          = 7
.ENDIF

.IF $(FX_DOUBLE)   # Type of real numbers to use
CFLAGS          += -DFX_DOUBLE
ASFLAGS         += -DFX_DOUBLE
LIBEND          = _db$(LIBFPU)
.ELIF $(FX_FIXED)
CFLAGS          += -DFX_FIXED -DFIXED386
LIBEND          = _fix
.ELSE
CFLAGS          += -DFX_FLOAT
ASFLAGS         += -DFX_FLOAT
LIBEND          = _fl$(LIBFPU)
.ENDIF

LIBFILE         = $(LIBSTART)$(LIBEND)$L
EXELIBS         = mgldos$L mglcpp$L ztimer$L $(VECSTART)$(LIBEND)$L
LIBCLEAN        = q2d*.lib q2d*.a sq2d*.lib

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

DEPEND_OBJ      = $(OBJECTS) test2d$O

test2d$E: test2d$O $(LIBFILE)

.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 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: mkdos32 mkwin32 cleanexe

