]> git.saurik.com Git - wxWidgets.git/blob - distrib/msw/tmake/vcapp.t
second merge of the 2.2 branch (RL)
[wxWidgets.git] / distrib / msw / tmake / vcapp.t
1 #!
2 #! This TMAKE template - Microsoft Visual C++ 6.0 applications
3 #!
4 #${
5 if ( Config("qt") || Config("opengl") ) {
6 Project('CONFIG += windows');
7 }
8 if ( Config("qt") ) {
9 $moc_aware = 1;
10 AddIncludePath(Project('TMAKE_INCDIR_QT'));
11 if ( Config("opengl") ) {
12 Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
13 }
14 Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
15 }
16 if ( Config("opengl") ) {
17 Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
18 }
19 #! wxWindows specific things (added by VZ)
20 #! (1) set -I and -L options
21 #! (2) be sure we have the same project settings as wxWindows.dsp, here it
22 #! means that we must disable C++ exception handling
23 #! (3) define the necessary constants
24 if ( Config("wx") ) {
25 Project('CONFIG += windows');
26 }
27 if ( Config("wxbase") ) {
28 Project('CONFIG += wx');
29 }
30 if ( Config("wx") ) {
31 #! VC 6.0 supports env vars in include path
32 #! $WXDIR = $ENV{'WX'};
33 if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
34 else { $WXDIR = "\$(WXWIN)"; }
35 $TMAKE_INCDIR_WX = $WXDIR . "\\include";
36 AddIncludePath($TMAKE_INCDIR_WX);
37 }
38
39 if ( Config("dll") ) {
40 $DLL="Dll";
41 $DLL_SUFFIX="d";
42 $DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
43 $DLL_FLAGS="/D WXUSINGDLL ";
44 $EXTRA_LIBS="";
45 }
46 else {
47 $DLL="";
48 $DLL_SUFFIX="";
49 $DLL_OR_LIB="wxWindows";
50 $DLL_FLAGS=" ";
51 #! actually this depends on the contents of setup.h
52 $EXTRA_LIBS=Config("wxbase") ? "" : "xpm zlib png jpeg tiff";
53 }
54
55 #! let's be smarter: first of all, if no extension is given, add .lib
56 #! (this allows for LIBS=libname in project files which map either on
57 #! -l libname.lib under Windows or on -llibname under Unix).
58 @libs = split(/\s+/, Project('LIBS'));
59 foreach $lib (@libs) {
60 if ( $lib !~ "\.lib\$" ) { $lib .= ".lib"; }
61 Project('TMAKE_LIBS *= ' . $lib);
62 }
63
64 if ( Config("windows") ) {
65 $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Application';
66 $project{"VC_PROJ_CODE"} = '0x0101';
67 $vc_base_libs = 'kernel32.lib user32.lib gdi32.lib winspool.lib ' .
68 'comdlg32.lib advapi32.lib shell32.lib ole32.lib ' .
69 'oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ';
70 if ( Config("wx") ) {
71 $vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
72
73 $vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib ";
74 $vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB$DLL_SUFFIX.lib ";
75 foreach ( split(/ /, $EXTRA_LIBS) ) {
76 $vc_link_release .= "$WXDIR\\src\\$_\\Release\\$_.lib ";
77 $vc_link_debug .= "$WXDIR\\src\\$_\\Debug\\$_.lib ";
78 }
79 }
80 $vc_link_release .= '/nologo /subsystem:windows /machine:I386';
81 $vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
82
83 foreach ( split(/ /, Project('LIBPATH')) ) {
84 $vc_link_release .= " /libpath:$_\\Release";
85 $vc_link_debug .= " /libpath:$_\\Debug";
86 }
87
88 $vc_cpp_def_common = '/D "WIN32" /D "_WINDOWS" ' . $DLL_FLAGS;
89 $vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
90 $vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
91 } else {
92 $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Console Application';
93 $project{"VC_PROJ_CODE"} = '0x0103';
94 $vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
95 if ( Config("wx") ) {
96 $vc_base_libs .= 'wsock32.lib ';
97 $vc_link_release = "$WXDIR\\Base${DLL}Release\\$DLL_OR_LIB.lib ";
98 $vc_link_debug = "$WXDIR\\Base${DLL}Debug\\$DLL_OR_LIB" . "d.lib ";
99 }
100 $vc_link_release .= '/nologo /subsystem:console /machine:I386';
101 $vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
102
103 $vc_cpp_def_common = '/D "WIN32" /D "_CONSOLE" ' . $DLL_FLAGS;
104 $vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
105 $vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
106 }
107 #! define wxWin debug flags in debug build
108 if ( Config("wx") ) {
109 $vc_cpp_def_debug .= '/MDd /D "__WXDEBUG__" /D "WXDEBUG=1" ';
110 $vc_cpp_def_release .= '/MD '
111 }
112
113 $project{"VC_BASE_LINK_RELEASE"} = $vc_base_libs . $vc_link_release;
114 $project{"VC_BASE_LINK_DEBUG"} = $vc_base_libs . $vc_link_debug;
115 $tmake_libs = Project('TMAKE_LIBS') ? (Project('TMAKE_LIBS') . " ") : "";
116 $project{"VC_LINK_RELEASE"} = $vc_base_libs . $tmake_libs . $vc_link_release;
117 $project{"VC_LINK_DEBUG"} = $vc_base_libs . $tmake_libs . $vc_link_debug;
118
119 $vc_cpp_opt_common1 = '/nologo /W4 ';
120 if ( !Config("wx") ) {
121 $vc_cpp_opt_common1 = $vc_cpp_opt_common1 . '/GX ';
122 }
123 #! else: disable C++ exception handling for wxWindows
124
125 $vc_cpp_opt_release = $vc_cpp_opt_common1 . '/O2 ';
126 $vc_cpp_opt_debug = $vc_cpp_opt_common1 . '/Zi /Od ';
127 $vc_cpp_opt_common = '/YX /FD /c';
128 $project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
129 $project{"VC_BASE_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_cpp_def_debug . $vc_cpp_opt_common;
130 ExpandGlue("INCPATH",'/I "','" /I "','"');
131 if ( $text ne "" ) { $vc_inc = $text . " "; $text = ""; } else { $vc_inc = ""; }
132 ExpandGlue("DEFINES",'/D "','" /D "','"');
133 if ( $text ne "" ) { $vc_def = $text . " "; $text = ""; } else { $vc_def = ""; }
134 if ( Config("wx") ) {
135 #! define wxWindows compilation flags
136 $vc_def .= '/D _WIN32 /D __WIN32__ /D WINVER=0x400 /D __WINDOWS__ /D __WXMSW__ /D __WIN95__ /D __WIN32__ /D _MT ';
137
138 if ( Config("wxbase") ) {
139 $vc_def .= '/D wxUSE_GUI=0 ';
140 }
141 else {
142 $vc_def .= '/D wxUSE_GUI=1 ';
143 }
144 }
145
146 $project{"VC_CPP_INCLUDE"} = $vc_inc;
147 $project{"VC_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_inc . $vc_cpp_def_release . $vc_def . $vc_cpp_opt_common;
148 $project{"VC_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_inc . $vc_cpp_def_debug . $vc_def . $vc_cpp_opt_common;
149
150 if ( Project('RES_FILE') ) {
151 tmake_error(".res files are not supported, use .rc.");
152 }
153
154 $project{"MAKEFILE"} = $project{"PROJECT"} . ".mak";
155 $project{"TARGETAPP"} = $project{"TARGET"} . ".exe";
156 Project('TMAKE_FILETAGS = HEADERS SOURCES TARGET DESTDIR $$FILETAGS');
157 foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
158 $project{$_} =~ s-/-\\-g;
159 }
160 StdInit();
161 if ( defined($project{"DESTDIR"}) ) {
162 $project{"TARGETAPP"} = $project{"DESTDIR"} . "\\" . $project{"TARGETAPP"};
163 $project{"TARGETAPP"} =~ s/\\+/\\/g;
164 }
165 %all_files = ();
166 @files = split(/\s+/,$project{"HEADERS"});
167 foreach ( @files ) { $all_files{$_} = "h" };
168 @files = split(/\s+/,$project{"SOURCES"});
169 foreach ( @files ) { $all_files{$_} = "s" };
170 @files = split(/\s+/,$project{"RC_FILE"});
171 foreach ( @files ) { $all_files{$_} = "r" };
172
173 if ( $moc_aware ) {
174 @files = split(/\s+/,$project{"_HDRMOC"});
175 foreach ( @files ) { $all_files{$_} = "m"; }
176 @files = split(/\s+/,$project{"_SRCMOC"});
177 foreach ( @files ) { $all_files{$_} = "i"; }
178 }
179 %file_names = ();
180 foreach $f ( %all_files ) {
181 $n = $f;
182 $n =~ s/^.*\\//;
183 $file_names{$n} = $f;
184 $file_path{$n} = ".\\" . $f;
185 $file_path2{$n} = (($f =~ /^\./) ? "" : ".\\") . $f;
186 }
187
188 #$}
189 # Microsoft Developer Studio Project File - #$ Substitute('Name="$$TARGET" - Package Owner=<4>');
190 # Microsoft Developer Studio Generated Build File, Format Version 6.00
191 # ** DO NOT EDIT **
192
193 # TARGTYPE #$ Substitute('"$$VC_PROJ_TYPE" $$VC_PROJ_CODE');
194
195 CFG=#$ Substitute('$$TARGET - Win32 Debug');
196 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
197 !MESSAGE use the Export Makefile command and run
198 !MESSAGE
199 !MESSAGE NMAKE /f "#$ ExpandGlue('MAKEFILE','','','".');
200 !MESSAGE
201 !MESSAGE You can specify a configuration when running NMAKE
202 !MESSAGE by defining the macro CFG on the command line. For example:
203 !MESSAGE
204 !MESSAGE NMAKE /f #$ Substitute('"$$MAKEFILE" CFG="$$TARGET - Win32 Debug"');
205 !MESSAGE
206 !MESSAGE Possible choices for configuration are:
207 !MESSAGE
208 !MESSAGE #$ Substitute('"$$TARGET - Win32 Release" (based on "$$VC_PROJ_TYPE")');
209 !MESSAGE #$ Substitute('"$$TARGET - Win32 Debug" (based on "$$VC_PROJ_TYPE")');
210 !MESSAGE
211
212 # Begin Project
213 # PROP Scc_ProjName ""
214 # PROP Scc_LocalPath ""
215 CPP=cl.exe
216 #$ Config("windows") && ($text='MTL=midl.exe');
217 RSC=rc.exe
218
219 !IF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Release"');
220
221 # PROP BASE Use_MFC 0
222 # PROP BASE Use_Debug_Libraries 0
223 # PROP BASE Output_Dir "Release#$ $text = "$DLL" . '"'
224 # PROP BASE Intermediate_Dir "Release#$ $text = "$DLL" . '"'
225 # PROP BASE Target_Dir ""
226 # PROP Use_MFC 0
227 # PROP Use_Debug_Libraries 0
228 # PROP Output_Dir "Release#$ $text = "$DLL" . '"'
229 # PROP Intermediate_Dir "Release#$ $text = "$DLL" . '"'
230 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
231 # PROP Target_Dir ""
232 # ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
233 # ADD CPP #$ Expand("VC_CPP_RELEASE");
234 #$ Config("windows") || DisableOutput();
235 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
236 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
237 #$ Config("windows") || EnableOutput();
238 # ADD BASE RSC /l 0x409 /d "NDEBUG" #$ Expand("VC_CPP_INCLUDE");
239 # ADD RSC /l 0x409 /d "NDEBUG" #$ Expand("VC_CPP_INCLUDE");
240 BSC32=bscmake.exe
241 # ADD BASE BSC32 /nologo
242 # ADD BSC32 /nologo
243 LINK32=link.exe
244 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_RELEASE");
245 # ADD LINK32 #$ Expand("VC_LINK_RELEASE");
246
247 !ELSEIF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Debug"');
248
249 # PROP BASE Use_MFC 0
250 # PROP BASE Use_Debug_Libraries 1
251 # PROP BASE Output_Dir "Debug#$ $text = "$DLL" . '"'
252 # PROP BASE Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
253 # PROP BASE Target_Dir ""
254 # PROP Use_MFC 0
255 # PROP Use_Debug_Libraries 1
256 # PROP Output_Dir "Debug#$ $text = "$DLL" . '"'
257 # PROP Intermediate_Dir "Debug#$ $text = "$DLL" . '"'
258 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
259 # PROP Target_Dir ""
260 # ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
261 # ADD CPP #$ Expand("VC_CPP_DEBUG");
262 #$ Config("windows") || DisableOutput();
263 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
264 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
265 #$ Config("windows") || EnableOutput();
266 # ADD BASE RSC /l 0x409 /d "_DEBUG" #$ Expand("VC_CPP_INCLUDE");
267 # ADD RSC /l 0x409 /d "_DEBUG" #$ Expand("VC_CPP_INCLUDE");
268 BSC32=bscmake.exe
269 # ADD BASE BSC32 /nologo
270 # ADD BSC32 /nologo
271 LINK32=link.exe
272 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_DEBUG");
273 # ADD LINK32 #$ Expand("VC_LINK_DEBUG");
274
275 !ENDIF
276
277 # Begin Target
278
279 # Name #$Substitute('"$$TARGET - Win32 Release"');
280 # Name #$Substitute('"$$TARGET - Win32 Debug"');
281 #${
282 foreach $n ( sort keys %file_names ) {
283 $f = $file_names{$n};
284 $p = $file_path{$n};
285 $p2 = $file_path2{$n};
286 $t = $all_files{$f};
287 if ( ($t eq "h") && $moc_output{$f} ) {
288 my($build);
289 $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
290 . '"' . $moc_output{$f} . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
291 . "\n\tmoc $p2 -o " . $moc_output{$f} . "\n\n"
292 . "# End Custom Build\n\n";
293 $text .= ("# Begin Source File\n\nSOURCE=$p\n\n"
294 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
295 . $build);
296 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
297 . $build
298 . "!ENDIF \n\n# End Source File\n");
299 } elsif ( $t eq "i" ) {
300 my($build,$dn);
301 $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
302 . '"' . $f . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
303 . "\n\tmoc ". $moc_input{$f} . " -o $f\n\n"
304 . "# End Custom Build\n\n";
305 $dn = $n;
306 $dn =~ s/\..*//;
307 $dn =~ tr/a-z/A-Z/;
308 $text .= ("# Begin Source File\n\nSOURCE=$p\n"
309 . "USERDEP__$dn=" . '"' . $moc_input{$f} . '"' . "\n\n"
310 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
311 . $build);
312 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
313 . $build
314 . "!ENDIF \n\n# End Source File\n");
315 } elsif ( $t eq "s" || $t eq "m" || $t eq "h" || $t eq "r" ) {
316 $text .= "# Begin Source File\n\nSOURCE=$p\n";
317 $text .= "# End Source File\n";
318 }
319 }
320 chop $text;
321 #$}
322 # End Target
323 # End Project
324
325 #! vim:sta:sw=4:ts=8:nolist:noet