-EXTRALIBS = $(WATLIBDIR)\ctl3d32.lib $(WATLIBDIR)\odbc32.lib
-IFLAGS = -i=$(WXINC) -i=$(WXBASEINC) -i=$(WXDIR)\contrib\fafa -i=$(%watcom)\h;$(%watcom)\h\nt
-RESFLAGS1 = -r -bt=nt /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa
-RESFLAGS2 = -R $(name) /i$(WXDIR)\include\msw /i$(WXDIR)\contrib\fafa
-DEBUGINFO = debug all # Linking: comment out if operating in a non-debuggable environment
-
-#-i=$(WXDIR)\contrib\itsybits
-
-# Here are some possible optimization flags:
-# /5r Pentium timings
-# /fp5 /fpi87 Inline 80x87 instructions optimized for Pentium: coprocessor must be present
-# /ox Standard optimizations
-# /or Reordering for Pentium timings (included in /ox)
-# The Watcom-recommended flags for optimum Pentium speed are:
-# /oneatx /zp4 /5 /fpi87 /fp5
-
-OPTFLAGS=/ox /5r # /DDEBUG=1
-
-# /d1 for line numbers only: anything else produces an enormous wx32.lib
-CPPFLAGS = /bt=nt /w1 /D__WIN32__ /zq $(OPTFLAGS) $(MODEL) $(PRECOMP) /d1 /d__WINDOWS__ $(EXTRACPPFLAGS)
-
+LIBS = $(WXDIR)\lib\$(LIBNAME).lib &
+ $(WXDIR)\lib\regex$(WATCOM_SUFFIX).lib &
+ $(WXDIR)\lib\zlib$(WATCOM_SUFFIX).lib &
+!ifneq wxUSE_GUI 0
+ $(WXDIR)\lib\png$(WATCOM_SUFFIX).lib &
+ $(WXDIR)\lib\tiff$(WATCOM_SUFFIX).lib &
+ $(WXDIR)\lib\jpeg$(WATCOM_SUFFIX).lib &
+!endif
+ $(WATLIBDIR)\comctl32.lib &
+ $(WATLIBDIR)\comdlg32.lib &
+ $(WATLIBDIR)\wsock32.lib &
+ $(WATLIBDIR)\odbc32.lib &
+ $(WATLIBDIR)\ole32.lib &
+ $(WATLIBDIR)\oleaut32.lib &
+ $(WATLIBDIR)\opengl32.lib &
+ $(WATLIBDIR)\uuid.lib
+IFLAGS = -i=$(ARCHINCDIR);$(WXDIR)\include &
+ -i=$(%watcom)\h;$(%watcom)\h\nt &
+ -i=$(WXDIR)\src\regex;$(WXDIR)\src\png;$(WXDIR)\src\zlib;$(WXDIR)\src\jpeg;$(WXDIR)\src\tiff &
+ -i=$(WXDIR)\include\wx\msw\gnuwin32
+RESFLAGS = -q -r -bt=nt /i$(WXDIR)\include /i$(WXDIR)\contrib\include $(WINVERFLAGS)
+
+# NB: /bm switch is needed for thread-safe runtime, if you don't use
+# wxThread you may remove it
+CPPFLAGS = /dWIN32 /bm /fo=$(OUTPUTDIR)\ /fr /zq $(IFLAGS) $(OPTFLAGS) $(WINVERFLAGS) $(EXTRACPPFLAGS)
+!ifeq wxUSE_GUI 0
+CPPFLAGS += /dwxUSE_GUI=0