# Makefile for Windows version of Golly using wxWidgets.
#
# Use local-win-template.mk to create local-win.mk with paths to your installed libraries.
#
# Compile wxWidgets and Golly as below:
#
# On 32-bit Windows: (from a Visual Studio command prompt)
#
#   Build wxWidgets:
#    cd \wxWidgets\build\msw
#    nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0
#   Build Golly:
#    cd \golly\src
#    nmake -f makefile-win BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0
#
# On 64-bit Windows: (from a Visual Studio 64-bit command prompt)
#
#   Build wxWidgets:
#    cd \wxWidgets\build\msw
#    nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0 TARGET_CPU=AMD64
#   Build Golly:
#    cd \golly\src
#    nmake -f makefile-win BUILD=release RUNTIME_LIBS=static UNICODE=1 DEBUG_INFO=0 DEBUG_FLAG=0 TARGET_CPU=AMD64
# 
# If you only build one wxWidgets configuration (e.g. 32-bit release) then you can edit
# \wxWidgets\build\msw\config.vc with those options. Then you can build wxWidgets and Golly
# simply with:
#
#   Build wxWidgets:
#    cd \wxWidgets\build\msw
#    nmake -f makefile.vc
#   Build Golly:
#    cd \golly\src
#    nmake -f makefile-win

#   All system-dependent changes belong in local-win.mk
!include local-win.mk

### Golly-related variables: ###

APP_VERSION = 2.7

# these directory paths are relative to the location of this makefile:
EXEDIR = ..
DOCSDIR = ..\docs
BASEDIR = ..\gollybase
CMDDIR = ..\cmdline

# for building binary and source distributions:
RELEASENAME = $(EXEDIR)\golly-$(APP_VERSION)
GUIFILES = CMakeLists.txt makefile-gtk makefile-mac makefile-win local-win-template.mk \
   golly.rc Info.plist.in wx*.h wx*.cpp
GUIDIRS = configure bitmaps icons
BINFILES = $(EXEDIR)\Golly.exe $(EXEDIR)\bgolly.exe \
   $(DOCSDIR)\ReadMe.html $(DOCSDIR)\License.html

!if "$(TARGET_CPU)" == "AMD64"
LIBDIRNAME = $(WX_DIR)\lib\vc_amd64_$(LIBTYPE_SUFFIX)$(CFG)
WX_CPU_DEF = WX_CPU_AMD64
!else
LIBDIRNAME = $(WX_DIR)\lib\vc_$(LIBTYPE_SUFFIX)$(CFG)
WX_CPU_DEF = WX_CPU_X86
!endif

SETUPHDIR = $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)

### note that /wd4100 turns off annoying warnings about "unreferenced formal parameter"
### in wx 2.9 when debugging assertions are disabled
CXXFLAGS = /M$(__RUNTIME_LIBS_8)$(__DEBUGRUNTIME_3) /DWIN32 \
	$(__DEBUGINFO_0) /Fdgolly.pdb $(____DEBUGRUNTIME_2_p) \
	$(__OPTIMIZEFLAG_4) $(__NO_VC_CRTDBG_p) /D__WXMSW__ $(__WXUNIV_DEFINE_p) \
	$(__DEBUG_DEFINE_p) $(__NDEBUG_DEFINE_p) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
	$(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) /I$(WX_DIR)\include /I$(SETUPHDIR) \
	/W4 /wd4100 /I. $(__DLLFLAG_p) /D_WINDOWS /I$(WX_DIR)\samples /DNOPCH $(__RTTIFLAG_9) \
	$(__EXCEPTIONSFLAG_10) $(CPPFLAGS) \
	/D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_WARNINGS \
	/EHsc /DVERSION=$(APP_VERSION) /DZLIB /I$(WX_DIR)\src\zlib /I$(BASEDIR)

OBJDIR = ObjWin
BASEH = $(BASEDIR)/bigint.h $(BASEDIR)/ghashbase.h $(BASEDIR)/hlifealgo.h $(BASEDIR)/jvnalgo.h \
   $(BASEDIR)/lifealgo.h $(BASEDIR)/lifepoll.h $(BASEDIR)/liferender.h $(BASEDIR)/liferules.h \
   $(BASEDIR)/platform.h $(BASEDIR)/qlifealgo.h $(BASEDIR)/readpattern.h $(BASEDIR)/util.h $(BASEDIR)/viewport.h \
   $(BASEDIR)/writepattern.h $(BASEDIR)/ruletreealgo.h $(BASEDIR)/generationsalgo.h $(BASEDIR)/ruletable_algo.h \
   $(BASEDIR)/ruleloaderalgo.h
