#
# This file is a user contribution and is not supported by Zinc.
#

#############################################################################
#
# "optssym.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. zafsym.mak   - The main ZAF make file unique to each compiler
# 3. optssym.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  options -----------------------------------------------------
#

#
# Compile options
#
# -c    - compile only, no link
# -I    - look for include files in the specified directory
# -Ab   - use the bool keyword
SHARED_COMPILE_OPTIONS=-c -I$(ZAF_ROOT)\include -Ab $(ADD_COMPILE_OPTS)

#
# Link options
#
# /NOI  - Case sensitive symbols
# /DE   - Delete executable if link fails
SHARED_LINK_OPTIONS=/NOI /DE $(ADD_LINK_OPTS)

#
# Library options
#
# /NOI  - Case sensitive library
# /N    - Do not create a backup
# /C    - Create library if it does not exist
# /P    - Set page size
SHARED_LIBRARY_OPTIONS=/NOI /N /C /P:32


#
# Debug options
#
# -gf   - source level debugging
# -S    - generate stack frame
DEBUG_COMPILE_OPTIONS_ON=-S -g
#
DEBUG_LINK_OPTIONS_ON=
# /P    - page size
DEBUG_LIBRARY_OPTIONS_ON=/P:512

DEBUG_COMPILE_OPTIONS_OFF=
DEBUG_LINK_OPTIONS_OFF=
DEBUG_LIBRARY_OPTIONS_OFF=

#
# ----- 16 bit DOS options --------------------------------------------------
#

D16_COMPILER=sc
D16_LINKER=link
D16_LIBRARIAN=lib

# -Ns   - Move string literals from data segment to code segment
# -ml   - Compile using large memory model
# -NV   - Far C++ virtual tables
# -GT0  - Make all data far data
# -R    - Put switch statements in code segment
# -2    - 80286 Protected Mode Instructions
D16_COMPILE_OPTIONS=$(SHARED_COMPILE_OPTIONS) -DDOSX286 -Ns -ml -NV -GT0 -R -2

D16_LINK_OPTIONS=$(SHARED_LINK_OPTIONS)

D16_LIBRARY_OPTIONS=$(SHARED_LIBRARY_OPTIONS)

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

#
# Display library definition (choose only one).
#
# MetaWindow
D16_DISPLAY_LIBRARY=zmetd16 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

D16B_LINKER=blinker
D16B_LIBRARIES=blxscp zafd16 $(D16_DISPLAY_LIBRARY) 
D16B_LINK_OPTIONS=/qm /packd /ali:64 $(D16_LINK_OPTIONS)

#
# ----- 16 bit Windows options ----------------------------------------------
#

W16_COMPILER=sc
W16_LINKER=link
W16_LIBRARIAN=lib
W16_RESOURCE_COMPILER=rcc

# -Ns   - Move string literals from data segment to code segment
# -ml   - Compile using large memory model
# -NV   - Far C++ virtual tables
# -W2   - Make the target a Windows .EXE with explicit functions exportable
# -GT0  - Make all data far data
# -R    - Put switch statements in code segment
W16_COMPILE_OPTIONS=$(SHARED_COMPILE_OPTIONS) -Ns -ml -NV -W2 -GT0 -R

W16_LINK_OPTIONS=$(SHARED_LINK_OPTIONS)

W16_LIBRARY_OPTIONS=$(SHARED_LIBRARY_OPTIONS)

W16_RESOURCE_OPTIONS=

W16_OBJECT_FILES=
W16_LIBRARIES=zafw16 libw ctl3dv2


#
# ----- 32 bit Windows options ----------------------------------------------
#

W32_COMPILER=sc
W32_LINKER=link
W32_LIBRARIAN=lib
W32_RESOURCE_COMPILER=rcc

# -WA   - Windows exe
# -mn   - NT memory model
W32_COMPILE_OPTIONS=$(SHARED_COMPILE_OPTIONS) -mn -WA

W32_LINK_OPTIONS=$(SHARED_LINK_OPTIONS)

W32_LIBRARY_OPTIONS=$(SHARED_LIBRARY_OPTIONS)

# -32   - 32 bit windows compatible res/exe files
W32_RESOURCE_OPTIONS=-32


W32_OBJECT_FILES=
W32_LIBRARIES=kernel32 user32 gdi32 comdlg32 comctl32 winspool zafw32.lib ctl3d32


#
# ----- 32 bit Windows DLL options ------------------------------------------
#

# -D    - Define the given macro
# -WD   - Make the target a Windows .DLL with explicit functions exportable
# -mn   - NT memory model
W32_DLL_EXPORT_COMPILE_OPTIONS=$(SHARED_COMPILE_OPTIONS) -mn -DZAF_DLL_EXPORT -WD



# -D    - Define the given macro
# -WA   - Make the target a Windows .EXE with explicit functions exportable
# -mn   - NT memory model
W32_DLL_IMPORT_COMPILE_OPTIONS=$(SHARED_COMPILE_OPTIONS) -mn -DZAF_DLL_IMPORT -WA

W32_DLL_LINK_OPTIONS=$(SHARED_LINK_OPTIONS) /NOI /DO /DE /E /PACKF /XN /NT /ENTRY:_DllMainCRTStartup

W32_DLL_EXPORT_OBJECT_FILES=
W32_DLL_EXPORT_LIBRARIES=kernel32.lib user32.lib gdi32.lib comctl32.lib \
	ctl3d32.lib comdlg32.lib winspool.lib

W32_DLL_IMPORT_OBJECT_FILES=
W32_DLL_IMPORT_LIBRARIES=zafw32i.lib zafw32d.lib \
	kernel32.lib user32.lib gdi32.lib comctl32.lib \
	ctl3d32.lib comdlg32.lib

