#===================================================================
#
#	zmake.mak
#
#	Makefile for CF-ZAF 
#
#	Usage:
#
#		zmake dos16    (makes cfzd16.lib, installs in ZAF library dir)
#		zmake dos32    (makes cfzd32.lib,     "    "   "     "     " )
#		zmake win16    (makes cfzw16.lib,     "    "   "     "     " )
#		zmake win32    (makes cfzw32.lib,     "    "   "     "     " )
#		zmake clean
#
#===================================================================



#
# Note: CF/ZAF users must define the INCLUDE and LIB environment
#	variables.  Here is an example:
#

# INCLUDE =		c:\zinc\cf_zaf\include;c:\zinc\include
# LIB =			c:\zinc\lib\borland;c:\tools\bc5\lib



#-------------------------------------------------------------------
#
# CF-ZAF user configuration
#
!ifndef DPC_INTERNAL
CF_CORE_SRC =	$(CF_ZAF)\src
CF_ZAF_SRC =	$(CF_ZAF)\src
!else
#
# DPC internal configuration
#
INCLUDE=..\include;..\..\core\include;c:\zinc\include
CF_CORE_SRC =	c:\cf_zaf\src
CF_ZAF_SRC =	c:\cf_zaf\src
!endif
#
#-------------------------------------------------------------------





# ----- Application-specific definitions ----------------------------

TARGET = cfz
SOURCE_FILES=\
$(CF_ZAF_SRC)\bz_zcht.cpp \
$(CF_CORE_SRC)\c0_dystr.cpp \
$(CF_CORE_SRC)\c0_dyarr.cpp \
$(CF_CORE_SRC)\c0_stack.cpp \
$(CF_ZAF_SRC)\b0_color.cpp \
$(CF_ZAF_SRC)\b0_dspla.cpp \
$(CF_ZAF_SRC)\b0_dsbmp.cpp \
$(CF_ZAF_SRC)\b0_fonts.cpp \
$(CF_CORE_SRC)\c0_dimen.cpp \
$(CF_CORE_SRC)\c0_datb.cpp \
$(CF_CORE_SRC)\c0_tatb.cpp \
$(CF_CORE_SRC)\c1_xyz.cpp \
$(CF_CORE_SRC)\c1_dgrou.cpp \
$(CF_CORE_SRC)\c1_kernl.cpp \
$(CF_CORE_SRC)\c2_kernl.cpp \
$(CF_CORE_SRC)\c1_vobj.cpp \
$(CF_CORE_SRC)\co1_poin.cpp \
$(CF_CORE_SRC)\co1_pser.cpp \
$(CF_CORE_SRC)\co1_plin.cpp \
$(CF_CORE_SRC)\co1_pgon.cpp \
$(CF_CORE_SRC)\co1_tmar.cpp \
$(CF_CORE_SRC)\co1_tlin.cpp \
$(CF_CORE_SRC)\co1_gts.cpp \
$(CF_CORE_SRC)\co1_tms.cpp \
$(CF_CORE_SRC)\co1_cbmp.cpp \
$(CF_CORE_SRC)\co2_cbmp.cpp \
$(CF_CORE_SRC)\c1_engin.cpp \
$(CF_CORE_SRC)\c1_cmodl.cpp \
$(CF_CORE_SRC)\c2_cview.cpp \
$(CF_CORE_SRC)\c4_cview.cpp \
$(CF_CORE_SRC)\ce1_pcor.cpp \
$(CF_CORE_SRC)\ce1_ccor.cpp \
$(CF_CORE_SRC)\ce2_pie.cpp \
$(CF_CORE_SRC)\ce2_pser.cpp \
$(CF_CORE_SRC)\ce2_line.cpp \
$(CF_CORE_SRC)\ce2_area.cpp \
$(CF_CORE_SRC)\ce2_bar.cpp \
$(CF_CORE_SRC)\ce2_colm.cpp \
$(CF_CORE_SRC)\ce2_stac.cpp
				


# ----- General CF/ZAF definitions ----------------------------------

DEBUG=off

!ifndef CF_ZAF
!error "CF_ZAF" not defined
!endif

!ifndef ZAF_ROOT
!error "ZAF_ROOT" not defined
!endif

!if "$(ZINC_COMPILER)" == "MICROSOFT"
LIB_DIR=microsft
!else
LIB_DIR=$(ZINC_COMPILER)
!endif



# ----- Usage -------------------------------------------------------

usage:
	@type <<

Usage:

zmake dos16      (16 bit DOS with Pharlap)
zmake dos32      (32 bit DOS with Pharlap TNT)
zmake win16      (16 bit Windows)
zmake win32      (32 bit Windows)
zmake win32dll   (32 bit Windows dll's)
<<



# ----- Target name definitions -------------------------------------

DOS16_TARGET =			$(TARGET)d16.lib
DOS16B_TARGET =			$(TARGET)d16b.lib
DOS32_TARGET =			$(TARGET)d32.lib
WIN16_TARGET =			$(TARGET)w16.lib
WIN32_TARGET =			$(TARGET)w32.lib
WINDLL_TARGET =			$(TARGET)w32.dll
VXWORKS_TARGET =		$(TARGET)vxw.a

dos16: $(DOS16_TARGET)
	copy $(DOS16_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)

dos16b: $(DOS16B_TARGET)
	copy $(DOS16B_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)

dos32: $(DOS32_TARGET)
	copy $(DOS32_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)

win16: $(WIN16_TARGET)
	copy $(WIN16_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)

win32: $(WIN32_TARGET)
	copy $(WIN32_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)

win32dll: $(WINDLL_TARGET)
	copy $(WINDLL_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)
	copy cfzw32i.lib $(ZAF_ROOT)\lib\$(LIB_DIR)

vxworks: $(VXWORKS_TARGET)
	copy $(VXWORKS_TARGET) $(ZAF_ROOT)\lib\$(LIB_DIR)


# ----- Target descriptions -----------------------------------------

TARGET =			$(DOS16_TARGET)
TARGET_TYPE =		lib
PLATFORM =			dos16
!include <zaf.mak>

TARGET =			$(DOS16B_TARGET)
TARGET_TYPE =		lib
PLATFORM =			dos16b
!include <zaf.mak>

TARGET =			$(DOS32_TARGET)
TARGET_TYPE =		lib
PLATFORM =			dos32
!include <zaf.mak>

TARGET =			$(WIN16_TARGET)
TARGET_TYPE =		lib
PLATFORM =			win16
!include <zaf.mak>

TARGET =			$(WIN32_TARGET)
TARGET_TYPE =		lib
PLATFORM =			win32
!include <zaf.mak>

TARGET =			$(WINDLL_TARGET)
TARGET_TYPE =		libdll
PLATFORM = 			win32
IMPORT_LIBRARY =	cfw32i.lib
!include <zaf.mak>

TARGET =			$(VXWORKS_TARGET)
TARGET_TYPE =		lib
PLATFORM = 			vxworks
!include <zaf.mak>