BASEOBJ = $(OBJDIR)/bigint.obj $(OBJDIR)/lifealgo.obj $(OBJDIR)/hlifealgo.obj \
   $(OBJDIR)/hlifedraw.obj $(OBJDIR)/qlifealgo.obj $(OBJDIR)/qlifedraw.obj \
   $(OBJDIR)/jvnalgo.obj $(OBJDIR)/ruletreealgo.obj \
   $(OBJDIR)/ruletable_algo.obj $(OBJDIR)/ghashbase.obj $(OBJDIR)/ruleloaderalgo.obj \
   $(OBJDIR)/ghashdraw.obj $(OBJDIR)/readpattern.obj \
   $(OBJDIR)/writepattern.obj $(OBJDIR)/liferules.obj $(OBJDIR)/util.obj \
   $(OBJDIR)/liferender.obj $(OBJDIR)/viewport.obj $(OBJDIR)/lifepoll.obj \
   $(OBJDIR)/generationsalgo.obj
WXH = wxalgos.h wxedit.h wxgolly.h wxhelp.h wxinfo.h wxlayer.h wxmain.h \
   wxperl.h wxprefs.h wxpython.h wxrender.h wxrule.h wxscript.h wxselect.h wxstatus.h \
   wxtimeline.h wxundo.h wxutils.h wxview.h
WXOBJ = $(OBJDIR)/wxutils.obj $(OBJDIR)/wxprefs.obj $(OBJDIR)/wxalgos.obj \
   $(OBJDIR)/wxrule.obj $(OBJDIR)/wxinfo.obj $(OBJDIR)/wxhelp.obj \
   $(OBJDIR)/wxstatus.obj $(OBJDIR)/wxview.obj $(OBJDIR)/wxrender.obj \
   $(OBJDIR)/wxscript.obj $(OBJDIR)/wxperl.obj $(OBJDIR)/wxpython.obj \
   $(OBJDIR)/wxfile.obj $(OBJDIR)/wxedit.obj $(OBJDIR)/wxcontrol.obj \
   $(OBJDIR)/wxtimeline.obj $(OBJDIR)/wxundo.obj $(OBJDIR)/wxlayer.obj \
   $(OBJDIR)/wxmain.obj $(OBJDIR)/wxselect.obj $(OBJDIR)/wxgolly.obj

### Conditionally set variables: ###

