# Zinc Application Framework - OPTSWAT.MAK
# COPYRIGHT (C) 1990-1999.  All Rights Reserved.
# Zinc Software Incorporated.  Pleasant Grove, Utah  USA

#############################################################################
#
# "optswat.mak" is the third in a series of three make files used to easily
# build ZAF projects from the command prompt -- it should not be invoked
# directly.  This file is also used when building the ZAF libraries.
#
# The three files used to build ZAF projects are:
# 1. makefile.mak - User supplied make file (see example below)
# 2. zafwat.mak   - The main ZAF make file unique to each compiler
# 3. optswat.mak  - Compiler options and tools shared by ZAF and apps
#
# Applications and ZAF libraries should be build with identical compiler
# options to ensure compatibility.  If changes are made to this file the
# ZAF libraries should be rebuilt prior to building applications.
#
#############################################################################

SHARED_COMPILE_OPTIONS = -e10 -zq $(DEBUG_CPP_OPTS) $(ADD_COMPILE_OPTS)
SHARED_LINK_OPTIONS = OP MAXE=10 $(DEBUG_LINK_OPTS) $(ADD_LINK_OPTS)

DEBUG_COMPILE_OPTIONS_ON= -d2
DEBUG_COMPILE_OPTIONS_OFF= -d0
DEBUG_LINK_OPTIONS_ON= d all
DEBUG_LINK_OPTIONS_OFF=
DEBUG_LIBRARY_OPTIONS_ON=
DEBUG_LIBRARY_OPTIONS_OFF=

#
# ----- DOS 16 bit (Blinker DOS extender) compiler options ------------------
#

D16_COMPILER=wpp
D16_LINKER=wlink
D16_LIBRARIAN=wlib

# -zc   - String literals in the code segment
# -zt0  - Make all data far data
# -zu   - Do not assume SS=DS
# -w1   - Warning level 1
# -ml   - Large memory model
# -2    - 286 instructions
D16_COMPILE_OPTIONS=-bt=dos /dDOSX286 -zc -zt0 -zu -w1 -ml -2 $(SHARED_COMPILE_OPTIONS)
#D16_COMPILE_OPTIONS=-bt=dos -dDOSX286 -zc -zt0 -zu -w1 -ml -2r -d0 -ei -oxtabehiklmnr -oe=32 -oi+ -ol+ -s -zp4  $(SHARED_COMPILE_OPTIONS)

#
# Display library definition (choose only one).
#
# MetaWindow
D16_DISPLAY_LIBRARY=met_xp2d met_pp2l 
D16_COMPILE_OPTIONS=$(D16_COMPILE_OPTIONS) -DZAF_METAWINDOW
# UGL
#!ifndef UGL_ROOT
#!error "UGL_ROOT" not defined
#!elifndef UGL_OS_HEADER
#!error "UGL_OS_HEADER" not defined
#!elifndef UGL_ARCH_HEADER
#!error "UGL_ARCH_HEADER" not defined
#!else
#D16_DISPLAY_LIBRARY=ugl
#D16_COMPILE_OPTIONS=$(D16_COMPILE_OPTIONS) -DZAF_UGL -DUGL_ROOT=$(UGL_ROOT) \
#-DUGL_OS_HEADER=$(UGL_OS_HEADER) -DUGL_ARCH_HEADER=$(UGL_ARCH_HEADER)
#!endif

D16_LIBRARIES=zafd16 $(D16_DISPLAY_LIBRARY)
D16_LINK_OPTIONS=$(SHARED_LINK_OPTIONS)

D16_LIBRARY_OPTIONS=$(SHARED_LIBRARY_OPTIONS)

#
# ----- 16 bit DOS options for Blinker --------------------------------------
#

D16B_LINKER=blinker
D16B_LIBRARIES=blxwcc zafd16 $(D16_DISPLAY_LIBRARY) clibl
D16B_LINK_OPTIONS=/qw bli exe ext bli exe ali 64 st 20000 packd $(D16_LINK_OPTIONS)

# ----- DOS 32 bit (DOS4GW extender) compiler options -----------------------
D32_COMPILER=wpp386
D32_C_COMPILER=wcc386
D32_LINKER=wlink
D32_LIBRARIAN=wlib
D32_BIND=4gwbind
D32_LOAD=4gwpro.exe

D32_DOS4GW_DIR=$(WATCOM)\binw

