]> git.saurik.com Git - wxWidgets.git/blob - src/makewat.env
new (for wxBase) or updated and (hopefully() improved Watcom makefiles
[wxWidgets.git] / src / makewat.env
1 ###############################################################################
2 # File: src/makewat.env
3 # Purpose: Watcom environments for wxWindows makefiles.
4 # Author: Julian Smart and others
5 # Version: $Id$
6 ###############################################################################
7
8 # The following environment variables must be set:
9 #
10 # WATCOM: set to where the compiler is installed
11 # WXWIN: set to where the wxWindows is installed
12 # PATH: set correctly, i.e. contains all Watcom directories
13 # LIB: same as PATH
14 # INCLUDE: same as PATH
15
16 # set wxUSE_GUI=0 to build wxBase instead of (default) wxMSW
17 !ifndef wxUSE_GUI
18 wxUSE_GUI=1
19 !endif
20
21 # set FINAL=1 to disable debug and enable optimizations
22 FINAL=0
23
24 # set WATCOM_SUFFIX to nothing if you use only Watcom compiler, set it to
25 # something Watcom-specific if you want to build wxWindows with more than one
26 # compiler
27 WATCOM_SUFFIX=_w
28
29 .EXTENSIONS:
30 .EXTENSIONS: .exe .obj .c .cc .cpp .res .rc .def
31
32 !ifndef %WATCOM
33 !error WATCOM environment variable must be set!
34 !endif
35 WATCOMDIR=$(%WATCOM)
36
37 !ifndef %WXWIN
38 !error WXWIN environment variable must be set!
39 !endif
40 WXDIR = $(%WXWIN)
41
42 # Suffixes
43 OBJSUFF=obj
44 SRCSUFF=cpp
45
46 !ifeq FINAL 1
47 WXDEBUG=0
48 !else
49 WXDEBUG=1
50 !endif
51
52 !ifeq WXDEBUG 1
53 DEBUGFLAGS = /D__WXDEBUG__
54 DEBUGCFLAGS = $(DEBUGFLAGS) /d2
55 DEBUGCXXFLAGS = $(DEBUGFLAGS) /d2i
56 DEBUGINFO = debug all
57 DEBUGSUFFIX = d
58 !else
59 DEBUGCFLAGS =
60 DEBUGCXXFLAGS =
61 DEBUGINFO =
62 DEBUGSUFFIX =
63 !endif
64
65 # TOOLKIT is used as the name of lib subdir containing wx/setup.h
66 # BASEDIRPREFIX is used to construct OUTPUTDIR
67 !ifeq wxUSE_GUI 0
68 TOOLKIT = base
69 BASEDIRPREFIX = Base
70 LINKOPTION = nt
71 !else
72 TOOLKIT = msw
73 LINKOPTION = nt_win
74 BASEDIRPREFIX =
75 !endif
76
77 ARCHINCDIR=$(WXDIR)\lib\$(TOOLKIT)$(DEBUGSUFFIX)
78
79 !ifeq FINAL 1
80 CONFIGURATION=Release
81 !else
82 CONFIGURATION=Debug
83 !endif
84
85 # set OUTPUTDIR to the directory to be used for the .obj files created during
86 # the build (under $WXWIN)
87 !ifndef OUTPUTDIR
88 OUTPUTDIR=$(WXDIR)\$(BASEDIRPREFIX)$(CONFIGURATION)Watcom\
89 !endif
90
91 !ifneq NOPRECOMP 1
92 PRECOMP = /fh=$(OUTPUTDIR)watcom.pch
93 !endif
94
95 # the basename of the library
96 LIBNAME=wx$(TOOLKIT)$(DEBUGSUFFIX)$(WATCOM_SUFFIX)
97
98 # You shouldn't have to modify anything after this point
99 ########################################################
100
101 # only LEVEL=386 is currently supported, 16 bit compilation is probably broken
102 LEVEL = 386
103 CXX = wpp$(LEVEL)
104 CC = wcc$(LEVEL)
105 RC = wrc
106 WINVERFLAGS = /dWINVER=0x400
107 BINDCOMMAND = wrc
108 WATLIBDIR = $(WATCOMDIR)\lib386\nt
109 STACK = option stack=64k
110 LIBS = $(WXDIR)\lib\$(LIBNAME).lib &
111 $(WXDIR)\lib\regex$(WATCOM_SUFFIX).lib &
112 $(WXDIR)\lib\zlib$(WATCOM_SUFFIX).lib &
113 !ifneq wxUSE_GUI 0
114 $(WXDIR)\lib\png$(WATCOM_SUFFIX).lib &
115 $(WXDIR)\lib\tiff$(WATCOM_SUFFIX).lib &
116 $(WXDIR)\lib\jpeg$(WATCOM_SUFFIX).lib &
117 !endif
118 $(WATLIBDIR)\comctl32.lib &
119 $(WATLIBDIR)\comdlg32.lib &
120 $(WATLIBDIR)\odbc32.lib &
121 $(WATLIBDIR)\ole32.lib &
122 $(WATLIBDIR)\oleaut32.lib &
123 $(WATLIBDIR)\opengl32.lib &
124 $(WATLIBDIR)\uuid.lib
125 IFLAGS = -i=$(ARCHINCDIR);$(WXDIR)\include &
126 -i=$(%watcom)\h;$(%watcom)\h\nt &
127 -i=$(WXDIR)\src\regex;$(WXDIR)\src\png;$(WXDIR)\src\zlib;$(WXDIR)\src\jpeg;$(WXDIR)\src\tiff &
128 -i=$(WXDIR)\include\wx\msw\gnuwin32
129 RESFLAGS = -q -r -bt=nt /i$(WXDIR)\include /i$(WXDIR)\contrib\include $(WINVERFLAGS)
130
131 # Here are some possible optimization flags:
132 # /5r Pentium timings
133 # /fp5 /fpi87 Inline 80x87 instructions optimized for Pentium: coprocessor must be present
134 # /ox Standard optimizations
135 # /or Reordering for Pentium timings (included in /ox)
136 # The Watcom-recommended flags for optimum Pentium speed are:
137 # /oneatx /zp4 /5 /fpi87 /fp5
138 # for PPro:
139 # OPTFLAGS=/oneatx /oh /oi+ /ei /zp8 /6 /fp6
140 #
141 # optimize for space/time: /os or /ot
142 !ifeq FINAL 1
143 OPTFLAGS=/oails /5r
144 !else
145 OPTFLAGS=/od
146 !endif
147
148 # NB: /bm switch is needed for thread-safe runtime, if you don't use
149 # wxThread you may remove it
150 CPPFLAGS = /dWIN32 /bm /fo=$(OUTPUTDIR) /fr /zq $(IFLAGS) $(OPTFLAGS) $(WINVERFLAGS) $(EXTRACPPFLAGS)
151 !ifeq wxUSE_GUI 0
152 CPPFLAGS += /dwxUSE_GUI=0
153 !endif
154
155 CFLAGS = $(CPPFLAGS) $(DEBUGCFLAGS) $(EXTRACFLAGS)
156 CXXFLAGS = $(CPPFLAGS) $(DEBUGCXXFLAGS) $(PRECOMP) /w=8 $(EXTRACXXFLAGS)
157
158 .cpp.obj: # $< # .AUTODEPEND
159 *$(CXX) $(CXXFLAGS) $<
160
161 .c.obj: # $< # .AUTODEPEND
162 *$(CC) $(CFLAGS) $<
163
164 defaulttarget: all .SYMBOLIC
165
166 erasepch: .SYMBOLIC
167 -erase $(OUTPUTDIR)watcom.pch