# ----- General -------------------------------------------------------------
DEBUG=off
FILES=makemap.cpp

# ----- Usage ---------------------------------------------------------------
usage:
	@type <<

Usage:

zmake dos16      (16 bit DOS)
zmake win16      (16 bit Windows)
zmake win32      (32 bit Windows)
zmake win32dll   (32 bit Windows dll)
<<

# ----- Clean ---------------------------------------------------------------
clean:
	z_clean

# ----- Platforms -----------------------------------------------------------
dos16: mkmap16.exe 

dos32: mkmap32.exe 

win16: wmkmap16.exe 

win32: wmkmap32.exe 

win32dll: wmkmap.exe 

# ----- Targets -------------------------------------------------------------

!if "$(ZINC_COMPILER)" == "borland"
D16_DEFINITION_FILE=b16.def
!endif

#
# Build options for mkmap16.exe
#
TARGET=mkmap16.exe
TARGET_TYPE=EXE
PLATFORM=DOS16
SOURCE_FILES=$(FILES) $(ADD_FILES) $(DOS_FILES)
ADD_LIBRARIES=zafd16p.lib
DEFINITION_FILE=$(D16_DEFINITION_FILE)
!include <zaf.mak>


#
# Build options for mkmap32.exe
#
TARGET=mkmap32.exe
TARGET_TYPE=EXE
PLATFORM=DOS32
SOURCE_FILES=$(FILES) $(ADD_FILES) $(DOS_FILES)
ADD_LIBRARIES=zafd32p.lib
DEFINITION_FILE=
!include <zaf.mak>

#
# Build options for wmkmap16.exe
#
TARGET=wmkmap16.exe
TARGET_TYPE=EXE
PLATFORM=WIN16
SOURCE_FILES=$(FILES)
ADD_LIBRARIES=zafw16p.lib
DEFINITION_FILE=wmkmap16.def
!include <zaf.mak>

#
# Build options for wmkmap32.exe
#
TARGET=wmkmap32.exe
TARGET_TYPE=EXE
PLATFORM=WIN32
SOURCE_FILES=$(FILES)
ADD_LIBRARIES=zafw32p.lib
DEFINITION_FILE=
!include <zaf.mak>

#
# Build options for wmkmap.exe
#
TARGET=wmkmap.exe
TARGET_TYPE=EXEDLL
PLATFORM=WIN32
SOURCE_FILES=$(FILES)
ADD_LIBRARIES=
DEFINITION_FILE=
!include <zaf.mak>

#
# Build options for keygen.exe
#
#!if "$(ZINC_COMPILER)" == "MICROSOFT" || "$(ZINC_COMPILER)" == "microsoft"
W32_CON_LINK_OPTIONS=$(DEBUG_LINK_OPTIONS) -subsystem:console -entry:mkmapCRTStartup
W32_CON_LIBRARIES=libc.lib kernel32.lib oldnames.lib user32.lib
KEY_FILES=mkmap.obw des.obw
keygen.exe: $(KEY_FILES)
	$(W32_LINKER) $(W32_CON_LINK_OPTIONS) -out:keygen.exe $(KEY_FILES) $(W32_CON_LIBRARIES)
#!endif
