2 #! This TMAKE template - Microsoft Visual C++ 6.0 applications
5 if ( Config("qt") || Config("opengl") ) {
6 Project('CONFIG += windows');
10 AddIncludePath(Project('TMAKE_INCDIR_QT'));
11 if ( Config("opengl") ) {
12 Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT_OPENGL');
14 Project('TMAKE_LIBS *= $$TMAKE_LIBS_QT');
16 if ( Config("opengl") ) {
17 Project('TMAKE_LIBS *= $$TMAKE_LIBS_OPENGL');
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
25 Project('CONFIG += windows');
27 if ( Config("wxbase") ) {
28 Project('CONFIG += wx');
31 if ( Config("wxnodir") ) {
35 #! VC 6.0 supports env vars in include path
36 #! $WXDIR = $ENV{'WX'};
37 if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
38 else { $WXDIR = "\$(WXWIN)"; }
41 AddIncludePath($WXDIR . "\\include");
44 if ( Config("unicode") ) {
47 $UNICODE_FLAGS="/D _UNICODE /D UNICODE ";
49 $project{"TARGET"} .= "Unicode";
50 $project{"MAKEFILE"} .= "Unicode";
58 if ( Config("dll") ) {
61 $DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
62 $DLL_FLAGS="/D WXUSINGDLL ";
65 $project{"TARGET"} .= "Dll";
66 $project{"MAKEFILE"} .= "Dll";
71 $DLL_OR_LIB=Config("wxbase") ? "wxBase" : "wxWindows";
73 #! actually this depends on the contents of setup.h
74 $EXTRA_LIBS=Config("wxbase") ? "" : "zlib png jpeg tiff";
77 #! let's be smarter: first of all, if no extension is given, add .lib
78 #! (this allows for LIBS=libname in project files which map either on
79 #! -l libname.lib under Windows or on -llibname under Unix).
80 @libs = split(/\s+/, Project('LIBS'));
81 foreach $lib (@libs) {
82 if ( $lib !~ "\.lib\$" ) { $lib .= ".lib"; }
83 Project('TMAKE_LIBS *= ' . $lib);
86 if ( Config("windows") ) {
87 $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Application';
88 $project{"VC_PROJ_CODE"} = '0x0101';
89 $vc_base_libs = 'kernel32.lib user32.lib gdi32.lib winspool.lib ' .
90 'comdlg32.lib advapi32.lib shell32.lib ole32.lib ' .
91 'oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ';
93 $vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
95 $vc_link_release = "$WXDIR\\Release$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX.lib ";
96 $vc_link_debug = "$WXDIR\\Debug$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX$DEBUG_SUFFIX.lib ";
97 foreach ( split(/ /, $EXTRA_LIBS) ) {
98 $vc_link_release .= "$WXDIR\\src\\$_\\Release\\$_.lib ";
99 $vc_link_debug .= "$WXDIR\\src\\$_\\Debug\\$_.lib ";
102 $vc_link_release .= '/nologo /subsystem:windows /machine:I386';
103 $vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
105 $vc_cpp_def_common = '/D "WIN32" /D "_WINDOWS" ' . $UNICODE_FLAGS . $DLL_FLAGS;
106 $vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
107 $vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
109 $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Console Application';
110 $project{"VC_PROJ_CODE"} = '0x0103';
111 $vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
112 if ( Config("wx") ) {
113 $vc_base_libs .= 'wsock32.lib ';
114 $vc_link_release = "$WXDIR\\BaseRelease$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX.lib ";
115 $vc_link_debug = "$WXDIR\\BaseDebug$UNICODE$DLL\\$DLL_OR_LIB$UNICODE_SUFFIX$DEBUG_SUFFIX.lib ";
117 $vc_link_release .= '/nologo /subsystem:console /machine:I386';
118 $vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
120 $vc_cpp_def_common = '/D "WIN32" /D "_CONSOLE" ' . $UNICODE_FLAGS . $DLL_FLAGS;
121 $vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
122 $vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
125 foreach ( split(/ /, Project('LIBPATH')) ) {
126 $vc_link_release .= " /libpath:$_\\Release";
127 $vc_link_debug .= " /libpath:$_\\Debug";
130 #! define wxWin debug flags in debug build
131 if ( Config("wx") ) {
132 $vc_cpp_def_debug .= '/MDd /D "__WXDEBUG__" /D "WXDEBUG=1" ';
133 $vc_cpp_def_release .= '/MD '
136 $project{"VC_BASE_LINK_RELEASE"} = $vc_base_libs . $vc_link_release;
137 $project{"VC_BASE_LINK_DEBUG"} = $vc_base_libs . $vc_link_debug;
138 $tmake_libs = Project('TMAKE_LIBS') ? (Project('TMAKE_LIBS') . " ") : "";
139 $project{"VC_LINK_RELEASE"} = $vc_base_libs . $tmake_libs . $vc_link_release;
140 $project{"VC_LINK_DEBUG"} = $vc_base_libs . $tmake_libs . $vc_link_debug;
142 $vc_cpp_opt_common1 = '/nologo /W4 ';
143 if ( !Config("wx") ) {
144 $vc_cpp_opt_common1 = $vc_cpp_opt_common1 . '/GX ';
146 #! else: disable C++ exception handling for wxWindows
148 $vc_cpp_opt_release = $vc_cpp_opt_common1 . '/O1 ';
149 $vc_cpp_opt_debug = $vc_cpp_opt_common1 . '/Zi /Od ';
150 $vc_cpp_opt_common = '/YX /FD /c';
151 $project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
152 $project{"VC_BASE_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_cpp_def_debug . $vc_cpp_opt_common;
153 ExpandGlue("INCPATH",'/I "','" /I "','"');
154 if ( $text ne "" ) { $vc_inc = $text . " "; $text = ""; } else { $vc_inc = ""; }
155 ExpandGlue("DEFINES",'/D "','" /D "','"');
156 if ( $text ne "" ) { $vc_def = $text . " "; $text = ""; } else { $vc_def = ""; }
157 if ( Config("wx") ) {
158 #! define wxWindows compilation flags
159 $vc_def .= '/D _WIN32 /D __WIN32__ /D WINVER=0x400 /D __WINDOWS__ /D __WXMSW__ /D __WIN95__ /D __WIN32__ /D _MT ';
161 if ( Config("wxbase") ) {
162 $vc_def .= '/D wxUSE_GUI=0 ';
165 $vc_def .= '/D wxUSE_GUI=1 ';
169 $project{"VC_CPP_INCLUDE"} = $vc_inc;
170 $project{"VC_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_inc . $vc_cpp_def_release . $vc_def . $vc_cpp_opt_common;
171 $project{"VC_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_inc . $vc_cpp_def_debug . $vc_def . $vc_cpp_opt_common;
173 if ( Project('RES_FILE') ) {
174 tmake_error(".res files are not supported, use .rc.");
177 $project{"MAKEFILE"} = $project{"PROJECT"} . ".mak";
178 $project{"TARGETAPP"} = $project{"TARGET"} . ".exe";
179 Project('TMAKE_FILETAGS = HEADERS SOURCES TARGET DESTDIR $$FILETAGS');
180 foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
181 $project{$_} =~ s-/-\\-g;
184 if ( defined($project{"DESTDIR"}) ) {
185 $project{"TARGETAPP"} = $project{"DESTDIR"} . "\\" . $project{"TARGETAPP"};
186 $project{"TARGETAPP"} =~ s/\\+/\\/g;
189 @files = split(/\s+/,$project{"HEADERS"});
190 foreach ( @files ) { $all_files{$_} = "h" };
191 @files = split(/\s+/,$project{"SOURCES"});
192 foreach ( @files ) { $all_files{$_} = "s" };
193 @files = split(/\s+/,$project{"RC_FILE"});
194 foreach ( @files ) { $all_files{$_} = "r" };
197 @files = split(/\s+/,$project{"_HDRMOC"});
198 foreach ( @files ) { $all_files{$_} = "m"; }
199 @files = split(/\s+/,$project{"_SRCMOC"});
200 foreach ( @files ) { $all_files{$_} = "i"; }
203 foreach $f ( %all_files ) {
206 $file_names{$n} = $f;
207 $file_path{$n} = ".\\" . $f;
208 $file_path2{$n} = (($f =~ /^\./) ? "" : ".\\") . $f;
212 # Microsoft Developer Studio Project File - #$ Substitute('Name="$$TARGET" - Package Owner=<4>');
213 # Microsoft Developer Studio Generated Build File, Format Version 6.00
216 # TARGTYPE #$ Substitute('"$$VC_PROJ_TYPE" $$VC_PROJ_CODE');
218 CFG=#$ Substitute('$$TARGET - Win32 Debug');
219 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
220 !MESSAGE use the Export Makefile command and run
222 !MESSAGE NMAKE /f "#$ ExpandGlue('MAKEFILE','','','".');
224 !MESSAGE You can specify a configuration when running NMAKE
225 !MESSAGE by defining the macro CFG on the command line. For example:
227 !MESSAGE NMAKE /f #$ Substitute('"$$MAKEFILE" CFG="$$TARGET - Win32 Debug"');
229 !MESSAGE Possible choices for configuration are:
231 !MESSAGE #$ Substitute('"$$TARGET - Win32 Release" (based on "$$VC_PROJ_TYPE")');
232 !MESSAGE #$ Substitute('"$$TARGET - Win32 Debug" (based on "$$VC_PROJ_TYPE")');
236 # PROP Scc_ProjName ""
237 # PROP Scc_LocalPath ""
239 #$ Config("windows") && ($text='MTL=midl.exe');
242 !IF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Release"');
244 # PROP BASE Use_MFC 0
245 # PROP BASE Use_Debug_Libraries 0
246 # PROP BASE Output_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
247 # PROP BASE Intermediate_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
248 # PROP BASE Target_Dir ""
250 # PROP Use_Debug_Libraries 0
251 # PROP Output_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
252 # PROP Intermediate_Dir "Release#$ $text = "$UNICODE$DLL" . '"'
253 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
255 # ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
256 # ADD CPP #$ Expand("VC_CPP_RELEASE");
257 #$ Config("windows") || DisableOutput();
258 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
259 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
260 #$ Config("windows") || EnableOutput();
261 # ADD BASE RSC /l 0x409 /d "NDEBUG" #$ Expand("VC_CPP_INCLUDE");
262 # ADD RSC /l 0x409 /d "NDEBUG" #$ Expand("VC_CPP_INCLUDE");
264 # ADD BASE BSC32 /nologo
267 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_RELEASE");
268 # ADD LINK32 #$ Expand("VC_LINK_RELEASE");
270 !ELSEIF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Debug"');
272 # PROP BASE Use_MFC 0
273 # PROP BASE Use_Debug_Libraries 1
274 # PROP BASE Output_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
275 # PROP BASE Intermediate_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
276 # PROP BASE Target_Dir ""
278 # PROP Use_Debug_Libraries 1
279 # PROP Output_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
280 # PROP Intermediate_Dir "Debug#$ $text = "$UNICODE$DLL" . '"'
281 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
283 # ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
284 # ADD CPP #$ Expand("VC_CPP_DEBUG");
285 #$ Config("windows") || DisableOutput();
286 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
287 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
288 #$ Config("windows") || EnableOutput();
289 # ADD BASE RSC /l 0x409 /d "_DEBUG" #$ Expand("VC_CPP_INCLUDE");
290 # ADD RSC /l 0x409 /d "_DEBUG" #$ Expand("VC_CPP_INCLUDE");
292 # ADD BASE BSC32 /nologo
295 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_DEBUG");
296 # ADD LINK32 #$ Expand("VC_LINK_DEBUG");
302 # Name #$Substitute('"$$TARGET - Win32 Release"');
303 # Name #$Substitute('"$$TARGET - Win32 Debug"');
305 foreach $n ( sort keys %file_names ) {
306 $f = $file_names{$n};
308 $p2 = $file_path2{$n};
310 if ( ($t eq "h") && $moc_output{$f} ) {
312 $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
313 . '"' . $moc_output{$f} . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
314 . "\n\tmoc $p2 -o " . $moc_output{$f} . "\n\n"
315 . "# End Custom Build\n\n";
316 $text .= ("# Begin Source File\n\nSOURCE=$p\n\n"
317 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
319 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
321 . "!ENDIF \n\n# End Source File\n");
322 } elsif ( $t eq "i" ) {
324 $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
325 . '"' . $f . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
326 . "\n\tmoc ". $moc_input{$f} . " -o $f\n\n"
327 . "# End Custom Build\n\n";
331 $text .= ("# Begin Source File\n\nSOURCE=$p\n"
332 . "USERDEP__$dn=" . '"' . $moc_input{$f} . '"' . "\n\n"
333 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
335 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
337 . "!ENDIF \n\n# End Source File\n");
338 } elsif ( $t eq "s" || $t eq "m" || $t eq "h" || $t eq "r" ) {
339 $text .= "# Begin Source File\n\nSOURCE=$p\n";
340 $text .= "# End Source File\n";
348 #! vim:sta:sw=4:ts=8:nolist:noet