PORTNAME = msw
!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default"
WXDEBUGFLAG = d
!endif
!if "$(DEBUG_FLAG)" == "1"
WXDEBUGFLAG = d
!endif
!if "$(UNICODE)" == "1"
WXUNICODEFLAG = u
!endif
!if "$(WXUNIV)" == "1"
WXUNIVNAME = univ
!endif
!if "$(SHARED)" == "1"
WXDLLFLAG = dll
!endif
!if "$(SHARED)" == "0"
LIBTYPE_SUFFIX = lib
!endif
!if "$(SHARED)" == "1"
LIBTYPE_SUFFIX = dll
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_0 = /Zi
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_0 = 
!endif
!if "$(DEBUG_INFO)" == "0"
__DEBUGINFO_0 = 
!endif
!if "$(DEBUG_INFO)" == "1"
__DEBUGINFO_0 = /Zi
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_1 = /DEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_INFO)" == "default"
__DEBUGINFO_1 = 
!endif
!if "$(DEBUG_INFO)" == "0"
__DEBUGINFO_1 = 
!endif
!if "$(DEBUG_INFO)" == "1"
__DEBUGINFO_1 = /DEBUG
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_2_p = /D_DEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_2_p = 
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
____DEBUGRUNTIME_2_p = 
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
____DEBUGRUNTIME_2_p = /D_DEBUG
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_2_p_1 = /d _DEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
____DEBUGRUNTIME_2_p_1 = 
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
____DEBUGRUNTIME_2_p_1 = 
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
____DEBUGRUNTIME_2_p_1 = /d _DEBUG
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__DEBUGRUNTIME_3 = d
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__DEBUGRUNTIME_3 = 
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__DEBUGRUNTIME_3 = 
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "1"
__DEBUGRUNTIME_3 = d
!endif
!if "$(BUILD)" == "debug"
__OPTIMIZEFLAG_4 = /Od
!endif
!if "$(BUILD)" == "release"
__OPTIMIZEFLAG_4 = /O2
!endif
!if "$(USE_THREADS)" == "0"
__THREADSFLAG_7 = L
!endif
!if "$(USE_THREADS)" == "1"
__THREADSFLAG_7 = T
!endif
!if "$(RUNTIME_LIBS)" == "dynamic"
__RUNTIME_LIBS_8 = D
!endif
!if "$(RUNTIME_LIBS)" == "static"
__RUNTIME_LIBS_8 = $(__THREADSFLAG_7)
!endif
!if "$(USE_RTTI)" == "0"
__RTTIFLAG_9 = 
!endif
!if "$(USE_RTTI)" == "1"
__RTTIFLAG_9 = /GR
!endif
!if "$(USE_EXCEPTIONS)" == "0"
__EXCEPTIONSFLAG_10 = 
!endif
!if "$(USE_EXCEPTIONS)" == "1"
__EXCEPTIONSFLAG_10 = /EHsc
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "0"
__NO_VC_CRTDBG_p = /D__NO_VC_CRTDBG__
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_FLAG)" == "1"
__NO_VC_CRTDBG_p = /D__NO_VC_CRTDBG__
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_RUNTIME_LIBS)" == "0"
__NO_VC_CRTDBG_p_1 = /d __NO_VC_CRTDBG__
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_FLAG)" == "1"
__NO_VC_CRTDBG_p_1 = /d __NO_VC_CRTDBG__
!endif
!if "$(WXUNIV)" == "1"
__WXUNIV_DEFINE_p = /D__WXUNIVERSAL__
!endif
!if "$(WXUNIV)" == "1"
__WXUNIV_DEFINE_p_1 = /d __WXUNIVERSAL__
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default"
__DEBUG_DEFINE_p = /D__WXDEBUG__
!endif
!if "$(DEBUG_FLAG)" == "1"
__DEBUG_DEFINE_p = /D__WXDEBUG__
!endif
!if "$(BUILD)" == "debug" && "$(DEBUG_FLAG)" == "default"
__DEBUG_DEFINE_p_1 = /d __WXDEBUG__
!endif
!if "$(DEBUG_FLAG)" == "1"
__DEBUG_DEFINE_p_1 = /d __WXDEBUG__
!endif


### following is needed for wxMSW 2.9.x
!if "$(DEBUG_FLAG)" == "0"
__DEBUG_DEFINE_p = /DwxDEBUG_LEVEL=0
!endif
!if "$(DEBUG_FLAG)" == "0"
__DEBUG_DEFINE_p_1 = /d wxDEBUG_LEVEL=0
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__NDEBUG_DEFINE_p = /DNDEBUG
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__NDEBUG_DEFINE_p = /DNDEBUG
!endif
!if "$(BUILD)" == "release" && "$(DEBUG_RUNTIME_LIBS)" == "default"
__NDEBUG_DEFINE_p_1 = /d NDEBUG
!endif
!if "$(DEBUG_RUNTIME_LIBS)" == "0"
__NDEBUG_DEFINE_p_1 = /d NDEBUG
!endif


