############################################################################### # File: src/makewat.env # Purpose: Watcom environments for wxWindows makefiles. # Author: Julian Smart and others # Version: $Id$ ############################################################################### # The following environment variables must be set: # # WATCOM: set to where the compiler is installed # WXWIN: set to where the wxWindows is installed # PATH: set correctly, i.e. contains all Watcom directories # LIB: same as PATH # INCLUDE: same as PATH # set wxUSE_GUI=0 to build wxBase instead of (default) wxMSW !ifndef wxUSE_GUI wxUSE_GUI=1 !endif # set FINAL=1 to disable debug and enable optimizations FINAL=0 # set WATCOM_SUFFIX to nothing if you use only Watcom compiler, set it to # something Watcom-specific if you want to build wxWindows with more than one # compiler WATCOM_SUFFIX=_w .EXTENSIONS: .EXTENSIONS: .exe .obj .c .cc .cpp .res .rc .def !ifndef %WATCOM !error WATCOM environment variable must be set! !endif WATCOMDIR=$(%WATCOM) !ifndef %WXWIN !error WXWIN environment variable must be set! !endif WXDIR = $(%WXWIN) # Suffixes OBJSUFF=obj SRCSUFF=cpp !ifeq FINAL 1 WXDEBUG=0 !else WXDEBUG=1 !endif !ifeq WXDEBUG 1 DEBUGFLAGS = /D__WXDEBUG__ DEBUGCFLAGS = $(DEBUGFLAGS) /d2 DEBUGCXXFLAGS = $(DEBUGFLAGS) /d2i DEBUGINFO = debug all DEBUGSUFFIX = d !else DEBUGCFLAGS = DEBUGCXXFLAGS = DEBUGINFO = DEBUGSUFFIX = !endif # TOOLKIT is used as the name of lib subdir containing wx/setup.h # BASEDIRPREFIX is used to construct OUTPUTDIR !ifeq wxUSE_GUI 0 TOOLKIT = base BASEDIRPREFIX = Base LINKOPTION = nt !else TOOLKIT = msw LINKOPTION = nt_win BASEDIRPREFIX = !endif ARCHINCDIR=$(WXDIR)\lib\$(TOOLKIT)$(DEBUGSUFFIX) # set the things which depend on debug/release # # note that the values for LIBPAGESIZE are minimal possible, the library # doesn't link (Error! Library too large) with values smaller than given !ifeq FINAL 1 CONFIGURATION=Release LIBPAGESIZE=/p=1024 !else CONFIGURATION=Debug LIBPAGESIZE=/p=2048 !endif # set OUTPUTDIR to the directory to be used for the .obj files created during # the build (under $WXWIN) !ifndef OUTPUTDIR OUTPUTDIR=$(WXDIR)\$(BASEDIRPREFIX)$(CONFIGURATION)Watcom\ !endif !ifneq NOPRECOMP 1 PRECOMP = /fh=$(OUTPUTDIR)watcom.pch !endif # the basename of the library LIBNAME=wx$(TOOLKIT)$(DEBUGSUFFIX)$(WATCOM_SUFFIX) # You shouldn't have to modify anything after this point ######################################################## # only LEVEL=386 is currently supported, 16 bit compilation is probably broken LEVEL = 386 CXX = wpp$(LEVEL) CC = wcc$(LEVEL) LIB = wlib /q RC = wrc WINVERFLAGS = /dWINVER=0x400 BINDCOMMAND = wrc WATLIBDIR = $(WATCOMDIR)\lib386\nt STACK = option stack=64k 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)\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) # 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 # for PPro: # OPTFLAGS=/oneatx /oh /oi+ /ei /zp8 /6 /fp6 # # optimize for space/time: /os or /ot !ifeq FINAL 1 OPTFLAGS=/oails /5r !else OPTFLAGS=/od !endif # 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 CFLAGS = $(CPPFLAGS) $(DEBUGCFLAGS) $(EXTRACFLAGS) CXXFLAGS = $(CPPFLAGS) $(DEBUGCXXFLAGS) $(PRECOMP) /w=8 $(EXTRACXXFLAGS) .cpp.obj: # $< # .AUTODEPEND *$(CXX) $(CXXFLAGS) $< .c.obj: # $< # .AUTODEPEND *$(CC) $(CFLAGS) $< defaulttarget: all .SYMBOLIC erasepch: .SYMBOLIC -erase $(OUTPUTDIR)watcom.pch