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