#----------------------------------------------------------------------------
#       Borland Makefile
#
# This file was automatically generated by MPC.  Any changes made directly to
# this file will be lost the next time it is generated.
#
#----------------------------------------------------------------------------
<%marker(top)%>
<%foreach(configurations)%>
!ifdef <%normalize(uc(configuration))%>
OCFLAGS32    = <%if(optimize)%>-O1<%else%><%if(debug_prj)%>-v -y -Od -vi- -k<%foreach(debug_macros)%> -D<%debug_macro%><%endfor%><%endif%><%endif%><%foreach(defines)%> -D<%define%><%endfor%>
OCFLAGS64    = <%if(optimize)%>-O2<%else%><%if(debug_prj)%>-O3 <%foreach(debug_macros)%> -D<%debug_macro%><%endfor%><%endif%><%endif%><%foreach(defines)%> -D<%define%><%endfor%>
CFG_DIR      = <%intermediate_dir%>\\
LIBMODIFIER  = <%if(use_lib_modifier)%><%lib_modifier%><%endif%>
EXEMODIFIER  = <%if(use_exe_modifier)%><%lib_modifier%><%endif%>
<%if(type_is_static)%>
STATIC_CFG   = 1
<%endif%>
<%if(type_is_static || need_staticflags)%>
<%if(staticflags)%>
STATIC_FLAGS =<%foreach(staticflags)%> -D<%staticflag%><%endfor%>
<%endif%>
<%else%>
<%if(dynamicflags)%>
DYN_FLAGS    =<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%>
<%endif%>
<%endif%>
<%if(postlinkrmext)%>
POSTLINKRM   = <%postlinkrmext%>
<%endif%>
<%if(exename)%>
EXEOUTPUTDIR = <%if(exeout)%><%exeout%><%if(windows_style)%>\<%output_dir("Debug")%><%endif%><%else%><%if(windows_style)%><%output_dir("Debug")%><%else%><%output_dir(".")%><%endif%><%endif%>\\
<%endif%>
!else
<%endfor%>
!error You must define one of these valid configurations:<%foreach(configurations)%> <%normalize(uc(configuration))%><%endfor%>
<%foreach(configurations)%>
!endif
<%endfor%>

!ifdef UNICODE
UC_CFLAGS    = <%unicode_flags%>
UNICODE_DIR  = Unicode\\
UC_MAIN      = w
ULIBMODIFIER = <%unicode_lib_modifier%>
UEXEMODIFIER = <%unicode_lib_modifier%>
!endif

!ifdef CODEGUARD
CG_CFLAGS = -vG
CG_LIB    = cg32.lib
!endif

<%if(build64bit)%>
OBJ_EXT      = <%obj64_ext%>
<%else%>
OBJ_EXT      = <%obj32_ext%>
<%endif%>

<%if(use_vcl)%>
STARTUP_LETTER = <%if(exename)%>w<%else%><%startup_letter%><%endif%>
<%else%>
VCL_CFLAGS     = -D_NO_VCL
STARTUP_LETTER = <%startup_letter%>
<%endif%>
<%if(build64bit)%>
STARTUP_BITS   = 64
<%else%>
STARTUP_BITS   = 32
<%endif%>
STARTUP_OBJ    = c0$(STARTUP_LETTER)$(STARTUP_BITS)$(UC_MAIN)$(OBJ_EXT)

DLL_EXT      = <%dll_ext%>
<%if(build64bit)%>
LIB_EXT      = <%lib64_ext%>
<%else%>
LIB_EXT      = <%lib32_ext%>
<%endif%>
EXE_EXT      = <%exe_ext%>
CC32         = <%cc32%>
RC32         = <%rc32%>
LINK32       = <%link32%>
CC64         = <%cc64%>
RC64         = <%rc64%>
LINK64       = <%link64%>
TLIB         = <%tlib%>
THREADFLAGS  = <%thflags%>
DLLFLAGS     = <%dllflags%>
LIBFLAGS     = <%libflags%>
EXEFLAGS     = <%exeflags%>
WARNFLAGS32  = <%warnflags32%>
WARNFLAGS64  = <%warnflags64%>
CCFLAGS      = <%ccflags%><%if(type_is_binary)%> <%binary_compile_flags("-tWR -tWD")%><%endif%><%if(compile_flags)%> <%compile_flags%><%endif%>