!if "$(USE_EXCEPTIONS)" == "0"
__EXCEPTIONS_DEFINE_p = /DwxNO_EXCEPTIONS
!endif
!if "$(USE_EXCEPTIONS)" == "0"
__EXCEPTIONS_DEFINE_p_1 = /d wxNO_EXCEPTIONS
!endif
!if "$(USE_RTTI)" == "0"
__RTTI_DEFINE_p = /DwxNO_RTTI
!endif
!if "$(USE_RTTI)" == "0"
__RTTI_DEFINE_p_1 = /d wxNO_RTTI
!endif
!if "$(USE_THREADS)" == "0"
__THREAD_DEFINE_p = /DwxNO_THREADS
!endif
!if "$(USE_THREADS)" == "0"
__THREAD_DEFINE_p_1 = /d wxNO_THREADS
!endif
!if "$(UNICODE)" == "1"
__UNICODE_DEFINE_p = /D_UNICODE
!endif
!if "$(UNICODE)" == "1"
__UNICODE_DEFINE_p_1 = /d _UNICODE
!endif
!if "$(SHARED)" == "1"
__DLLFLAG_p = /DWXUSINGDLL
!endif
!if "$(SHARED)" == "1"
__DLLFLAG_p_1 = /d WXUSINGDLL
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_HTML_p = \
	wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_html.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_ADV_p = \
	wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_adv.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_CORE_p = \
	wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_core.lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_BASE_p = \
	wxbase$(WX_RELEASE)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib
!endif
!if "$(MONOLITHIC)" == "0"
__WXLIB_NET_p = \
	wxbase$(WX_RELEASE)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR)_net.lib
!endif
!if "$(MONOLITHIC)" == "1"
__WXLIB_MONO_p = \
	wx$(PORTNAME)$(WXUNIVNAME)$(WX_RELEASE)$(WXUNICODEFLAG)$(WXDEBUGFLAG)$(WX_LIB_FLAVOUR).lib
!endif
!if "$(MSLU)" == "1"
__UNICOWS_LIB_p = unicows.lib
!endif

__LIB_TIFF_p = wxtiff$(WXDEBUGFLAG).lib
__LIB_JPEG_p = wxjpeg$(WXDEBUGFLAG).lib
__LIB_PNG_p = wxpng$(WXDEBUGFLAG).lib

### Targets: ###

all: $(OBJDIR) $(EXEDIR)\Golly.exe $(EXEDIR)\bgolly.exe

