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'};
33 if ( $ENV{'wx'} ) { $WXDIR = "\$(wx)"; }
34 else { $WXDIR = "\$(WXWIN)"; }
35 $TMAKE_INCDIR_WX = $WXDIR . "\\include";
36 AddIncludePath($TMAKE_INCDIR_WX);
39 if ( Config("dll") ) {
42 $DLL_OR_LIB=(Config("wxbase") ? "wxbase" : "wxmsw") . "221";
43 $DLL_FLAGS="/D WXUSINGDLL ";
49 $DLL_OR_LIB="wxWindows";
51 #! actually this depends on the contents of setup.h
52 $EXTRA_LIBS=Config("wxbase") ? "" : "xpm zlib png jpeg tiff";
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);
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 ';
71 $vc_base_libs .= "comctl32.lib rpcrt4.lib wsock32.lib ";
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 ";
80 $vc_link_release .= '/nologo /subsystem:windows /machine:I386';
81 $vc_link_debug .= '/nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept';
83 foreach ( split(/ /, Project('LIBPATH')) ) {
84 $vc_link_release .= " /libpath:$_\\Release";
85 $vc_link_debug .= " /libpath:$_\\Debug";
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;
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 ';
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 ";
100 $vc_link_release .= '/nologo /subsystem:console /machine:I386';
101 $vc_link_debug .= '/nologo /subsystem:console /debug /machine:I386 /pdbtype:sept';
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;
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 '
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;
119 $vc_cpp_opt_common1 = '/nologo /W4 ';
120 if ( !Config("wx") ) {
121 $vc_cpp_opt_common1 = $vc_cpp_opt_common1 . '/GX ';
123 #! else: disable C++ exception handling for wxWindows
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 ';
138 if ( Config("wxbase") ) {
139 $vc_def .= '/D wxUSE_GUI=0 ';
142 $vc_def .= '/D wxUSE_GUI=1 ';
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;
150 if ( Project('RES_FILE') ) {
151 tmake_error(".res files are not supported, use .rc.");
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;
161 if ( defined($project{"DESTDIR"}) ) {
162 $project{"TARGETAPP"} = $project{"DESTDIR"} . "\\" . $project{"TARGETAPP"};
163 $project{"TARGETAPP"} =~ s/\\+/\\/g;
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" };
174 @files = split(/\s+/,$project{"_HDRMOC"});
175 foreach ( @files ) { $all_files{$_} = "m"; }
176 @files = split(/\s+/,$project{"_SRCMOC"});
177 foreach ( @files ) { $all_files{$_} = "i"; }
180 foreach $f ( %all_files ) {
183 $file_names{$n} = $f;
184 $file_path{$n} = ".\\" . $f;
185 $file_path2{$n} = (($f =~ /^\./) ? "" : ".\\") . $f;
189 # Microsoft Developer Studio Project File - #$ Substitute('Name="$$TARGET" - Package Owner=<4>');
190 # Microsoft Developer Studio Generated Build File, Format Version 6.00
193 # TARGTYPE #$ Substitute('"$$VC_PROJ_TYPE" $$VC_PROJ_CODE');
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
199 !MESSAGE NMAKE /f "#$ ExpandGlue('MAKEFILE','','','".');
201 !MESSAGE You can specify a configuration when running NMAKE
202 !MESSAGE by defining the macro CFG on the command line. For example:
204 !MESSAGE NMAKE /f #$ Substitute('"$$MAKEFILE" CFG="$$TARGET - Win32 Debug"');
206 !MESSAGE Possible choices for configuration are:
208 !MESSAGE #$ Substitute('"$$TARGET - Win32 Release" (based on "$$VC_PROJ_TYPE")');
209 !MESSAGE #$ Substitute('"$$TARGET - Win32 Debug" (based on "$$VC_PROJ_TYPE")');
213 # PROP Scc_ProjName ""
214 # PROP Scc_LocalPath ""
216 #$ Config("windows") && ($text='MTL=midl.exe');
219 !IF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Release"');
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 ""
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');
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");
241 # ADD BASE BSC32 /nologo
244 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_RELEASE");
245 # ADD LINK32 #$ Expand("VC_LINK_RELEASE");
247 !ELSEIF "$(CFG)" == #$ Substitute('"$$TARGET - Win32 Debug"');
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 ""
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');
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");
269 # ADD BASE BSC32 /nologo
272 # ADD BASE LINK32 #$ Expand("VC_BASE_LINK_DEBUG");
273 # ADD LINK32 #$ Expand("VC_LINK_DEBUG");
279 # Name #$Substitute('"$$TARGET - Win32 Release"');
280 # Name #$Substitute('"$$TARGET - Win32 Debug"');
282 foreach $n ( sort keys %file_names ) {
283 $f = $file_names{$n};
285 $p2 = $file_path2{$n};
287 if ( ($t eq "h") && $moc_output{$f} ) {
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"'
296 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
298 . "!ENDIF \n\n# End Source File\n");
299 } elsif ( $t eq "i" ) {
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";
308 $text .= ("# Begin Source File\n\nSOURCE=$p\n"
309 . "USERDEP__$dn=" . '"' . $moc_input{$f} . '"' . "\n\n"
310 . '!IF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Release"'
312 $text .= ('!ELSEIF "$(CFG)" == "' . $project{"TARGET"} . ' - Win32 Debug"'
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";
325 #! vim:sta:sw=4:ts=8:nolist:noet