+# This sets 'D' to a suitable directory name: [Base](Debug|Release|Hybrid)[Dll]
+# for this kind of build, and WXLIBNAME to one of wx(msw|base)[u][d] (static),
+# wx(msw|base)$(WXVERSION)[u][d] (DLL)
+
+!if "$(UNICODE)" == "1"
+_WXLIB_SUFFIX=u
+_WXINC_SUFFIX=u
+_WXDIR_UNICODESUFFIX=Unicode
+!endif
+
+!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
+_WXLIB_VERSION=$(WXVERSION)
+_WXDIR_DLLSUFFIX=Dll
+_WXINC_DLLSUFFIX=dll
+!else
+_WXLIB_VERSION=
+_WXDIR_DLLSUFFIX=
+_WXINC_DLLSUFFIX=
+!endif
+
+!if "$(FINAL)" == "1"
+_WXDIR_BUILD=Release
+LIBEXT=
+# no _WXDIR_SUFFIX
+!else if "$(FINAL)" == "hybrid"
+_WXDIR_BUILD=Hybrid
+LIBEXT=h
+!else
+guilibsdll= oldnames.lib kernel32.lib \
+ ws2_32.lib mswsock.lib advapi32.lib user32.lib \
+ gdi32.lib comdlg32.lib winspool.lib
+_WXDIR_BUILD=Debug
+LIBEXT=d
+!endif
+
+!if "$(wxUSE_GUI)" == "0"
+_WXDIR_PREFIX=Base
+_WXLIB_NAME=wxbase
+_WXINC_BUILD=base
+!else
+_WXDIR_PREFIX=
+_WXLIB_NAME=wxmsw
+_WXINC_BUILD=msw
+!endif
+
+!if "$(UNICODE)" == "1"
+UNIFLAGS=-DUNICODE -D_UNICODE -DwxUSE_UNICODE=1
+!endif
+
+!if "$(wxUSE_GUI)" == "0"
+UNIFLAGS=$(UNIFLAGS) -DwxUSE_GUI=0
+!endif
+
+!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
+D=$(D)DLL
+INCEXT=dll$(INCEXT)
+!endif
+
+D=$(_WXDIR_PREFIX)$(_WXDIR_BUILD)$(_WXDIR_UNICODESUFFIX)$(_WXDIR_DLLSUFFIX)
+WXLIBNAME=$(_WXLIB_NAME)$(_WXLIB_VERSION)$(_WXLIB_SUFFIX)$(LIBEXT)
+INCEXT=$(_WXINC_SUFFIX)$(LIBEXT)
+
+!if "$(NEW_WXLIBNAME)" != ""
+WXLIBNAME=$(NEW_WXLIBNAME)
+!endif
+
+#----------------------------------------------------------------------
+# MSLU == Microsoft Layer for Unicode
+# See MSDN or the Platform SDK docs for details
+!if "$(MSLU)" == "1"
+MSLU_FLAGS=/nod:kernel32.lib /nod:advapi32.lib /nod:user32.lib /nod:gdi32.lib /nod:shell32.lib /nod:comdlg32.lib /nod:version.lib /nod:mpr.lib /nod:rasapi32.lib /nod:winmm.lib /nod:winspool.lib /nod:vfw32.lib /nod:secur32.lib /nod:oleacc.lib /nod:oledlg.lib /nod:sensapi.lib
+MSLU_LIBS=$(MSLU_FLAGS) unicows.lib
+!endif
+
+WXLIB=$(WXDIR)\lib\$(WXLIBNAME).lib
+
+INC=$(EXTRAINC) -I$(WXDIR)/lib/$(_WXINC_BUILD)$(_WXINC_DLLSUFFIX)$(_WXINC_SUFFIX)$(LIBEXT) -I$(WXINC) -I$(WXDIR)/contrib/include -I$(WXDIR)/src/regex -I$(WXDIR)/src/png -I$(WXDIR)/src/zlib -I$(WXDIR)/src/jpeg -I$(WXDIR)/src/tiff
+
+!if "$(WXUSINGDLL)" == "1" || "$(wxUSE_GUI)" == "0"
+LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib
+!else
+LIBS = $(MSLU_LIBS) $(EXTRALIBS) $(WXLIB) $(WINLIBS) $(WXDIR)\lib\regex$(LIBEXT).lib $(WXDIR)\lib\png$(LIBEXT).lib $(WXDIR)\lib\zlib$(LIBEXT).lib $(WXDIR)\lib\jpeg$(LIBEXT).lib $(WXDIR)\lib\tiff$(LIBEXT).lib
+!endif
+