$(BASEOBJ): $(BASEH)
$(WXOBJ): $(BASEH) $(WXH) icons/*.ico bitmaps/*.xpm

$(OBJDIR):
	mkdir $(OBJDIR)

clean: 
	-if exist $(OBJDIR)\*.obj del $(OBJDIR)\*.obj
	-if exist *.res del *.res
	-if exist $(EXEDIR)\Golly.exe del $(EXEDIR)\Golly.exe
	-if exist $(EXEDIR)\bgolly.exe del $(EXEDIR)\bgolly.exe
	-if exist $(EXEDIR)\RuleTableToTree.exe del $(EXEDIR)\RuleTableToTree.exe
	-if exist golly.pdb del golly.pdb

$(EXEDIR)\Golly.exe: $(BASEOBJ) $(WXOBJ) golly.res
	link /LARGEADDRESSAWARE /NOLOGO /OUT:$(EXEDIR)\Golly.exe $(LDFLAGS) $(__DEBUGINFO_1) /pdb:"golly.pdb" \
	/LIBPATH:$(LIBDIRNAME) /SUBSYSTEM:WINDOWS $(BASEOBJ) $(WXOBJ) golly.res \
	$(__WXLIB_HTML_p) $(__WXLIB_ADV_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) $(__WXLIB_NET_p) \
	$(__WXLIB_MONO_p) $(__LIB_TIFF_p) $(__LIB_JPEG_p) $(__LIB_PNG_p) wxzlib$(WXDEBUGFLAG).lib \
	wxregex$(WXUNICODEFLAG)$(WXDEBUGFLAG).lib wxexpat$(WXDEBUGFLAG).lib \
	$(__UNICOWS_LIB_p) kernel32.lib user32.lib gdi32.lib comdlg32.lib \
	winspool.lib winmm.lib shell32.lib comctl32.lib ole32.lib oleaut32.lib uuid.lib \
	rpcrt4.lib advapi32.lib wsock32.lib wininet.lib

golly.res: golly.rc
	rc /fo$@ /d $(WX_CPU_DEF) /d WIN32 $(____DEBUGRUNTIME_2_p_1) $(__NO_VC_CRTDBG_p_1)  /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) \
	$(__DEBUG_DEFINE_p_1) $(__NDEBUG_DEFINE_p_1) $(__EXCEPTIONS_DEFINE_p_1) $(__RTTI_DEFINE_p_1) $(__THREAD_DEFINE_p_1) \
	$(__UNICODE_DEFINE_p_1) /i $(WX_DIR)\include /i $(SETUPHDIR) /i . $(__DLLFLAG_p_1) /d _WINDOWS \
	/i $(WX_DIR)\samples /d NOPCH golly.rc

$(EXEDIR)\bgolly.exe: $(BASEOBJ) $(OBJDIR)/bgolly.obj
	link /LARGEADDRESSAWARE /NOLOGO /OUT:$(EXEDIR)\bgolly.exe $(LDFLAGS) /LIBPATH:$(LIBDIRNAME) \
	$(OBJDIR)/bgolly.obj $(BASEOBJ) wxzlib$(WXDEBUGFLAG).lib

$(EXEDIR)\RuleTableToTree.exe: $(BASEOBJ) $(OBJDIR)/RuleTableToTree.obj
	link /LARGEADDRESSAWARE /NOLOGO /OUT:$(EXEDIR)\RuleTableToTree.exe $(LDFLAGS) /LIBPATH:$(LIBDIRNAME) \
	$(OBJDIR)/RuleTableToTree.obj $(BASEOBJ) wxzlib$(WXDEBUGFLAG).lib

$(OBJDIR)/bgolly.obj: $(CMDDIR)/bgolly.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(CMDDIR)/bgolly.cpp

$(OBJDIR)/RuleTableToTree.obj: $(CMDDIR)/RuleTableToTree.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(CMDDIR)/RuleTableToTree.cpp

$(OBJDIR)/bigint.obj: $(BASEDIR)/bigint.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/bigint.cpp

$(OBJDIR)/lifealgo.obj: $(BASEDIR)/lifealgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/lifealgo.cpp

$(OBJDIR)/hlifealgo.obj: $(BASEDIR)/hlifealgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/hlifealgo.cpp

$(OBJDIR)/hlifedraw.obj: $(BASEDIR)/hlifedraw.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/hlifedraw.cpp

$(OBJDIR)/qlifealgo.obj: $(BASEDIR)/qlifealgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/qlifealgo.cpp

$(OBJDIR)/qlifedraw.obj: $(BASEDIR)/qlifedraw.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/qlifedraw.cpp

$(OBJDIR)/jvnalgo.obj: $(BASEDIR)/jvnalgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/jvnalgo.cpp

$(OBJDIR)/ruleloaderalgo.obj: $(BASEDIR)/ruleloaderalgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/ruleloaderalgo.cpp

$(OBJDIR)/ruletable_algo.obj: $(BASEDIR)/ruletable_algo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/ruletable_algo.cpp

$(OBJDIR)/ruletreealgo.obj: $(BASEDIR)/ruletreealgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/ruletreealgo.cpp

$(OBJDIR)/generationsalgo.obj: $(BASEDIR)/generationsalgo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/generationsalgo.cpp

$(OBJDIR)/ghashbase.obj: $(BASEDIR)/ghashbase.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/ghashbase.cpp

$(OBJDIR)/ghashdraw.obj: $(BASEDIR)/ghashdraw.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/ghashdraw.cpp

$(OBJDIR)/liferules.obj: $(BASEDIR)/liferules.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/liferules.cpp

$(OBJDIR)/liferender.obj: $(BASEDIR)/liferender.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/liferender.cpp

$(OBJDIR)/readpattern.obj: $(BASEDIR)/readpattern.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/readpattern.cpp

$(OBJDIR)/writepattern.obj: $(BASEDIR)/writepattern.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/writepattern.cpp

$(OBJDIR)/util.obj: $(BASEDIR)/util.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/util.cpp

$(OBJDIR)/viewport.obj: $(BASEDIR)/viewport.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/viewport.cpp

$(OBJDIR)/lifepoll.obj: $(BASEDIR)/lifepoll.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(BASEDIR)/lifepoll.cpp

$(OBJDIR)/wxutils.obj: wxutils.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxutils.cpp

$(OBJDIR)/wxprefs.obj: wxprefs.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxprefs.cpp

$(OBJDIR)/wxalgos.obj: wxalgos.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxalgos.cpp

$(OBJDIR)/wxrule.obj: wxrule.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxrule.cpp

$(OBJDIR)/wxinfo.obj: wxinfo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxinfo.cpp

$(OBJDIR)/wxhelp.obj: wxhelp.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxhelp.cpp

$(OBJDIR)/wxstatus.obj: wxstatus.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxstatus.cpp

$(OBJDIR)/wxview.obj: wxview.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxview.cpp

$(OBJDIR)/wxrender.obj: wxrender.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxrender.cpp

$(OBJDIR)/wxperl.obj: wxperl.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(PERL_INCLUDE) wxperl.cpp

$(OBJDIR)/wxpython.obj: wxpython.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(PYTHON_INCLUDE) wxpython.cpp

$(OBJDIR)/wxscript.obj: wxscript.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxscript.cpp

$(OBJDIR)/wxfile.obj: wxfile.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxfile.cpp

$(OBJDIR)/wxedit.obj: wxedit.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxedit.cpp

$(OBJDIR)/wxselect.obj: wxselect.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxselect.cpp

$(OBJDIR)/wxcontrol.obj: wxcontrol.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxcontrol.cpp

$(OBJDIR)/wxtimeline.obj: wxtimeline.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxtimeline.cpp

$(OBJDIR)/wxundo.obj: wxundo.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxundo.cpp

$(OBJDIR)/wxlayer.obj: wxlayer.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxlayer.cpp

$(OBJDIR)/wxmain.obj: wxmain.cpp
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxmain.cpp

$(OBJDIR)/wxgolly.obj: wxgolly.cpp
	$(CXX) /c /TP /nologo /Fo$@ $(CXXFLAGS) wxgolly.cpp

srcdist:
	-rmdir /s /q $(RELEASENAME)-src
	mkdir $(RELEASENAME)-src
	mkdir $(RELEASENAME)-src\Help
	mkdir $(RELEASENAME)-src\Patterns
	mkdir $(RELEASENAME)-src\Rules
	mkdir $(RELEASENAME)-src\Scripts
	mkdir $(RELEASENAME)-src\docs
	mkdir $(RELEASENAME)-src\gollybase
	mkdir $(RELEASENAME)-src\cmdline
	xcopy /S /I $(EXEDIR)\Help $(RELEASENAME)-src\Help
	xcopy /S /I $(EXEDIR)\Patterns $(RELEASENAME)-src\Patterns
	xcopy /S /I $(EXEDIR)\Rules $(RELEASENAME)-src\Rules
	xcopy /S /I $(EXEDIR)\Scripts $(RELEASENAME)-src\Scripts
	xcopy /S /I $(EXEDIR)\docs $(RELEASENAME)-src\docs
	xcopy /S /I $(EXEDIR)\gollybase $(RELEASENAME)-src\gollybase
	xcopy /S /I $(EXEDIR)\cmdline $(RELEASENAME)-src\cmdline	
	mkdir $(RELEASENAME)-src\gui-wx
	mkdir $(RELEASENAME)-src\gui-wx\configure
	mkdir $(RELEASENAME)-src\gui-wx\bitmaps
	mkdir $(RELEASENAME)-src\gui-wx\icons
	for %%F IN ($(GUIFILES)) do xcopy %F $(RELEASENAME)-src\gui-wx
	for %%F IN ($(GUIDIRS)) do xcopy /S /I %F $(RELEASENAME)-src\gui-wx\%F
	echo Now zip $(RELEASENAME)-src into $(RELEASENAME)-src.zip

bindist: all
	-rmdir /s /q $(RELEASENAME)-win
	mkdir $(RELEASENAME)-win
	mkdir $(RELEASENAME)-win\Help
	mkdir $(RELEASENAME)-win\Patterns
	mkdir $(RELEASENAME)-win\Rules
	mkdir $(RELEASENAME)-win\Scripts
	xcopy /S /I $(EXEDIR)\Help $(RELEASENAME)-win\Help
	xcopy /S /I $(EXEDIR)\Patterns $(RELEASENAME)-win\Patterns
	xcopy /S /I $(EXEDIR)\Rules $(RELEASENAME)-win\Rules
	xcopy /S /I $(EXEDIR)\Scripts $(RELEASENAME)-win\Scripts	
	for %%F IN ($(BINFILES)) do xcopy %F $(RELEASENAME)-win
	echo Now zip $(RELEASENAME)-win into $(RELEASENAME)-win.zip