INTERMEDIATE = $(CFG_DIR)$(UNICODE_DIR)<%noextension(project_name)%>
<%if(exename)%>
NAME         = <%exename%>$(EXEMODIFIER)
<%else%>
<%if(sharedname)%>
NAME         = <%libname_prefix%><%sharedname%>$(LIBMODIFIER)$(ULIBMODIFIER)
<%else%>
<%if(staticname)%>
NAME         = <%libname_prefix%><%staticname%>$(LIBMODIFIER)$(ULIBMODIFIER)
<%endif%>
<%endif%>
<%endif%>
CPPDIR       = <%cppdir%>
RESDIR       = <%rcdir%>
<%if(exename || sharedname || staticname)%>

OBJFILES = \
<%foreach(source_files)%>
           "$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)"<%fornotlast(" \\")%>
<%endfor%>
<%endif%>
<%if(libpaths)%>

LFLAGS   = \
<%if(build64bit)%>
           -L"$(BDS)\lib\win64\release" -L"$(BDS)\lib\win64\debug" \
<%else%>
           -L"$(BDS)\lib\win32\release" -L"$(BDS)\lib\win32\debug" \
<%endif%>
<%if(linkflags)%>
        <%linkflags%> \
<%endif%>
<%if(StackReserveSize)%>
           /S:<%StackReserveSize%> \
<%endif%>
<%if(StackCommitSize)%>
           /Sc:<%StackCommitSize%> \
<%endif%>
<%if(!optimize)%>
           -v<%if(libpaths)%> \<%endif%>
<%endif%>
<%foreach(libpaths)%>
           -L"<%libpath%>" -j"<%libpath%>"<%fornotlast(" \\")%>
<%endfor%>
<%endif%>

LIBFILES = \
<%foreach(reverse(libs))%>
           <%libname_prefix%><%lib%>$(LIBMODIFIER)$(ULIBMODIFIER)$(LIB_EXT) \
<%endfor%>
<%foreach(reverse(lit_libs))%>
           <%lit_lib%>$(LIB_EXT) \
<%endfor%>
<%foreach(reverse(pure_libs))%>
           <%pure_lib%> \
<%endfor%>
<%if(build64bit)%>
           <%common_libs%> <%common64_libs%>
<%else%>
           $(CG_LIB) <%common_libs%> <%common32_libs%>
<%endif%>

<%if(resource_files)%>

