-EXTRALIBS = $(WATLIBDIR)\ctl3d32.lib $(WATLIBDIR)\odbc32.lib
-IFLAGS = -i=$(WXINC) -i=$(%watcom)\h;$(%watcom)\h\nt # -i=$(WXDIR)\include\wx\msw\gnuwin32
-RESFLAGS1 = -r -bt=nt /i$(WXDIR)\include
-RESFLAGS2 = -R $(name) /i$(WXDIR)\include
-
-# 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
+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
+!endif