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 #! VC 6.0 supports env vars in include path
32 #! $WXDIR = $ENV{'WX'};
34 $TMAKE_INCDIR_WX = $WXDIR . "\\include";
35 AddIncludePath($TMAKE_INCDIR_WX);
38 if ( Config("dll") ) {
40 $DLL_OR_LIB="wxWinDll";
41 $DLL_FLAGS="/D WXUSINGDLL ";
45 $DLL_OR_LIB="wxWindows";
49 #! let's be smarter: first of all, if no extension is given, add .lib
50 #! (this allows for LIBS=libname in project files which map either on
51 #! -l libname.lib under Windows or on -llibname under Unix).
52 @libs = split(/\s+/, Project('LIBS'));
53 foreach $lib (@libs) {
54 if ( $lib !~ "\.lib\$" ) { $lib .= ".lib"; }
55 Project('TMAKE_LIBS *= ' . $lib);
58 if ( Config("windows") ) {
59 $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Application';
60 $project{"VC_PROJ_CODE"} = '0x0101';
61 $vc_base_libs = 'kernel32.lib user32.lib gdi32.lib winspool.lib ' .
62 'comdlg32.lib advapi32.lib shell32.lib ole32.lib ' .
63 'oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ';
65 $vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
67 $vc_link_release = "$WXDIR\\Release$DLL\\$DLL_OR_LIB.lib $WXDIR\\src\\xpm\\Release\\xpm.lib ";
68 $vc_link_debug = "$WXDIR\\Debug$DLL\\$DLL_OR_LIB.lib $WXDIR\\src\\xpm\\Debug\\xpm.lib ";
70 $vc_link_release .= '/nologo /subsystem:windows /machine:I386';
71 $vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
73 $vc_cpp_def_common = '/D "WIN32" /D "_WINDOWS" ' . $DLL_FLAGS;
74 $vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
75 $vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
77 $project{"VC_PROJ_TYPE"} = 'Win32 (x86) Console Application';
78 $project{"VC_PROJ_CODE"} = '0x0103';
79 $vc_base_libs = 'kernel32.lib user32.lib advapi32.lib ';
81 $vc_base_libs .= 'wsock32.lib ';
82 $vc_link_release = "$WXDIR\\Base${DLL}Release\\wxBase$DLL.lib ";
83 $vc_link_debug = "$WXDIR\\Base${DLL}Debug\\wxBase$DLL.lib ";
85 $vc_link_release .= '/nologo /subsystem:console /machine:I386';
86 $vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
88 $vc_cpp_def_common = '/D "WIN32" /D "_CONSOLE" ' . $DLL_FLAGS;
89 $vc_cpp_def_release = '/D "NDEBUG" ' . $vc_cpp_def_common;
90 $vc_cpp_def_debug = '/D "_DEBUG" ' . $vc_cpp_def_common;
92 #! define wxWin debug flags in debug build
94 $vc_cpp_def_debug .= '/MDd /D "__WXDEBUG__" /D "WXDEBUG=1" ';
95 $vc_cpp_def_release .= '/MD '
98 $project{"VC_BASE_LINK_RELEASE"} = $vc_base_libs . $vc_link_release;
99 $project{"VC_BASE_LINK_DEBUG"} = $vc_base_libs . $vc_link_debug;
100 $tmake_libs = Project('TMAKE_LIBS') ? (Project('TMAKE_LIBS') . " ") : "";
101 $project{"VC_LINK_RELEASE"} = $vc_base_libs . $tmake_libs . $vc_link_release;
102 $project{"VC_LINK_DEBUG"} = $vc_base_libs . $tmake_libs . $vc_link_debug;
104 $vc_cpp_opt_common1 = '/nologo /W4 ';
105 if ( !Config("wx") ) {
106 $vc_cpp_opt_common1 = $vc_cpp_opt_common1 . '/GX ';
108 #! else: disable C++ exception handling for wxWindows
110 $vc_cpp_opt_release = $vc_cpp_opt_common1 . '/O2 ';
111 $vc_cpp_opt_debug = $vc_cpp_opt_common1 . '/Zi /Od ';
112 $vc_cpp_opt_common = '/YX /FD /c';
113 $project{"VC_BASE_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_cpp_def_release . $vc_cpp_opt_common;
114 $project{"VC_BASE_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_cpp_def_debug . $vc_cpp_opt_common;
115 ExpandGlue("INCPATH",'/I "','" /I "','"');
116 if ( $text ne "" ) { $vc_inc = $text . " "; $text = ""; } else { $vc_inc = ""; }
117 ExpandGlue("DEFINES",'/D "','" /D "','"');
118 if ( $text ne "" ) { $vc_def = $text . " "; $text = ""; } else { $vc_def = ""; }
119 if ( Config("wx") ) {
120 #! define wxWindows compilation flags
121 $vc_def .= '/D _WIN32 /D __WIN32__ /D WINVER=0x400 /D __WINDOWS__ /D __WXMSW__ /D __WIN95__ /D __WIN32__ /D _MT ';
123 if ( Config("wxbase") ) {
124 $vc_def .= '/D wxUSE_GUI=0 ';
127 $vc_def .= '/D wxUSE_GUI=1 ';
131 $project{"VC_CPP_INCLUDE"} = $vc_inc;
132 $project{"VC_CPP_RELEASE"} = $vc_cpp_opt_release . $vc_inc . $vc_cpp_def_release . $vc_def . $vc_cpp_opt_common;
133 $project{"VC_CPP_DEBUG"} = $vc_cpp_opt_debug . $vc_inc . $vc_cpp_def_debug . $vc_def . $vc_cpp_opt_common;
135 if ( Project('RES_FILE') ) {
136 tmake_error(".res files are not supported, use .rc.");
139 $project{"MAKEFILE"} = $project{"PROJECT"} . ".mak";
140 $project{"TARGETAPP"} = $project{"TARGET"} . ".exe";
141 Project('TMAKE_FILETAGS = HEADERS SOURCES TARGET DESTDIR $$FILETAGS');
142 foreach ( split(/\s/,Project('TMAKE_FILETAGS')) ) {
143 $project{$_} =~ s-/-\\-g;
146 if ( defined($project{"DESTDIR"}) ) {
147 $project{"TARGETAPP"} = $project{"DESTDIR"} . "\\" . $project{"TARGETAPP"};
148 $project{"TARGETAPP"} =~ s/\\+/\\/g;
151 @files = split(/\s+/,$project{"HEADERS"});
152 foreach ( @files ) { $all_files{$_} = "h" };
153 @files = split(/\s+/,$project{"SOURCES"});
154 foreach ( @files ) { $all_files{$_} = "s" };
155 @files = split(/\s+/,$project{"RC_FILE"});
156 foreach ( @files ) { $all_files{$_} = "r" };
159 @files = split(/\s+/,$project{"_HDRMOC"});
160 foreach ( @files ) { $all_files{$_} = "m"; }
161 @files = split(/\s+/,$project{"_SRCMOC"});
162 foreach ( @files ) { $all_files{$_} = "i"; }
165 foreach $f ( %all_files ) {
168 $file_names{$n} = $f;
169 $file_path{$n} = ".\\" . $f;
170 $file_path2{$n} = (($f =~ /^\./) ? "" : ".\\") . $f;
174 # Microsoft Developer Studio Project File - #$ Substitute('Name="$$TARGET" - Package Owner=<4>');
175 # Microsoft Developer Studio Generated Build File, Format Version 6.00
178 # TARGTYPE #$ Substitute('"$$VC_PROJ_TYPE" $$VC_PROJ_CODE');
180 CFG=#$ Substitute('$$TARGET - Win32 Debug');
181 !MESSAGE This is not a valid makefile. To build this project using NMAKE,
182 !MESSAGE use the Export Makefile command and run
184 !MESSAGE NMAKE /f "#$ ExpandGlue('MAKEFILE','','','".');
186 !MESSAGE You can specify a configuration when running NMAKE
187 !MESSAGE by defining the macro CFG on the command line. For example:
189 !MESSAGE NMAKE /f #$ Substitute('"$$MAKEFILE" CFG="$$TARGET - Win32 Debug"');
191 !MESSAGE Possible choices for configuration are:
193 !MESSAGE #$ Substitute('"$$TARGET - Win32 Release" (based on "$$VC_PROJ_TYPE")');
194 !MESSAGE #$ Substitute('"$$TARGET - Win32 Debug" (based on "$$VC_PROJ_TYPE")');
198 # PROP Scc_ProjName ""
199 # PROP Scc_LocalPath ""
201 #$ Config("windows") && ($text='MTL=midl.exe');
204 !IF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Release"');
206 # PROP BASE Use_MFC 0
207 # PROP BASE Use_Debug_Libraries 0
208 # PROP BASE Output_Dir "Release"
209 # PROP BASE Intermediate_Dir "Release"
210 # PROP BASE Target_Dir ""
212 # PROP Use_Debug_Libraries 0
213 # PROP Output_Dir "Release"
214 # PROP Intermediate_Dir "Release"
215 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
217 # ADD BASE CPP #$ Expand("VC_BASE_CPP_RELEASE");
218 # ADD CPP #$ Expand("VC_CPP_RELEASE");
219 #$ Config("windows") || DisableOutput();
220 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
221 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32
222 #$ Config("windows") || EnableOutput();
223 # ADD BASE RSC /l 0x409 /d "NDEBUG" #$ Expand("VC_CPP_INCLUDE");
224 # ADD RSC /l 0x409 /d "NDEBUG" #$ Expand("VC_CPP_INCLUDE");
226 # ADD BASE BSC32 /nologo
229 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_RELEASE");
230 # ADD LINK32 #$ Expand("VC_LINK_RELEASE");
232 !ELSEIF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Debug"');
234 # PROP BASE Use_MFC 0
235 # PROP BASE Use_Debug_Libraries 1
236 # PROP BASE Output_Dir "Debug"
237 # PROP BASE Intermediate_Dir "Debug"
238 # PROP BASE Target_Dir ""
240 # PROP Use_Debug_Libraries 1
241 # PROP Output_Dir "Debug"
242 # PROP Intermediate_Dir "Debug"
243 #$ Config("windows") && ($text='# PROP Ignore_Export_Lib 0');
245 # ADD BASE CPP #$ Expand("VC_BASE_CPP_DEBUG");
246 # ADD CPP #$ Expand("VC_CPP_DEBUG");
247 #$ Config("windows") || DisableOutput();
248 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
249 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
250 #$ Config("windows") || EnableOutput();
251 # ADD BASE RSC /l 0x409 /d "_DEBUG" #$ Expand("VC_CPP_INCLUDE");
252 # ADD RSC /l 0x409 /d "_DEBUG" #$ Expand("VC_CPP_INCLUDE");
254 # ADD BASE BSC32 /nologo
257 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_DEBUG");
258 # ADD LINK32 #$ Expand("VC_LINK_DEBUG");
264 # Name #$Substitute('"$$TARGET - Win32 Release"');
265 # Name #$Substitute('"$$TARGET - Win32 Debug"');
267 foreach $n ( sort keys %file_names ) {
268 $f = $file_names{$n};
270 $p2 = $file_path2{$n};
272 if ( ($t eq "h") && $moc_output{$f} ) {
274 $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
275 . '"' . $moc_output{$f} . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
276 . "\n\tmoc $p2 -o " . $moc_output{$f} . "\n\n"
277 . "# End Custom Build\n\n";
278 $text .= ("# Begin Source File\n\nSOURCE=$p\n\n"
279 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
281 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
283 . "!ENDIF \n\n# End Source File\n");
284 } elsif ( $t eq "i" ) {
286 $build = "\n\n# Begin Custom Build - Running moc...\nInputPath=" . $p2 . "\n\n"
287 . '"' . $f . '" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"'
288 . "\n\tmoc ". $moc_input{$f} . " -o $f\n\n"
289 . "# End Custom Build\n\n";
293 $text .= ("# Begin Source File\n\nSOURCE=$p\n"
294 . "USERDEP__$dn=" . '"' . $moc_input{$f} . '"' . "\n\n"
295 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
297 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
299 . "!ENDIF \n\n# End Source File\n");
300 } elsif ( $t eq "s" || $t eq "m" || $t eq "h" || $t eq "r" ) {
301 $text .= "# Begin Source File\n\nSOURCE=$p\n";
302 $text .= "# End Source File\n";
310 #! vim:sta:sw=4:ts=8:nolist:noet