!endif
WXDIR = $(WXWIN)
-CFG = $(WXDIR)\src\msw\wxwin32.cfg
+CFG = $(WXDIR)\src\msw\wxw32
BCCDIR=$(MAKEDIR)\..
ARCHINCDIR=$(WXDIR)\lib\msw
ARCHSETUPH=$(ARCHINCDIR)\wx\setup.h
+#see below for SETUPSRCDIR
+
# Using a config file isn't compatible across all BC++ versions
# LNKCFG=$(WXDIR)\src\msw\bclnk32.cfg
FINAL=0
!endif
+!ifndef WXMAKINGDLL
+WXMAKINGDLL=0
+!endif
+
!if "$(FINAL)" == "1"
OPT = -O2
DEBUG_FLAGS = -DUSE_DEFINE
LINKDEBUGFLAGS=/v
!endif
+# allow to use debugger but no wxDebugging functions
+!if "$(FINAL)" == "hybrid"
+OPT = -Od
+DEBUG_FLAGS= -v
+LINKDEBUGFLAGS=/v
+!endif
+
!ifndef DLL
DLL=0
!endif
WXLIBNAME=wx32
!endif
-!if "$(UNICODE)" == "1"
-WXLIBNAME=$(WXLIBNAME)u
+## Use this if you want to use the UNIV controls set rather than the native ones
+## make -f makefile.b32 WXUSINGUNIV=1
+!if "$(WXUSINGUNIV)" == "1"
+USE_UNIV="UNIV"
+CFG=$(CFG)v
+WXLIBNAME=$(WXLIBNAME)v
+ARCHINCDIR=$(ARCHINCDIR)v
+SETUPSRCDIR=$(WXDIR)\include\wx\univ
+PORT=__WXUNIVERSAL__
+!else
+USE_UNIV=""
+PORT=__WXMSW__
+SETUPSRCDIR=$(WXDIR)\include\wx\msw
!endif
-!if "$(FINAL)" == "1"
-WXLIBNAME=$(WXLIBNAME)$(FINAL)
-!else if "$(FINAL)" == "hybrid"
+#not sure what to do with unicode builds - we need to define something ?
+#!if "$(UNICODE)" == "1"
+#WXLIBNAME=$(WXLIBNAME)u
+#!endif
+
+
+#a hybrid , does not set __WXDEBUG__ but sets -v (see above)
+!if "$(FINAL)" == "hybrid"
WXLIBNAME=$(WXLIBNAME)h
-!else
-guilibsdll= oldnames.lib kernel32.lib \
- ws2_32.lib mswsock.lib advapi32.lib user32.lib \
- gdi32.lib comdlg32.lib winspool.lib
+CFG=$(CFG)h
+!endif
+
+!if "$(FINAL)" == "0"
WXLIBNAME=$(WXLIBNAME)d
+CFG=$(CFG)d
!endif
!if "$(wxUSE_GUI)" == "0"
WXLIBNAME=$(WXLIBNAME)b
+CFG=$(CFG)b
CPPFLAGS=-DwxUSE_GUI=0
!endif
+!if "$(WXMAKINGDLL)" != "1" && "$(WXUSINGDLL)" != "1"
+WXLIBNAME=$(WXLIBNAME)s
+!endif
+
!if "$(WXMAKINGDLL)" == "1" || "$(WXUSINGDLL)" == "1"
INCEXT=dll$(INCEXT)
!endif
LINK_FLAGS= /Tpd /c $(EXTRALINKFLAGS)
!endif
-CPPFLAGS=$(CPPFLAGS) $(DLL_FLAGS) $(EXTRACPPFLAGS) @$(CFG)
+CFG=$(CFG).cfg
+CPPFLAGS=$(CPPFLAGS) $(DLL_FLAGS) @$(CFG) $(EXTRACPPFLAGS)
DUMMY=dummy