#D32_COMPILE_OPTIONS=-bt=dos -dDOS386 -4r -d0 -ei -oxtabehiklmnr -oe=32 -oi+ -ol+ -s -zp8 $(SHARED_COMPILE_OPTIONS)
D32_COMPILE_OPTIONS=-bt=dos /dDOS386 -zq
D32_LINK_OPTIONS=SYSTEM dos32a OP stack=50000 DISA 1124
D32_LIBRARY_OPTIONS=-p=64 -q

#
# Display library definition (choose only one).
#
# MetaWindow
D32_DISPLAY_LIBRARY=met_xr3l met_pb3l 
D32_COMPILE_OPTIONS=$(D32_COMPILE_OPTIONS) -DZAF_METAWINDOW
# UGL
#!ifndef UGL_ROOT
#!error "UGL_ROOT" not defined
#!elifndef UGL_OS_HEADER
#!error "UGL_OS_HEADER" not defined
#!elifndef UGL_ARCH_HEADER
#!error "UGL_ARCH_HEADER" not defined
#!else
#D32_DISPLAY_LIBRARY=ugl
#D32_COMPILE_OPTIONS=$(D32_COMPILE_OPTIONS) -DZAF_UGL -DUGL_ROOT=$(UGL_ROOT) \
#-DUGL_OS_HEADER=$(UGL_OS_HEADER) -DUGL_ARCH_HEADER=$(UGL_ARCH_HEADER)
#!endif

D32_OBJECT_FILES=
D32_LIBRARIES=zafd32 zafd32p $(D32_DISPLAY_LIBRARY)

# ----- 16 bit Windows compiler options -------------------------------------
W16_COMPILER=wpp
W16_LINKER=wlink
W16_LIBRARIAN=wlib
W16_RESOURCE_COMPILER=wrc

#W16_COMPILE_OPTIONS= -zw -zc -w1 -ml -bt=windows -zt4 -d0 -3r -ei -oxtabehiklmnr -oe=32 -oi+ -ol+ -s -zp8 $(SHARED_COMPILE_OPTIONS)
W16_COMPILE_OPTIONS= -zw -zc -w1 -ml -bt=windows -zt4 $(SHARED_COMPILE_OPTIONS)
W16_LINK_OPTIONS=SYS windows OP heapsize=16k OP stack=24k $(SHARED_LINK_OPTIONS)
W16_LIBRARY_OPTIONS=/p=64
W16_RESOURCE_OPTIONS=-bt=windows

W16_OBJECT_FILES=
W16_LIBRARIES=windows zafw16 commdlg

# ----- 32 bit Windows compiler options -------------------------------------
W32_COMPILER=wpp386
W32_LINKER=wlink
W32_LIBRARIAN=wlib
W32_RESOURCE_COMPILER=wrc

#W32_COMPILE_OPTIONS=-bt=nt -DWIN32 -mf -xr -6r -fp6 -fpi87 -d0 -ei -oxtabehiklmnr -oe=32 -oi+ -ol+ -s -zp16 $(SHARED_COMPILE_OPTIONS)
W32_COMPILE_OPTIONS=-bt=nt -DWIN32 -mf -xr $(SHARED_COMPILE_OPTIONS)
W32_LINK_OPTIONS=SYS nt_win libpath . $(SHARED_LINK_OPTIONS)
W32_LIBRARY_OPTIONS=/p=128
W32_RESOURCE_OPTIONS=-bt=nt

W32_OBJECT_FILES=
W32_LIBRARIES=nt zafw32 comctl32

# ----- 32 bit Windows DLL compiler options ---------------------------------
W32_DLL_EXPORT_COMPILE_OPTIONS=-bt=nt_dll -DWIN32 -mf -bd -DZAF_DLL_EXPORT -xr $(SHARED_COMPILE_OPTIONS)
W32_DLL_IMPORT_COMPILE_OPTIONS=-bt=nt -DWIN32 -mf -DZAF_DLL_IMPORT -xr $(SHARED_COMPILE_OPTIONS)

W32_DLL_LINK_OPTIONS=SYS nt_dll $(SHARED_LINK_OPTIONS)

W32_DLL_EXPORT_OBJECT_FILES=
W32_DLL_EXPORT_LIBRARIES=comctl32 nt kernel32 user32 gdi32 comdlg32

W32_DLL_IMPORT_OBJECT_FILES=
W32_DLL_IMPORT_LIBRARIES=nt comctl32 zafw32i kernel32 user32 zafw32d
