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