# Makefile for Windows version of Golly using wxWidgets.
# To compile the wxWidgets libraries on Windows:
# 
#    cd \wxWidgets\build\msw
#    nmake -f makefile.vc BUILD=release RUNTIME_LIBS=static UNICODE=1
# 
# If you like, edit \wxWidgets\build\msw\config.vc and set:
# 
#    BUILD=release
#    RUNTIME_LIBS=static
#    UNICODE=1
# 
# Then you don't have to specify those settings to nmake.

# Change the next 2 lines to specify where you installed wxWidgets:
!include </wxWidgets/build/msw/config.vc>
WX_DIR = c:\wxWidgets

# Change the next line to match your wxWidgets version (first two digits):
WX_RELEASE = 28

# Change the next line depending on where you installed Python:
PYTHON_INCLUDE = -I"C:\Python25\include"

# Simplified output from "perl -MExtUtils::Embed -e ccopts":
PERL_INCLUDE = \
-DHAVE_DES_FCRYPT -DNO_HASH_SEED -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT \
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -DPERL_MSVCRT_READFIX -I"C:\Perl\lib\CORE"

# We load the Perl library at runtime so no need for PERL_LINK.
# Simplified output from "perl -MExtUtils::Embed -e ldopts":
# PERL_LINK = \
# -libpath:"C:\Perl\lib\CORE" C:\Perl\lib\CORE\perl58.lib C:\MVCT\lib\oldnames.lib

### Golly-related variables: ###
VERSION = 1.3
RELEASENAME = golly-$(VERSION)
SHAREDFILES = README LICENSE
SHAREDDIRS = Help Help\Lexicon Scripts Scripts\Perl Scripts\Python Scripts\Python\glife \
   Patterns Patterns\Breeders Patterns\Guns Patterns\Hashing-Examples Patterns\Methuselahs \
   Patterns\Miscellaneous Patterns\Oscillators Patterns\Other-Rules Patterns\Puffers \
   Patterns\Rakes Patterns\Signal-Circuitry Patterns\Still-Lifes Patterns\Spaceships \
   Patterns\Syntheses
SRCFILES = BUILD TODO CHANGES makefile-gtk makefile-x11 makefile-mac makefile-win \
   golly.rc *.ico appicon.xpm Info.plist.in *.icns *.h *.cpp
SRCDIRS = bitmaps
BINFILES = Golly.exe bgolly.exe

LIBDIRNAME = $(WX_DIR)\lib\vc_$(LIBTYPE_SUFFIX)$(CFG)
SETUPHDIR = $(LIBDIRNAME)\$(PORTNAME)$(WXUNIVNAME)$(WXUNICODEFLAG)$(WXDEBUGFLAG)

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) $(__EXCEPTIONS_DEFINE_p) $(__RTTI_DEFINE_p) \
	$(__THREAD_DEFINE_p) $(__UNICODE_DEFINE_p) /I$(WX_DIR)\include /I$(SETUPHDIR) \
	/W4 /I. $(__DLLFLAG_p) /D_WINDOWS /I$(WX_DIR)\samples /DNOPCH $(__RTTIFLAG_9) \
	$(__EXCEPTIONSFLAG_10) $(CPPFLAGS) \
	/EHsc /DVERSION=$(VERSION) /DZLIB /I$(WX_DIR)\src\zlib

OBJDIR = ObjWin
BASEOBJ = $(OBJDIR)/bigint.obj $(OBJDIR)/lifealgo.obj $(OBJDIR)/hlifealgo.obj $(OBJDIR)/hlifedraw.obj \
   $(OBJDIR)/qlifealgo.obj $(OBJDIR)/qlifedraw.obj $(OBJDIR)/liferender.obj $(OBJDIR)/viewport.obj \
   $(OBJDIR)/readpattern.obj $(OBJDIR)/writepattern.obj $(OBJDIR)/liferules.obj $(OBJDIR)/util.obj \
   $(OBJDIR)/lifepoll.obj
WXOBJ = $(OBJDIR)/wxutils.obj $(OBJDIR)/wxprefs.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)/wxundo.obj \
   $(OBJDIR)/wxlayer.obj $(OBJDIR)/wxmain.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
!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)" == "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) Golly.exe bgolly.exe

$(OBJDIR):
	mkdir $(OBJDIR)

