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