]>
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 | 5 | # Version: $Id$ |
ddea7eb6 | 6 | # Changelist: 2003-02-25 - Juergen Ulbts - update from wxWindows 2.5.x/HEAD branch |
a0499e2f VZ |
7 | ############################################################################### |
8 | ||
9 | # The following environment variables must be set: | |
2bda0e17 KB |
10 | # |
11 | # WATCOM: set to where the compiler is installed | |
a0499e2f VZ |
12 | # WXWIN: set to where the wxWindows is installed |
13 | # PATH: set correctly, i.e. contains all Watcom directories | |
14 | # LIB: same as PATH | |
15 | # INCLUDE: same as PATH | |
16 | ||
17 | # set wxUSE_GUI=0 to build wxBase instead of (default) wxMSW | |
18 | !ifndef wxUSE_GUI | |
19 | wxUSE_GUI=1 | |
20 | !endif | |
2bda0e17 | 21 | |
a0499e2f | 22 | # set FINAL=1 to disable debug and enable optimizations |
5e3841bf | 23 | !ifndef FINAL |
2bda0e17 | 24 | FINAL=0 |
5e3841bf | 25 | !endif |
a0499e2f VZ |
26 | |
27 | # set WATCOM_SUFFIX to nothing if you use only Watcom compiler, set it to | |
28 | # something Watcom-specific if you want to build wxWindows with more than one | |
29 | # compiler | |
30 | WATCOM_SUFFIX=_w | |
2bda0e17 | 31 | |
205b0c9c VZ |
32 | # change/remove this if you want to create programs for older Windows versions, |
33 | # increase the version to be able to use more Win2K+-only features | |
34 | WINVERFLAGS = /dWINVER=0x400 /d_WIN32_IE=0x0300 | |
35 | ||
36 | # optimize for space/time: /os or /ot | |
37 | !ifeq FINAL 1 | |
38 | OPTFLAGS=/oails /5r | |
39 | !else | |
40 | OPTFLAGS=/od | |
41 | !endif | |
42 | ||
43 | ||
44 | ############################################################################### | |
45 | # You shouldn't have to modify anything after this point | |
46 | ############################################################################### | |
47 | ||
7be1f0d9 JS |
48 | .EXTENSIONS: |
49 | .EXTENSIONS: .exe .obj .c .cc .cpp .res .rc .def | |
2bda0e17 | 50 | |
a0499e2f VZ |
51 | !ifndef %WATCOM |
52 | !error WATCOM environment variable must be set! | |
53 | !endif | |
54 | WATCOMDIR=$(%WATCOM) | |
55 | ||
56 | !ifndef %WXWIN | |
57 | !error WXWIN environment variable must be set! | |
58 | !endif | |
7be1f0d9 | 59 | WXDIR = $(%WXWIN) |
2bda0e17 KB |
60 | |
61 | # Suffixes | |
62 | OBJSUFF=obj | |
63 | SRCSUFF=cpp | |
64 | ||
a0499e2f | 65 | !ifeq FINAL 1 |
b2aef89b | 66 | WXDEBUG=0 |
a0499e2f VZ |
67 | !else |
68 | WXDEBUG=1 | |
2bda0e17 KB |
69 | !endif |
70 | ||
7be1f0d9 | 71 | !ifeq WXDEBUG 1 |
a0499e2f VZ |
72 | DEBUGFLAGS = /D__WXDEBUG__ |
73 | DEBUGCFLAGS = $(DEBUGFLAGS) /d2 | |
74 | DEBUGCXXFLAGS = $(DEBUGFLAGS) /d2i | |
2bda0e17 | 75 | DEBUGINFO = debug all |
a0499e2f | 76 | DEBUGSUFFIX = d |
7be1f0d9 | 77 | !else |
a0499e2f VZ |
78 | DEBUGCFLAGS = |
79 | DEBUGCXXFLAGS = | |
7be1f0d9 | 80 | DEBUGINFO = |
a0499e2f VZ |
81 | DEBUGSUFFIX = |
82 | !endif | |
83 | ||
84 | # TOOLKIT is used as the name of lib subdir containing wx/setup.h | |
85 | # BASEDIRPREFIX is used to construct OUTPUTDIR | |
86 | !ifeq wxUSE_GUI 0 | |
87 | TOOLKIT = base | |
88 | BASEDIRPREFIX = Base | |
205b0c9c | 89 | LINKSYSTEM = nt |
a0499e2f VZ |
90 | !else |
91 | TOOLKIT = msw | |
205b0c9c | 92 | LINKSYSTEM = nt_win |
a0499e2f VZ |
93 | BASEDIRPREFIX = |
94 | !endif | |
95 | ||
96 | ARCHINCDIR=$(WXDIR)\lib\$(TOOLKIT)$(DEBUGSUFFIX) | |
97 | ||
efa7066d VZ |
98 | # set the things which depend on debug/release |
99 | # | |
100 | # note that the values for LIBPAGESIZE are minimal possible, the library | |
101 | # doesn't link (Error! Library too large) with values smaller than given | |
a0499e2f VZ |
102 | !ifeq FINAL 1 |
103 | CONFIGURATION=Release | |
efa7066d | 104 | LIBPAGESIZE=/p=1024 |
a0499e2f VZ |
105 | !else |
106 | CONFIGURATION=Debug | |
efa7066d | 107 | LIBPAGESIZE=/p=2048 |
2bda0e17 | 108 | !endif |
2bda0e17 | 109 | |
a0499e2f VZ |
110 | # set OUTPUTDIR to the directory to be used for the .obj files created during |
111 | # the build (under $WXWIN) | |
112 | !ifndef OUTPUTDIR | |
ddea7eb6 CE |
113 | OUTPUTDIR=$(WXDIR)\$(BASEDIRPREFIX)$(CONFIGURATION)Watcom |
114 | # no trailing slash for win98 | |
a0499e2f | 115 | !endif |
2bda0e17 | 116 | |
a0499e2f | 117 | !ifneq NOPRECOMP 1 |
ddea7eb6 | 118 | PRECOMP = /fh=$(OUTPUTDIR)\watcom.pch |
a0499e2f VZ |
119 | !endif |
120 | ||
121 | # the basename of the library | |
122 | LIBNAME=wx$(TOOLKIT)$(DEBUGSUFFIX)$(WATCOM_SUFFIX) | |
123 | ||
a0499e2f | 124 | # only LEVEL=386 is currently supported, 16 bit compilation is probably broken |
2bda0e17 | 125 | LEVEL = 386 |
a0499e2f VZ |
126 | CXX = wpp$(LEVEL) |
127 | CC = wcc$(LEVEL) | |
efa7066d | 128 | LIB = wlib /q |
a0499e2f | 129 | RC = wrc |
2bda0e17 KB |
130 | BINDCOMMAND = wrc |
131 | WATLIBDIR = $(WATCOMDIR)\lib386\nt | |
2bda0e17 | 132 | STACK = option stack=64k |
a0499e2f VZ |
133 | LIBS = $(WXDIR)\lib\$(LIBNAME).lib & |
134 | $(WXDIR)\lib\regex$(WATCOM_SUFFIX).lib & | |
135 | $(WXDIR)\lib\zlib$(WATCOM_SUFFIX).lib & | |
136 | !ifneq wxUSE_GUI 0 | |
137 | $(WXDIR)\lib\png$(WATCOM_SUFFIX).lib & | |
138 | $(WXDIR)\lib\tiff$(WATCOM_SUFFIX).lib & | |
139 | $(WXDIR)\lib\jpeg$(WATCOM_SUFFIX).lib & | |
140 | !endif | |
141 | $(WATLIBDIR)\comctl32.lib & | |
142 | $(WATLIBDIR)\comdlg32.lib & | |
bad79f58 | 143 | $(WATLIBDIR)\wsock32.lib & |
a0499e2f VZ |
144 | $(WATLIBDIR)\odbc32.lib & |
145 | $(WATLIBDIR)\ole32.lib & | |
146 | $(WATLIBDIR)\oleaut32.lib & | |
147 | $(WATLIBDIR)\opengl32.lib & | |
148 | $(WATLIBDIR)\uuid.lib | |
149 | IFLAGS = -i=$(ARCHINCDIR);$(WXDIR)\include & | |
150 | -i=$(%watcom)\h;$(%watcom)\h\nt & | |
151 | -i=$(WXDIR)\src\regex;$(WXDIR)\src\png;$(WXDIR)\src\zlib;$(WXDIR)\src\jpeg;$(WXDIR)\src\tiff & | |
152 | -i=$(WXDIR)\include\wx\msw\gnuwin32 | |
153 | RESFLAGS = -q -r -bt=nt /i$(WXDIR)\include /i$(WXDIR)\contrib\include $(WINVERFLAGS) | |
2bda0e17 | 154 | |
9f51f2b6 VZ |
155 | # NB: /bm switch is needed for thread-safe runtime, if you don't use |
156 | # wxThread you may remove it | |
ddea7eb6 | 157 | CPPFLAGS = /dWIN32 /bm /fo=$(OUTPUTDIR)\ /fr /zq $(IFLAGS) $(OPTFLAGS) $(WINVERFLAGS) $(EXTRACPPFLAGS) |
a0499e2f VZ |
158 | !ifeq wxUSE_GUI 0 |
159 | CPPFLAGS += /dwxUSE_GUI=0 | |
160 | !endif | |
161 | ||
205b0c9c VZ |
162 | # zm and zv as well as the liker options below are used to make the resulting |
163 | # .exe smaller | |
164 | CFLAGS = $(CPPFLAGS) $(DEBUGCFLAGS) $(EXTRACFLAGS) /zm | |
165 | CXXFLAGS = $(CPPFLAGS) $(DEBUGCXXFLAGS) $(PRECOMP) /zm /zv /w=8 $(EXTRACXXFLAGS) | |
166 | LDFLAGS = option eliminate, vfremoval | |
2bda0e17 KB |
167 | |
168 | .cpp.obj: # $< # .AUTODEPEND | |
a0499e2f | 169 | *$(CXX) $(CXXFLAGS) $< |
2bda0e17 | 170 | |
2bda0e17 | 171 | .c.obj: # $< # .AUTODEPEND |
a0499e2f | 172 | *$(CC) $(CFLAGS) $< |
2bda0e17 | 173 | |
a0499e2f | 174 | defaulttarget: all .SYMBOLIC |
2bda0e17 KB |
175 | |
176 | erasepch: .SYMBOLIC | |
ddea7eb6 CE |
177 | -erase $(OUTPUTDIR)\watcom.pch |
178 |