clean: 
	-if exist $(OBJDIR)/*.obj del $(OBJDIR)/*.obj
	-if exist *.res del *.res
	-if exist Golly.exe del Golly.exe
	-if exist golly.pdb del golly.pdb

Golly.exe: $(BASEOBJ) $(WXOBJ) golly.res
	link /NOLOGO /OUT:$@ $(LDFLAGS) $(__DEBUGINFO_1) /LIBPATH:$(LIBDIRNAME) \
	/LIBPATH:"c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib" \
	/SUBSYSTEM:WINDOWS $(BASEOBJ) $(WXOBJ) golly.res \
	$(__WXLIB_HTML_p) $(__WXLIB_ADV_p) $(__WXLIB_CORE_p) $(__WXLIB_BASE_p) \
	$(__WXLIB_MONO_p) $(__LIB_TIFF_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 oleacc.lib odbc32.lib

golly.res: golly.rc
	rc /fo$@  /d WIN32 $(____DEBUGRUNTIME_2_p_1) $(__NO_VC_CRTDBG_p_1)  /d __WXMSW__ $(__WXUNIV_DEFINE_p_1) \
	$(__DEBUG_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

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

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

$(OBJDIR)/lifealgo.obj: lifealgo.cpp lifealgo.h bigint.h viewport.h \
liferender.h lifepoll.h readpattern.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) lifealgo.cpp

$(OBJDIR)/hlifealgo.obj: hlifealgo.cpp hlifealgo.h lifealgo.h bigint.h \
viewport.h liferender.h lifepoll.h readpattern.h liferules.h util.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) hlifealgo.cpp

$(OBJDIR)/hlifedraw.obj: hlifedraw.cpp hlifealgo.h lifealgo.h bigint.h \
viewport.h liferender.h lifepoll.h readpattern.h liferules.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) hlifedraw.cpp

$(OBJDIR)/qlifealgo.obj: qlifealgo.cpp qlifealgo.h lifealgo.h bigint.h \
viewport.h liferender.h lifepoll.h readpattern.h liferules.h util.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) qlifealgo.cpp

$(OBJDIR)/qlifedraw.obj: qlifedraw.cpp qlifealgo.h lifealgo.h bigint.h \
viewport.h liferender.h lifepoll.h readpattern.h liferules.h util.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) qlifedraw.cpp

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

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

$(OBJDIR)/readpattern.obj: readpattern.cpp readpattern.h bigint.h lifealgo.h \
viewport.h liferender.h lifepoll.h util.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) readpattern.cpp

$(OBJDIR)/writepattern.obj: writepattern.cpp writepattern.h lifealgo.h \
bigint.h viewport.h liferender.h lifepoll.h readpattern.h util.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) writepattern.cpp

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

$(OBJDIR)/viewport.obj: viewport.cpp viewport.h bigint.h lifealgo.h \
liferender.h lifepoll.h readpattern.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) viewport.cpp

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

$(OBJDIR)/wxutils.obj: wxutils.cpp wxutils.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
wxgolly.h wxview.h wxmain.h wxscript.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxutils.cpp

$(OBJDIR)/wxprefs.obj: wxprefs.cpp wxprefs.h \
Help/about.html \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
wxgolly.h wxmain.h wxutils.h wxhelp.h wxinfo.h wxundo.h wxlayer.h wxscript.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxprefs.cpp

$(OBJDIR)/wxrule.obj: wxrule.cpp wxrule.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h liferules.h \
wxgolly.h wxutils.h wxprefs.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxrule.cpp

$(OBJDIR)/wxinfo.obj: wxinfo.cpp wxinfo.h \
readpattern.h bigint.h wxgolly.h wxmain.h wxutils.h wxprefs.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxinfo.cpp

$(OBJDIR)/wxhelp.obj: wxhelp.cpp wxhelp.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
wxgolly.h wxmain.h wxutils.h wxprefs.h wxscript.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxhelp.cpp

$(OBJDIR)/wxstatus.obj: wxstatus.cpp wxstatus.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
wxgolly.h wxutils.h wxprefs.h wxview.h wxmain.h wxscript.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxstatus.cpp

$(OBJDIR)/wxview.obj: wxview.cpp wxview.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
qlifealgo.h liferules.h hlifealgo.h \
wxgolly.h wxutils.h wxprefs.h wxhelp.h wxmain.h wxstatus.h wxrender.h \
wxscript.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxview.cpp

$(OBJDIR)/wxrender.obj: wxrender.cpp wxrender.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
qlifealgo.h liferules.h hlifealgo.h \
wxgolly.h wxutils.h wxprefs.h wxhelp.h wxstatus.h wxview.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxrender.cpp

$(OBJDIR)/wxperl.obj: wxperl.cpp wxperl.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h \
qlifealgo.h hlifealgo.h readpattern.h writepattern.h \
wxgolly.h wxmain.h wxview.h wxstatus.h wxutils.h wxprefs.h \
wxinfo.h wxhelp.h wxundo.h wxlayer.h wxscript.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(PERL_INCLUDE) wxperl.cpp

$(OBJDIR)/wxpython.obj: wxpython.cpp wxpython.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h \
qlifealgo.h hlifealgo.h readpattern.h writepattern.h \
wxgolly.h wxmain.h wxview.h wxstatus.h wxutils.h wxprefs.h \
wxinfo.h wxhelp.h wxundo.h wxlayer.h wxscript.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) $(PYTHON_INCLUDE) wxpython.cpp

$(OBJDIR)/wxscript.obj: wxscript.cpp wxscript.h \
liferules.h \
wxgolly.h wxmain.h wxview.h wxrender.h wxstatus.h wxutils.h wxprefs.h \
wxundo.h wxlayer.h wxperl.h wxpython.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxscript.cpp

$(OBJDIR)/wxfile.obj: wxfile.cpp \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
qlifealgo.h liferules.h hlifealgo.h writepattern.h \
wxgolly.h wxutils.h wxprefs.h wxrule.h wxinfo.h wxstatus.h \
wxview.h wxrender.h wxscript.h wxmain.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxfile.cpp

$(OBJDIR)/wxedit.obj: wxedit.cpp \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
qlifealgo.h liferules.h hlifealgo.h \
wxgolly.h wxutils.h wxprefs.h wxmain.h wxstatus.h wxrender.h wxscript.h wxview.h \
wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxedit.cpp

$(OBJDIR)/wxcontrol.obj: wxcontrol.cpp \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
qlifealgo.h liferules.h hlifealgo.h \
wxgolly.h wxutils.h wxprefs.h wxrule.h wxstatus.h wxview.h wxscript.h wxmain.h \
wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxcontrol.cpp

$(OBJDIR)/wxundo.obj: wxundo.cpp wxundo.h \
lifealgo.h bigint.h qlifealgo.h hlifealgo.h viewport.h writepattern.h \
wxgolly.h wxmain.h wxview.h wxutils.h wxscript.h wxlayer.h wxprefs.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxundo.cpp

$(OBJDIR)/wxlayer.obj: wxlayer.cpp wxlayer.h \
lifealgo.h bigint.h qlifealgo.h hlifealgo.h viewport.h \
wxgolly.h wxmain.h wxview.h wxstatus.h wxutils.h wxprefs.h wxscript.h wxundo.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxlayer.cpp

$(OBJDIR)/wxmain.obj: wxmain.cpp wxmain.h \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
qlifealgo.h liferules.h hlifealgo.h writepattern.h \
wxgolly.h wxutils.h wxprefs.h wxinfo.h wxhelp.h wxstatus.h \
wxview.h wxrender.h wxscript.h wxundo.h wxlayer.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) wxmain.cpp

$(OBJDIR)/wxgolly.obj: wxgolly.cpp wxgolly.h \
Help/about.html \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h util.h \
wxmain.h wxstatus.h wxview.h wxutils.h wxprefs.h
	$(CXX) /c /TP /nologo /Fo$@ $(CXXFLAGS) wxgolly.cpp

$(OBJDIR)/bgolly.obj: bgolly.cpp \
lifealgo.h bigint.h viewport.h liferender.h lifepoll.h readpattern.h \
hlifealgo.h liferules.h qlifealgo.h writepattern.h util.h
	$(CXX) /c /nologo /Fo$@ $(CXXFLAGS) bgolly.cpp

srcdist:
	-rmdir /s /q $(RELEASENAME)-src
	mkdir $(RELEASENAME)-src
	mkdir $(RELEASENAME)-src\bitmaps
	mkdir $(RELEASENAME)-src\Help
	mkdir $(RELEASENAME)-src\Patterns
	mkdir $(RELEASENAME)-src\Scripts
	for %%F IN ($(SRCFILES) $(SHAREDFILES)) do xcopy %F $(RELEASENAME)-src
	for %%F IN ($(SRCDIRS) $(SHAREDDIRS)) do xcopy /I %F $(RELEASENAME)-src\%F
	ren $(RELEASENAME)-src\README README.txt
	ren $(RELEASENAME)-src\LICENSE LICENSE.txt
	ren $(RELEASENAME)-src\BUILD BUILD.txt
	ren $(RELEASENAME)-src\TODO TODO.txt
	ren $(RELEASENAME)-src\CHANGES CHANGES.txt
	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\Scripts
	for %%F IN ($(BINFILES) $(SHAREDFILES)) do xcopy %F $(RELEASENAME)-win
	for %%F IN ($(SHAREDDIRS)) do xcopy /I %F $(RELEASENAME)-win\%F
	ren $(RELEASENAME)-win\README README.txt
	ren $(RELEASENAME)-win\LICENSE LICENSE.txt
	echo Now zip $(RELEASENAME)-win into $(RELEASENAME)-win.zip