!ifndef STATIC_CFG
RESOURCE = \
<%foreach(resource_files)%>
           $(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res<%fornotlast(" \\")%>
<%endfor%>
<%if(includes)%>

RC_FLAGS = \
<%foreach(includes)%>
        -i"<%include%>"<%fornotlast(" \\")%>
<%endfor%>
<%endif%>
!endif
<%endif%>
<%if(!build64bit)%>
<%if(pch_header)%>

# Borland precompiled headers can choke on some header files.
# Set NO_USE_PCH if you do not want to use precompiled headers.
!ifndef NO_USE_PCH
PCH_CFLAGS = \
<%foreach(pch_defines)%>
             -D<%pch_define%> \
<%endfor%>
             -H=$(INTERMEDIATE)\<%noextension(project_name)%>.csm -Hh=<%pch_header%>
!endif
<%endif%>
<%endif%>

CFLAGS = \
<%foreach(cflags)%>
         <%cflag%> \
<%endfor%>
<%if(build64bit)%>
<%foreach(common64_flags)%>
         <%common64_flag%> \
<%endfor%>
<%else%>
<%foreach(common32_flags)%>
         <%common32_flag%> \
<%endfor%>
<%endif%>
<%foreach(macros common_defines)%>
         -D<%macro%> \
<%endfor%>
<%foreach(includes)%>
         -I"<%include%>" \
<%endfor%>
         $(PCH_CFLAGS) \
         $(VCL_CFLAGS)

<%marker(macros)%>
<%if(exename)%>
OUTPUTDIR = $(EXEOUTPUTDIR)
all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(EXE_EXT)<%if(postbuild)%> __postbuild__<%endif%>

$(OUTPUTDIR)$(NAME)$(EXE_EXT): $(OBJFILES) $(RESOURCE)
  @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
<%if(prelink)%>
  <%eval(prelink)%>
<%endif%>
<%if(build64bit)%>
  $(LINK64) @&&!
<%else%>
  $(LINK32) @&&!
<%endif%>
  $(EXEFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(EXE_EXT),, $(LIBFILES),, $(RESOURCE)
!

<%endif%>
<%if(sharedname)%>
!ifndef STATIC_CFG
OUTPUTDIR = <%if(dllout)%><%dllout%><%else%><%libout%><%endif%>\\
all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(DLL_EXT)<%if(postbuild)%> __postbuild__<%endif%>

$(OUTPUTDIR)$(NAME)$(DLL_EXT): $(OBJFILES) $(RESOURCE)
  @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
<%if(prelink)%>
  <%eval(prelink)%>
<%endif%>
<%if(build64bit)%>
  $(LINK64) @&&!
<%else%>
  $(LINK32) @&&!
<%endif%>
  $(DLLFLAGS) $(LFLAGS) $(STARTUP_OBJ) $(OBJFILES), $(OUTPUTDIR)$(NAME)$(DLL_EXT),, $(LIBFILES),, $(RESOURCE)
!
!endif

<%endif%>
<%if(staticname)%>
!ifdef STATIC_CFG
OUTPUTDIR = <%libout%>\\
all:<%if(prebuild)%> __prebuild__<%endif%> $(OUTPUTDIR)$(NAME)$(LIB_EXT)<%if(postbuild)%> __postbuild__<%endif%>

$(OUTPUTDIR)$(NAME)$(LIB_EXT): $(OBJFILES)
  @if not exist "$(OUTPUTDIR)" mkdir "$(OUTPUTDIR)"
  $(TLIB) $(LIBFLAGS) $(OUTPUTDIR)$(NAME)$(LIB_EXT) @&&!
+ $(**: = &^
+ )
!
!endif

<%endif%>
<%if(!exename && !sharedname && !staticname)%>
all:<%if(prebuild)%> __prebuild__<%endif%><%if(postbuild)%> __postbuild__<%endif%>
  @-rem

<%endif%>
<%if(custom_types)%>
GENERATED_DIRTY =<%foreach(custom_types)%><%foreach(custom_type->input_files)%><%if(custom_type->input_file->output_files)%><%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%><%endif%><%endfor%><%endfor%>
<%foreach(custom_types)%>
<%if(custom_type->libpath)%>
PATH = $(PATH);<%custom_type->libpath%>
<%endif%>
<%foreach(custom_type->input_files)%>
<%if(custom_type->input_file->output_files)%>
<%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(" ")%><%endfor%>: <%custom_type->input_file%><%if(custom_type->input_file->dependencies)%> <%custom_type->input_file->dependencies%><%endif%>
<%if(flag_overrides(custom_type->input_file, gendir))%>
        @if not exist "<%flag_overrides(custom_type->input_file, gendir)%>" mkdir "<%flag_overrides(custom_type->input_file, gendir)%>"
<%endif%>
  <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%if(custom_type->output_option)%><%custom_type->input_file%> <%custom_type->output_option%> $@<%else%><%custom_type->input_file%><%endif%>
<%if(flag_overrides(custom_type->input_file, postcommand))%>
<%foreach(custom_type->input_file)%>
  <%flag_overrides(custom_type->input_file, postcommand)%>
<%endfor%>
<%else%>
<%if(custom_type->postcommand)%>
<%foreach(custom_type->input_file)%>
  <%custom_type->postcommand%>
<%endfor%>
<%endif%>
<%endif%>
<%if(pch_header)%>
<%if(custom_type->pch_postrule)%>
<%foreach(custom_type->input_file->source_output_files)%>
  @echo \#include "<%pch_header%>" > temporary.src
  @type <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> >> temporary.src
  @move /y temporary.src <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>
<%endfor%>
<%endif%>
<%endif%>

<%endif%>
<%endfor%>
<%endfor%>
<%if(exename || sharedname || staticname)%>
<%if(source_files)%>
$(OBJFILES): $(GENERATED_DIRTY)
<%else%>
all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
<%endif%>
<%else%>
all:<%if(prebuild)%> __prebuild__<%endif%> $(GENERATED_DIRTY)<%if(postbuild)%> __postbuild__<%endif%>
<%endif%>

<%endif%>
generated: $(GENERATED_DIRTY)
  @-rem

.path$(OBJ_EXT) = $(INTERMEDIATE)

.path.cpp = $(CPPDIR)
.cpp$(OBJ_EXT):
  @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
<%if(build64bit)%>
        $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
<%else%>
        $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
<%endif%>

.path.cxx = $(CPPDIR)
.cxx$(OBJ_EXT):
  @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
<%if(build64bit)%>
        $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
<%else%>
        $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
<%endif%>

.path.cc = $(CPPDIR)
.cc$(OBJ_EXT):
  @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
<%if(build64bit)%>
        $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
<%else%>
        $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
<%endif%>

.path.C = $(CPPDIR)
.C$(OBJ_EXT):
  @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
<%if(build64bit)%>
        $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
<%else%>
        $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
<%endif%>

.path.c = $(CPPDIR)
.c$(OBJ_EXT):
  @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
<%if(build64bit)%>
        $(CC64) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) $<
<%else%>
        $(CC32) $(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) $<
<%endif%>

<%foreach(source_files)%>
<%if(transdir(source_file) || flag_overrides(source_file, buildflags))%>
"$(INTERMEDIATE)\<%transdir(source_file)%><%basenoextension(source_file)%>$(OBJ_EXT)":
  @if not exist "$(INTERMEDIATE)\<%transdir(source_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(source_file)%>"
<%if(build64bit)%>
  $(CC64) <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS64) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS64) -c -o $(@D)\$(@F) <%source_file%>
