2 #pragma warning ( disable : 4786 )
17 MSVCBackend::_generate_dsp ( FILE* OUT
, const std::string
& moduleName
)
21 Module
& module
= *ProjectNode
.LocateModule ( moduleName
);
23 std::string dsp_file
= DspFileName(module
);
24 my @imports
= @
{module
->{imports
}};
26 bool lib
= (module
->{type
} eq
"lib");
27 my $dll
= (module
->{type
} eq
"dll");
28 my $exe
= (module
->{type
} eq
"exe");
30 my $console
= $exe
; # FIXME: Not always correct
32 // TODO FIXME - not sure if the count here is right...
34 const char* p
= strchr ( dsp_file
.c_str(), '/' );
38 p
= strchr ( p
+1, '/' );
40 std::string msvc_wine_dir
= "..";
42 msvc_wine_dir
+= "\\..";
44 std::string wine_include_dir
= msvc_wine_dir
+ "\\include";
46 //$progress_current++;
47 //$output->progress("$dsp_file (file $progress_current of $progress_max)");
49 my @c_srcs
= @
{module
->{c_srcs
}};
50 my @source_files
= @
{module
->{source_files
}};
51 // TODO FIXME - we don't include header files in our build system
52 //my @header_files = @{module->{header_files}};
53 vector
<string
> header_files
;
54 my @resource_files
= @
{module
->{resource_files
}};
56 if (module
.name
!~ /^wine(?:_unicode
|build
|runtests
|test
)?$
/ &&
57 module
.name
!~ /^(?:gdi32
)_
.+?$
/ &&
58 module
.name
!~ /_test$
/)
60 push @source_files
, "$project.spec" );
61 @source_files
= sort(@source_files
);
65 bool no_msvc_headers
= true;
66 if (module
.name
=~ /^wine(?:runtests
|test
)$
/
67 || module
.name
=~ /_test$
/)
69 no_msvc_headers
= false;
72 std::vector
<std::string
> cfgs
;
74 cfgs
.push_back ( module
.name
+ " - Win32" );
78 std::vector
<std::string
> _cfgs
;
79 for ( i
= 0; i
< cfgs
.size(); i
++ )
81 _cfgs
.push_back ( cfgs
[i
] + " C" );
82 _cfgs
.push_back ( cfgs
[i
] + " C++" );
90 std::vector
<std::string
> _cfgs
;
91 for ( i
= 0; i
< cfgs
.size(); i
++ )
93 _cfgs
.push_back ( cfgs
[i
] + " Debug" );
94 _cfgs
.push_back ( cfgs
[i
] + " Release" );
100 if (!no_msvc_headers
)
102 std::vector
<std::string
> _cfgs
;
103 for ( i
= 0; i
< cfgs
.size(); i
++ )
105 _cfgs
.push_back ( cfgs
[i
] + " MSVC Headers" );
106 _cfgs
.push_back ( cfgs
[i
] + " Wine Headers" );
112 string default_cfg
= cfgs
.back();
114 fprintf ( OUT
, "# Microsoft Developer Studio Project File - Name=\"%s\" - Package Owner=<4>\n", module
.name
.c_str() );
115 fprintf ( OUT
, "# Microsoft Developer Studio Generated Build File, Format Version 6.00\n" );
116 fprintf ( OUT
, "# ** DO NOT EDIT **\n" );
117 fprintf ( OUT
, "\n" );
121 fprintf ( OUT
, "# TARGTYPE \"Win32 (x86) Static Library\" 0x0104\n" );
125 fprintf ( OUT
, "# TARGTYPE \"Win32 (x86) Dynamic-Link Library\" 0x0102\n" );
129 fprintf ( OUT
, "# TARGTYPE \"Win32 (x86) Console Application\" 0x0103\n" );
131 fprintf ( OUT
, "\n" );
133 fprintf ( OUT
, "CFG=$default_cfg\n" );
134 fprintf ( OUT
, "!MESSAGE This is not a valid makefile. To build this project using NMAKE,\n" );
135 fprintf ( OUT
, "!MESSAGE use the Export Makefile command and run\n" );
136 fprintf ( OUT
, "!MESSAGE \n" );
137 fprintf ( OUT
, "!MESSAGE NMAKE /f \"%s.mak\".\n", module
.name
.c_str() );
138 fprintf ( OUT
, "!MESSAGE \n" );
139 fprintf ( OUT
, "!MESSAGE You can specify a configuration when running NMAKE\n" );
140 fprintf ( OUT
, "!MESSAGE by defining the macro CFG on the command line. For example:\n" );
141 fprintf ( OUT
, "!MESSAGE \n" );
142 fprintf ( OUT
, "!MESSAGE NMAKE /f \"%s.mak\" CFG=\"%s\"\n", module
.name
.c_str(), default_cfg
.c_str() );
143 fprintf ( OUT
, "!MESSAGE \n" );
144 fprintf ( OUT
, "!MESSAGE Possible choices for configuration are:\n" );
145 fprintf ( OUT
, "!MESSAGE \n" );
146 for ( i
= 0; i
< cfgs
.size(); i
++ )
148 string
& cfg
= cfgs
[i
];
151 fprintf ( OUT
, "!MESSAGE \"%s\" (based on \"Win32 (x86) Static Library\")\n", cfg
.c_str() );
155 fprintf ( OUT
, "!MESSAGE \"%s\" (based on \"Win32 (x86) Dynamic-Link Library\")\n", cfg
.c_str() );
159 fprintf ( OUT
, "!MESSAGE \"%s\" (based on \"Win32 (x86) Console Application\")\n", cfg
.c_str() );
162 fprintf ( OUT
, "!MESSAGE \n" );
163 fprintf ( OUT
, "\n" );
165 fprintf ( OUT
, "# Begin Project\n" );
166 fprintf ( OUT
, "# PROP AllowPerConfigDependencies 0\n" );
167 fprintf ( OUT
, "# PROP Scc_ProjName \"\"\n" );
168 fprintf ( OUT
, "# PROP Scc_LocalPath \"\"\n" );
169 fprintf ( OUT
, "CPP=cl.exe\n" );
170 if ( !lib
&& !exe
) fprintf ( OUT
, "MTL=midl.exe\n" );
171 fprintf ( OUT
, "RSC=rc.exe\n" );
175 std::string output_dir
;
176 for ( size_t icfg
= 0; icfg
< cfgs
.size(); icfg
++ )
178 std::string
& cfg
= cfgs
[icfg
];
183 fprintf ( OUT
, "!IF \"\$(CFG)\" == \"%s\"\n", cfg
.c_str() );
184 fprintf ( OUT
, "\n" );
188 fprintf ( OUT
, "\n" );
189 fprintf ( OUT
, "!ELSEIF \"\$(CFG)\" == \"%s\"\n", cfg
.c_str() );
190 fprintf ( OUT
, "\n" );
194 bool debug
= !strstr ( cfg
.c_str(), "Release" );
195 bool msvc_headers
= ( 0 != strstr ( cfg
.c_str(), "MSVC Headers" ) );
197 fprintf ( OUT
, "# PROP BASE Use_MFC 0\n" );
201 fprintf ( OUT
, "# PROP BASE Use_Debug_Libraries 1\n" );
205 fprintf ( OUT
, "# PROP BASE Use_Debug_Libraries 0\n" );
208 output_dir
= Replace(cfg
,module
.name
+ " - ","");
209 output_dir
= Replace(output_dir
," ","_");
210 output_dir
= Replace(output_dir
,"C++","Cxx");
211 if ( output_prefix_dir
.size() )
212 output_dir
= output_prefix_dir
+ "\\" + output_dir
;
214 fprintf ( OUT
, "# PROP BASE Output_Dir \"%s\"\n", output_dir
.c_str() );
215 fprintf ( OUT
, "# PROP BASE Intermediate_Dir \"%s\"\n", output_dir
.c_str() );
217 fprintf ( OUT
, "# PROP BASE Target_Dir \"\"\n" );
219 fprintf ( OUT
, "# PROP Use_MFC 0\n" );
222 fprintf ( OUT
, "# PROP Use_Debug_Libraries 1\n" );
226 fprintf ( OUT
, "# PROP Use_Debug_Libraries 0\n" );
228 fprintf ( OUT
, "# PROP Output_Dir \"%s\"\n", output_dir
.c_str() );
229 fprintf ( OUT
, "# PROP Intermediate_Dir \"%s\"\n", output_dir
.c_str() );
231 fprintf ( OUT
, "# PROP Ignore_Export_Lib 0\n" if $dll
;
232 fprintf ( OUT
, "# PROP Target_Dir \"\"\n" );
234 vector
<string
> defines
;
235 defines
.push_back ( "WINVER=0x0501" );
236 defines
.push_back ( "_WIN32_WINNT=0x0501" );
237 defines
.push_back ( "_WIN32_IE=0x0600" );
238 defines
.push_back ( "WIN32" );
239 defines
.push_back ( "_WINDOWS" );
240 defines
.push_back ( "WIN32" );
241 defines
.push_back ( "_MBCS" );
244 defines
.push_back ( "_DEBUG" );
247 fprintf ( OUT
, "# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od" );
248 defines
.push_back ( "_LIB" );
252 fprintf ( OUT
, "# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od" );
253 defines
.push_back ( "_WINDOWS" );
254 defines
.push_back ( "_USRDLL" );
255 defines
.push_back ( string("\U") + module
.name
+ "\E_EXPORTS" );
260 defines
.push_back ( "NDEBUG" );
263 fprintf ( OUT
, "# ADD BASE CPP /nologo /W3 /GX /O2" );
264 defines
.push_back ( "_LIB" );
268 fprintf ( OUT
, "# ADD BASE CPP /nologo /MT /W3 /GX /O2" );
269 defines
.push_back ( "_WINDOWS" );
270 defines
.push_back ( "_USRDLL" );
271 defines
.push_back ( string("\U") + module
.name
+ "\E_EXPORTS" );
275 for ( i
= 0; i
< defines
.size(); i
++ )
277 fprintf ( OUT
, " /D \"%s\"", defines
[i
].c_str() );
279 if ( lib
|| exe
) fprintf ( OUT
, " /YX" );
280 fprintf ( OUT
, " /FD" );
283 fprintf ( OUT
, " /GZ" );
284 if ( lib
|| exe
) fprintf ( OUT
, " " );
286 fprintf ( OUT
, " /c" );
287 fprintf ( OUT
, "\n" );
289 vector
<string
> defines2
;
290 defines2
.push_back ( "WINVER=0x0501" );
291 defines2
.push_back ( "_WIN32_WINNT=0x0501" );
292 defines2
.push_back ( "_WIN32_IE=0x0600" );
293 defines2
.push_back ( "WIN32" );
294 defines2
.push_back ( "_WINDOWS" );
295 defines2
.push_back ( "_MBCS" );
298 defines2
.push_back ( "_DEBUG" );
301 fprintf ( OUT
, "# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od" );
302 defines2
.push_back ( "_LIB" );
306 fprintf ( OUT
, "# ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od" );
307 defines2
.push_back ( "_USRDLL" );
312 defines2
.push_back ( "NDEBUG" );
315 fprintf ( OUT
, "# ADD CPP /nologo /MT /W3 /GX /O2" );
316 defines2
.push_back ( "_LIB" );
320 fprintf ( OUT
, "# ADD CPP /nologo /MT /W3 /GX /O2" );
321 defines2
.push_back ( "_USRDLL" );
325 std::vector
<std::string
> includes
;
328 defines2
.push_back ( string("_\U") + module
.name
+ "\E_" );
329 if ( module
.name
!~ /^(?:wine(?:build
|test
)|.*?_test
)$
/ )
330 defines2
.push_back ( "__WINESRC__" );
332 defines2
.push_back ( "__WINE_USE_NATIVE_HEADERS" );
333 string output_dir2
= Replace(output_dir
,"\\","\\\\");
334 defines2
.push_back ( ssprintf("__WINETEST_OUTPUT_DIR=\\\"%s\\\"",output_dir
.c_str()) );
335 defines2
.push_back ( "__i386__" );
336 defines2
.push_back ( "_X86_" );
338 // TODO FIXME - wine hacks?
339 /*if($project =~ /^gdi32_(?:enhmfdrv|mfdrv)$/) {
340 push @includes, ".." );
343 if ($project =~ /_test$/) {
344 push @includes, "$msvc_wine_dir\\$output_dir" );
347 if (!$msvc_headers || $project eq "winetest") {
348 push @includes, $wine_include_dir;
354 for ( i
= 0; i
< includes
.size(); i
++ );
356 string
& include
= includes
[i
];
357 if ( strpbrk ( include
.c_str(), "[\\\"]" ) )
359 fprintf ( OUT
, " /I \"%s\"", include
.c_str() );
363 fprintf ( OUT
, " /I %s", include
.c_str() );
368 for ( i
= 0; i
< defines2
.size(); i
++ )
370 string
& define
= defines2
[i
];
371 if ( strpbrk ( define
.c_str(), "[\\\"]" ) )
373 fprintf ( OUT
, " /D \"%s\"", define
.c_str() );
377 fprintf ( OUT
, " /D %s", define
.c_str() );
380 if ( wine
) fprintf ( OUT
, " /D inline=__inline" );
381 //fprintf ( OUT, " /D \"__STDC__\"" if 0 && $wine;
383 fprintf ( OUT
, lib
? " /YX" : " /FR" );
384 fprintf ( OUT
, " /FD" );
385 if ( debug
) fprintf ( OUT
, " /GZ" );
386 if ( debug
&& lib
) fprintf ( OUT
, " " );
387 fprintf ( OUT
, " /c" );
388 if ( !no_cpp
) fprintf ( OUT
, " /TP" );
389 fprintf ( OUT
, "\n" );
393 fprintf ( OUT
, "# SUBTRACT CPP /X /YX\n" if $dll
;
394 fprintf ( OUT
, "# ADD BASE MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n" if $dll
;
395 fprintf ( OUT
, "# ADD MTL /nologo /D \"_DEBUG\" /mktyplib203 /win32\n" if $dll
;
396 fprintf ( OUT
, "# ADD BASE RSC /l 0x41d /d \"_DEBUG\"\n" );
397 fprintf ( OUT
, "# ADD RSC /l 0x41d" );
400 for ( i
= 0; i
< includes
.size(); i
++ )
402 fprintf ( OUT
, " /i \"%s\"", includes
[i
].c_str() );
405 fprintf ( OUT
, " /d \"_DEBUG\"\n" );
411 fprintf ( OUT
, "# SUBTRACT CPP /YX\n" );
412 fprintf ( OUT
, "# ADD BASE MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n" );
413 fprintf ( OUT
, "# ADD MTL /nologo /D \"NDEBUG\" /mktyplib203 /win32\n" );
415 fprintf ( OUT
, "# ADD BASE RSC /l 0x41d /d \"NDEBUG\"\n" );
416 fprintf ( OUT
, "# ADD RSC /l 0x41d" );
419 for ( i
= 0; i
< includes
.size(); i
++ )
420 fprintf ( OUT
, " /i \"%s\"", includes
[i
].c_str() );
423 fprintf ( OUT
, "/d \"NDEBUG\"\n" );
425 fprintf ( OUT
, "BSC32=bscmake.exe\n" );
426 fprintf ( OUT
, "# ADD BASE BSC32 /nologo\n" );
427 fprintf ( OUT
, "# ADD BSC32 /nologo\n" );
431 fprintf ( OUT
, "LINK32=link.exe\n" );
432 fprintf ( OUT
, "# ADD BASE LINK32 " );
433 my @libraries
= qw(kernel32
.lib user32
.lib gdi32
.lib winspool
.lib
434 comdlg32
.lib advapi32
.lib shell32
.lib ole32
.lib
435 oleaut32
.lib uuid
.lib odbc32
.lib odbccp32
.lib
);
436 for ( i
= 0; i
< libraries
.size(); i
++ )
438 fprintf ( OUT
, "%s ", libraries
[i
].c_str() );
440 fprintf ( OUT
, " /nologo" );
441 if ( dll
) fprintf ( OUT
, " /dll" );
442 if ( console
) fprintf ( OUT
, " /subsystem:console" );
443 if ( debug
) fprintf ( OUT
, " /debug" );
444 fprintf ( OUT
, " /machine:I386" );
445 if ( debug
) fprintf ( OUT
, " /pdbtype:sept" );
446 fprintf ( OUT
, "\n" );
448 fprintf ( OUT
, "# ADD LINK32" );
449 fprintf ( OUT
, " /nologo" );
450 // TODO FIXME - do we need their kludge?
451 //fprintf ( OUT, " libcmt.lib" if $project =~ /^ntdll$/; # FIXME: Kludge
452 for ( i
= 0; i
< imports
.size(); i
++ )
454 const string
& import
= imports
[i
];
455 if ( import
!= "msvcrt" )
456 fprintf ( OUT
, " %s.lib", import
.c_str() );
458 if ( dll
) fprintf ( OUT
, " /dll" );
459 if ( console
) fprintf ( OUT
, " /subsystem:console" );
460 if ( debug
) fprintf ( OUT
, " /debug" );
461 fprintf ( OUT
, " /machine:I386" );
462 // TODO FIXME - do we need their kludge?
463 //fprintf ( OUT, " /nodefaultlib" if $project =~ /^ntdll$/; # FIXME: Kludge
464 if ( dll
) fprintf ( OUT
, " /def:\"%s.def\"", module
.name
.c_str() )
465 if ( debug
) fprintf ( OUT
, " /pdbtype:sept" );
466 fprintf ( OUT
, "\n" );
470 fprintf ( OUT
, "LIB32=link.exe -lib\n" );
471 fprintf ( OUT
, "# ADD BASE LIB32 /nologo\n" );
472 fprintf ( OUT
, "# ADD LIB32 /nologo\n" );
478 if ( cfgs
.size() != 0 )
480 fprintf ( OUT
, "\n" );
481 fprintf ( OUT
, "!ENDIF \n" );
482 fprintf ( OUT
, "\n" );
485 if ( module
.name
== "winebuild" )
487 fprintf ( OUT
, "# Begin Special Build Tool\n" );
488 fprintf ( OUT
, "SOURCE=\"\$(InputPath)\"\n" );
489 fprintf ( OUT
, "PostBuild_Desc=Copying wine.dll and wine_unicode.dll ...\n" );
490 fprintf ( OUT
, "PostBuild_Cmds=" );
491 fprintf ( OUT
, "copy ..\\..\\library\\$output_dir\\wine.dll \$(OutDir)\t" );
492 fprintf ( OUT
, "copy ..\\..\\unicode\\$output_dir\\wine_unicode.dll \$(OutDir)\n" );
493 fprintf ( OUT
, "# End Special Build Tool\n" );
495 fprintf ( OUT
, "# Begin Target\n" );
496 fprintf ( OUT
, "\n" );
497 for ( i
= 0; i
< cfgs
.size(); i
++ )
499 fprintf ( OUT
, "# Name \"%s\"\n", cfgs
[i
].c_str() );
502 fprintf ( OUT
, "# Begin Group \"Source Files\"\n" );
503 fprintf ( OUT
, "\n" );
504 fprintf ( OUT
, "# PROP Default_Filter \"cpp;c;cxx;rc;def;r;odl;idl;hpj;bat\"\n" );
506 for ( i
= 0; i
< source_files
.size(); i
++ )
508 string source_file
= DosSeparators(source_files
[i
]);
510 if ( strncmp ( source_file
.c_str(), ".\\", 2 ) )
512 source_file
= string(".\\") + source_file
);
515 if ( !strcmp ( &source_file
[source_file
.size()-5], ".spec" ) )
517 string basename
= string ( source_file
, source_file
.size() - 5 );
519 if ( $basename
!~ /\
..{1,3}$
/; ) basename
+= string(".dll");
520 string dbg_c_file
= basename
+ ".dbg.c";
522 fprintf ( OUT
, "# Begin Source File\n" );
523 fprintf ( OUT
, "\n" );
524 fprintf ( OUT
, "SOURCE=%s\n", dbg_c_file
.c_str() );
525 fprintf ( OUT
, "# End Source File\n" );
528 fprintf ( OUT
, "# Begin Source File\n" );
529 fprintf ( OUT
, "\n" );
531 fprintf ( OUT
, "SOURCE=%s\n", source_file
.c_str() );
533 if ( !strcmp ( &source_file
[source_file
.size()-5], ".spec" ) )
535 string basename
= string ( source_file
, source_file
.size() - 5 );
537 string spec_file
= source_file
;
538 string def_file
= basename
+ ".def";
540 if ( $basename
!~ /\
..{1,3}$
/; ) basename
+= ".dll";
541 string dbg_file
= basename
+ ".dbg";
542 string dbg_c_file
= basename
+ ".dbg.c";
544 string srcdir
= "."; // FIXME: Is this really always correct?
546 fprintf ( OUT
, "# Begin Custom Build\n" );
547 fprintf ( OUT
, "InputPath=%s\n", spec_file
.c_str() );
548 fprintf ( OUT
, "\n" );
549 fprintf ( OUT
, "BuildCmds= \\\n" );
550 fprintf ( OUT
, "\t..\\..\\tools\\winebuild\\%s\\winebuild.exe --def %s > %s \\\n",
555 if ( module
.name
=~ /^ntdll$
/ )
558 for ( i
= 0; i
< c_srcs
.size(); i
++ )
560 const string
& c_src
= c_srcs
[i
];
563 fprintf ( OUT
, "\techo %s >> %s \\\n", c_src
.c_str(), dbg_file
.c_str() );
567 fprintf ( OUT
, "\techo %s > %s \\\n", c_src
.c_str(), dbg_file
.c_str() );
570 fprintf ( OUT
, "\t..\\..\\tools\\winebuild\\%s\\winebuild.exe",
571 output_dir
.c_str() );
572 fprintf ( OUT
, " -o %s --debug -C%s %s \\\n",
580 for ( i
= 0; i
< c_srcs
.size(); i
++ )
582 const string
& c_src
= c_srcs
[i
];
583 if ( !strcmp ( &c_src
[c_src
.size()-2], ".c" ) )
585 if ( sc_srcs
.size() )
591 fprintf ( OUT
, "\t..\\..\\tools\\winebuild\\%s\\winebuild.exe",
592 output_dir
.c_str() );
593 fprintf ( OUT
, " -o %s --debug -C%s %s \\\n",
599 fprintf ( OUT
, "\t\n" );
600 fprintf ( OUT
, "\n" );
601 fprintf ( OUT
, "\"%s\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\n", def_file
.c_str() );
602 fprintf ( OUT
, " \$(BuildCmds)\n" );
603 fprintf ( OUT
, "\n" );
604 fprintf ( OUT
, "\"%s\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\n", dbg_c_file
.c_str() );
605 fprintf ( OUT
, " \$(BuildCmds)\n" );
606 fprintf ( OUT
, "# End Custom Build\n" );
608 /*else if ( source_file =~ /([^\\]*?\.h)$/ )
612 foreach my $cfg (@cfgs) {
616 fprintf ( OUT, "!IF \"\$(CFG)\" == \"$cfg\"\n" );
617 fprintf ( OUT, "\n" );
619 fprintf ( OUT, "\n" );
620 fprintf ( OUT, "!ELSEIF \"\$(CFG)\" == \"$cfg\"\n" );
621 fprintf ( OUT, "\n" );
625 $output_dir =~ s/^$project - //;
626 $output_dir =~ s/ /_/g;
627 $output_dir =~ s/C\+\+/Cxx/g;
628 if($output_prefix_dir) {
629 $output_dir = "$output_prefix_dir\\$output_dir" );
632 fprintf ( OUT, "# Begin Custom Build\n" );
633 fprintf ( OUT, "OutDir=%s\n", output_dir.c_str() );
634 fprintf ( OUT, "InputPath=%s\n", source_file.c_str() );
635 fprintf ( OUT, "\n" );
636 fprintf ( OUT, "\"\$(OutDir)\\wine\\%s\" : \$(SOURCE) \"\$(INTDIR)\" \"\$(OUTDIR)\"\n", h_file.c_str() );
637 fprintf ( OUT, "\tcopy \"\$(InputPath)\" \"\$(OutDir)\\wine\"\n" );
638 fprintf ( OUT, "\n" );
639 fprintf ( OUT, "# End Custom Build\n" );
642 if ( cfgs.size() != 0)
644 fprintf ( OUT, "\n" );
645 fprintf ( OUT, "!ENDIF \n" );
646 fprintf ( OUT, "\n" );
650 fprintf ( OUT
, "# End Source File\n" );
652 fprintf ( OUT
, "# End Group\n" );
654 fprintf ( OUT
, "# Begin Group \"Header Files\"\n" );
655 fprintf ( OUT
, "\n" );
656 fprintf ( OUT
, "# PROP Default_Filter \"h;hpp;hxx;hm;inl\"\n" );
657 for ( i
= 0; i
< header_files
.size(); i
++ )
659 const string
& header_file
= header_files
[i
];
660 fprintf ( OUT
, "# Begin Source File\n" );
661 fprintf ( OUT
, "\n" );
662 fprintf ( OUT
, "SOURCE=.\\%s\n", header_file
.c_str() );
663 fprintf ( OUT
, "# End Source File\n" );
665 fprintf ( OUT
, "# End Group\n" );
669 fprintf ( OUT
, "# Begin Group \"Resource Files\"\n" );
670 fprintf ( OUT
, "\n" );
671 fprintf ( OUT
, "# PROP Default_Filter \"ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe\"\n" );
672 for ( i
= 0; i
< resource_files
.size(); i
++ )
674 const string
& resource_file
= resource_files
[i
];
675 fprintf ( OUT
, "# Begin Source File\n" );
676 fprintf ( OUT
, "\n" );
677 fprintf ( OUT
, "SOURCE=.\\%s\n", resource_file
.c_str() );
678 fprintf ( OUT
, "# End Source File\n" );
680 fprintf ( OUT
, "# End Group\n" );
682 fprintf ( OUT
, "# End Target\n" );
683 fprintf ( OUT
, "# End Project\n" );
689 MSVCBackend::_generate_dsw_header ( FILE* OUT
)
691 fprintf ( OUT
, "Microsoft Developer Studio Workspace File, Format Version 6.00\n" );
692 fprintf ( OUT
, "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n" );
693 fprintf ( OUT
, "\n" );
697 MSVCBackend::_generate_dsw_project (
699 const Module
& module
,
700 std::string dsp_file
,
701 const std::vector
<Dependency
*>& dependencies
)
703 dsp_file
= std::string(".\\") + dsp_file
;
704 // TODO FIXME - what does next line do?
705 //$dsp_file =~ y%/%\\%;
707 // TODO FIXME - must they be sorted?
708 //@dependencies = sort(@dependencies);
710 fprintf ( OUT
, "###############################################################################\n" );
711 fprintf ( OUT
, "\n" );
712 fprintf ( OUT
, "Project: \"%s\"=%s - Package Owner=<4>\n", module
.name
.c_str(), dsp_file
.c_str() );
713 fprintf ( OUT
, "\n" );
714 fprintf ( OUT
, "Package=<5>\n" );
715 fprintf ( OUT
, "{{{\n" );
716 fprintf ( OUT
, "}}}\n" );
717 fprintf ( OUT
, "\n" );
718 fprintf ( OUT
, "Package=<4>\n" );
719 fprintf ( OUT
, "{{{\n" );
720 for ( size_t i
= 0; i
< dependencies
.size(); i
++ )
722 Dependency
& dependency
= *dependencies
[i
];
723 fprintf ( OUT
, " Begin Project Dependency\n" );
724 fprintf ( OUT
, " Project_Dep_Name %s\n", dependency
.module
.name
.c_str() );
725 fprintf ( OUT
, " End Project Dependency\n" );
727 fprintf ( OUT
, "}}}\n" );
728 fprintf ( OUT
, "\n" );
732 MSVCBackend::_generate_dsw_footer ( FILE* OUT
)
734 fprintf ( OUT
, "###############################################################################\n" );
735 fprintf ( OUT
, "\n" );
736 fprintf ( OUT
, "Global:\n" );
737 fprintf ( OUT
, "\n" );
738 fprintf ( OUT
, "Package=<5>\n" );
739 fprintf ( OUT
, "{{{\n" );
740 fprintf ( OUT
, "}}}\n" );
741 fprintf ( OUT
, "\n" );
742 fprintf ( OUT
, "Package=<3>\n" );
743 fprintf ( OUT
, "{{{\n" );
744 fprintf ( OUT
, "}}}\n" );
745 fprintf ( OUT
, "\n" );
746 fprintf ( OUT
, "###############################################################################\n" );
747 fprintf ( OUT
, "\n" );
751 MSVCBackend::_generate_wine_dsw ( FILE* OUT
)
753 _generate_dsw_header(OUT
);
754 // TODO FIXME - is it necessary to sort them?
755 for ( size_t i
= 0; i
< ProjectNode
.modules
.size(); i
++ )
756 //foreach my $module (sort(keys(%modules)))
758 Module
& module
= *ProjectNode
.modules
[i
];
760 //my $project = module->{project};
761 std::string dsp_file
= DspFileName ( module
);
763 // TODO FIXME - more wine hacks?
764 /*if($project =~ /^gdi32$/) {
765 foreach my $dir (@gdi32_dirs) {
767 $dir2 =~ s%^.*?/([^/]+)$%$1%;
769 my $module = "gdi32_$dir2";
771 push @dependencies, $module;
775 _generate_dsw_project ( OUT
, module
, dsp_file
, module
.dependencies
);
777 _generate_dsw_footer ( OUT
);