<%else%>
  $(CC32) <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(DYN_FLAGS) $(STATIC_FLAGS) $(OCFLAGS32) $(CG_CFLAGS) $(UC_CFLAGS) $(THREADFLAGS) $(CCFLAGS) $(CFLAGS) $(WARNFLAGS32) -c -n$(@D) <%source_file%>
<%endif%>

<%endif%>
<%endfor%>
<%if(resource_files)%>
!ifndef STATIC_CFG
.path.res = $(INTERMEDIATE)

.path.rc = $(RESDIR)
.rc.res:
  @if not exist "$(INTERMEDIATE)" mkdir "$(INTERMEDIATE)"
        $(RC32) $(RC_FLAGS) -fo$@ $<

<%foreach(resource_files)%>
<%if(transdir(resource_file))%>
"$(INTERMEDIATE)\<%transdir(resource_file)%><%basenoextension(resource_file)%>.res":
  @if not exist "$(INTERMEDIATE)\<%transdir(resource_file)%>" mkdir "$(INTERMEDIATE)\<%transdir(resource_file)%>"
  $(RC32) -fo$@ <%resource_file%>

<%endif%>
<%endfor%>
!endif

<%endif%>
clean:
        @if exist "$(INTERMEDIATE)" rmdir /s/q $(INTERMEDIATE)

realclean: clean
<%foreach(custom_types)%>
<%foreach(custom_type->input_files)%>
<%if(custom_type->input_file->output_files)%>
<%foreach(custom_type->input_file->output_files)%>
<%if(flag_overrides(custom_type->input_file, gendir))%>
        @del "<%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%>" 2>NUL
<%else%>
        @del "<%custom_type->input_file->output_file%>" 2>NUL
<%endif%>
<%endfor%>
<%endif%>
<%endfor%>
<%endfor%>
<%if(exename)%>
        @del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" del "$(OUTPUTDIR)$(NAME)$(EXE_EXT)" 2>NUL
<%else%>
<%if(sharedname)%>
        @del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" del "$(OUTPUTDIR)$(NAME)$(DLL_EXT)" 2>NUL
<%endif%>
<%if(staticname)%>
        @del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" del "$(OUTPUTDIR)$(NAME)$(LIB_EXT)" 2>NUL
<%endif%>
<%endif%>
<%if(exename || sharedname || staticname)%>
        @del "$(OUTPUTDIR)$(NAME)$(POSTLINKRM)" 2>NUL
<%endif%>
<%if(postclean)%>
  -<%eval(postclean)%>
<%endif%>

<%if(prebuild)%>
__prebuild__:
  @<%eval(prebuild)%>

<%endif%>
<%if(postbuild)%>
__postbuild__:
  @<%eval(postbuild)%>

<%endif%>
<%marker(local)%>
<%marker(bottom)%>
