7 #include "modulehandler.h"
10 #define MKDIR(s) mkdir(s)
12 #define MKDIR(s) mkdir(s, 0755)
20 typedef set
<string
> set_string
;
24 v2s ( const string_list
& v
, int wrap_at
)
30 for ( size_t i
= 0; i
< v
.size(); i
++ )
34 if ( wrap_at
> 0 && wrap_count
++ == wrap_at
)
44 Directory::Directory ( const string
& name_
)
50 Directory::Add ( const char* subdir
)
53 string s1
= string ( subdir
);
54 if ( ( i
= s1
.find ( '$' ) ) != string::npos
)
56 throw InvalidOperationException ( __FILE__
,
58 "No environment variables can be used here. Path was %s",
62 const char* p
= strpbrk ( subdir
, "/\\" );
64 p
= subdir
+ strlen(subdir
);
65 string
s ( subdir
, p
-subdir
);
66 if ( subdirs
.find(s
) == subdirs
.end() )
67 subdirs
[s
] = new Directory(s
);
69 subdirs
[s
]->Add ( p
);
73 Directory::mkdir_p ( const char* path
)
76 directory
= opendir ( path
);
77 if ( directory
!= NULL
)
79 closedir ( directory
);
83 if ( MKDIR ( path
) != 0 )
84 throw AccessDeniedException ( string ( path
) );
89 Directory::CreateDirectory ( string path
)
93 if ( isalpha ( path
[0] ) && path
[1] == ':' && path
[2] == CSEP
)
95 nextIndex
= path
.find ( CSEP
, 3);
98 nextIndex
= path
.find ( CSEP
);
100 bool directoryWasCreated
= false;
101 while ( nextIndex
!= string::npos
)
103 nextIndex
= path
.find ( CSEP
, index
+ 1 );
104 directoryWasCreated
= mkdir_p ( path
.substr ( 0, nextIndex
).c_str () );
107 return directoryWasCreated
;
111 Directory::ReplaceVariable ( string name
,
115 size_t i
= path
.find ( name
);
116 if ( i
!= string::npos
)
117 return path
.replace ( i
, name
.length (), value
);
123 Directory::ResolveVariablesInPath ( char* buf
,
126 string s
= ReplaceVariable ( "$(INTERMEDIATE)", Environment::GetIntermediatePath (), path
);
127 s
= ReplaceVariable ( "$(OUTPUT)", Environment::GetOutputPath (), s
);
128 s
= ReplaceVariable ( "$(INSTALL)", Environment::GetInstallPath (), s
);
129 strcpy ( buf
, s
.c_str () );
133 Directory::GenerateTree ( const string
& parent
,
138 if ( parent
.size () > 0 )
142 path
= parent
+ SSEP
+ name
;
143 ResolveVariablesInPath ( buf
, path
);
144 if ( CreateDirectory ( buf
) && verbose
)
145 printf ( "Created %s\n", buf
);
150 for ( directory_map::iterator i
= subdirs
.begin ();
154 i
->second
->GenerateTree ( path
, verbose
);
159 Directory::EscapeSpaces ( string path
)
166 newpath
= newpath
+ "\\ ";
168 newpath
= newpath
+ *p
;
175 Directory::CreateRule ( FILE* f
,
176 const string
& parent
)
180 if ( parent
.size() > 0 )
182 string escapedParent
= EscapeSpaces ( parent
);
185 escapedParent
.c_str (),
187 EscapeSpaces ( name
).c_str (),
188 escapedParent
.c_str () );
191 "\t$(ECHO_MKDIR)\n" );
196 path
= parent
+ SSEP
+ name
;
201 for ( directory_map::iterator i
= subdirs
.begin();
205 i
->second
->CreateRule ( f
, path
);
210 static class MingwFactory
: public Backend::Factory
213 MingwFactory() : Factory ( "mingw" ) {}
214 Backend
* operator() ( Project
& project
,
215 Configuration
& configuration
)
217 return new MingwBackend ( project
,
223 MingwBackend::MingwBackend ( Project
& project
,
224 Configuration
& configuration
)
225 : Backend ( project
, configuration
),
226 intermediateDirectory ( new Directory ("$(INTERMEDIATE)" ) ),
227 outputDirectory ( new Directory ( "$(OUTPUT)" ) ),
228 installDirectory ( new Directory ( "$(INSTALL)" ) )
233 MingwBackend::~MingwBackend()
235 delete intermediateDirectory
;
236 delete outputDirectory
;
237 delete installDirectory
;
241 MingwBackend::AddDirectoryTarget ( const string
& directory
,
242 Directory
* directoryTree
)
244 if ( directory
.length () > 0)
245 directoryTree
->Add ( directory
.c_str() );
246 return directoryTree
->name
;
250 MingwBackend::ProcessModules ()
252 printf ( "Processing modules..." );
254 vector
<MingwModuleHandler
*> v
;
256 for ( i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
258 Module
& module
= *ProjectNode
.modules
[i
];
259 if ( !module
.enabled
)
261 MingwModuleHandler
* h
= MingwModuleHandler::InstanciateHandler (
264 if ( module
.host
== HostDefault
)
266 module
.host
= h
->DefaultHost();
267 assert ( module
.host
!= HostDefault
);
272 size_t iend
= v
.size ();
274 for ( i
= 0; i
< iend
; i
++ )
275 v
[i
]->GenerateObjectMacro();
276 fprintf ( fMakefile
, "\n" );
277 for ( i
= 0; i
< iend
; i
++ )
278 v
[i
]->GenerateTargetMacro();
279 fprintf ( fMakefile
, "\n" );
281 GenerateAllTarget ( v
);
282 GenerateInitTarget ();
283 GenerateRegTestsRunTarget ();
285 for ( i
= 0; i
< iend
; i
++ )
286 v
[i
]->GenerateOtherMacros();
288 for ( i
= 0; i
< iend
; i
++ )
290 MingwModuleHandler
& h
= *v
[i
];
291 h
.GeneratePreconditionDependencies ();
293 h
.GenerateInvocations ();
294 h
.GenerateCleanTarget ();
295 h
.GenerateInstallTarget ();
303 MingwBackend::Process ()
306 DetectNetwideAssembler ();
307 DetectPipeSupport ();
311 GenerateGlobalVariables ();
312 GenerateXmlBuildFilesMacro ();
314 GenerateInstallTarget ();
315 GenerateTestTarget ();
316 GenerateDirectoryTargets ();
317 GenerateDirectories ();
318 UnpackWineResources ();
319 GenerateTestSupportCode ();
320 GenerateProxyMakefiles ();
321 CheckAutomaticDependencies ();
326 MingwBackend::CreateMakefile ()
328 fMakefile
= fopen ( ProjectNode
.makefile
.c_str (), "w" );
330 throw AccessDeniedException ( ProjectNode
.makefile
);
331 MingwModuleHandler::SetBackend ( this );
332 MingwModuleHandler::SetMakefile ( fMakefile
);
333 MingwModuleHandler::SetUsePch ( use_pch
);
337 MingwBackend::CloseMakefile () const
340 fclose ( fMakefile
);
344 MingwBackend::GenerateHeader () const
346 fprintf ( fMakefile
, "# THIS FILE IS AUTOMATICALLY GENERATED, EDIT 'ReactOS.xml' INSTEAD\n\n" );
350 MingwBackend::GenerateIncludesAndDefines ( IfableData
& data
) const
352 string includeParameters
= MingwModuleHandler::GenerateGccIncludeParametersFromVector ( data
.includes
);
353 string defineParameters
= MingwModuleHandler::GenerateGccDefineParametersFromVector ( data
.defines
);
354 return includeParameters
+ " " + defineParameters
;
358 MingwBackend::GenerateProjectCFlagsMacro ( const char* assignmentOperation
,
359 IfableData
& data
) const
364 assignmentOperation
);
368 GenerateIncludesAndDefines ( data
).c_str() );
370 fprintf ( fMakefile
, "\n" );
374 MingwBackend::GenerateGlobalCFlagsAndProperties (
375 const char* assignmentOperation
,
376 IfableData
& data
) const
380 for ( i
= 0; i
< data
.properties
.size(); i
++ )
382 Property
& prop
= *data
.properties
[i
];
383 fprintf ( fMakefile
, "%s := %s\n",
385 prop
.value
.c_str() );
388 if ( data
.includes
.size() || data
.defines
.size() )
390 GenerateProjectCFlagsMacro ( assignmentOperation
,
394 for ( i
= 0; i
< data
.ifs
.size(); i
++ )
396 If
& rIf
= *data
.ifs
[i
];
397 if ( rIf
.data
.defines
.size()
398 || rIf
.data
.includes
.size()
399 || rIf
.data
.ifs
.size() )
403 "ifeq (\"$(%s)\",\"%s\")\n",
404 rIf
.property
.c_str(),
406 GenerateGlobalCFlagsAndProperties (
417 MingwBackend::GenerateProjectGccOptionsMacro ( const char* assignmentOperation
,
418 IfableData
& data
) const
424 "PROJECT_GCCOPTIONS %s",
425 assignmentOperation
);
427 for ( i
= 0; i
< data
.compilerFlags
.size(); i
++ )
432 data
.compilerFlags
[i
]->flag
.c_str() );
435 fprintf ( fMakefile
, "\n" );
439 MingwBackend::GenerateProjectGccOptions (
440 const char* assignmentOperation
,
441 IfableData
& data
) const
445 if ( data
.compilerFlags
.size() )
447 GenerateProjectGccOptionsMacro ( assignmentOperation
,
451 for ( i
= 0; i
< data
.ifs
.size(); i
++ )
453 If
& rIf
= *data
.ifs
[i
];
454 if ( rIf
.data
.compilerFlags
.size()
455 || rIf
.data
.ifs
.size() )
459 "ifeq (\"$(%s)\",\"%s\")\n",
460 rIf
.property
.c_str(),
462 GenerateProjectGccOptions (
473 MingwBackend::GenerateProjectLFLAGS () const
476 for ( size_t i
= 0; i
< ProjectNode
.linkerFlags
.size (); i
++ )
478 LinkerFlag
& linkerFlag
= *ProjectNode
.linkerFlags
[i
];
479 if ( lflags
.length () > 0 )
481 lflags
+= linkerFlag
.flag
;
487 MingwBackend::GenerateGlobalVariables () const
491 compilerPrefix
.c_str () );
494 nasmCommand
.c_str () );
496 GenerateGlobalCFlagsAndProperties ( "=", ProjectNode
.non_if_data
);
497 GenerateProjectGccOptions ( "=", ProjectNode
.non_if_data
);
499 fprintf ( fMakefile
, "PROJECT_RCFLAGS := $(PROJECT_CFLAGS)\n" );
500 fprintf ( fMakefile
, "PROJECT_WIDLFLAGS := $(PROJECT_CFLAGS)\n" );
501 fprintf ( fMakefile
, "PROJECT_LFLAGS := %s\n",
502 GenerateProjectLFLAGS ().c_str () );
503 fprintf ( fMakefile
, "PROJECT_CFLAGS += -Wall\n" );
504 fprintf ( fMakefile
, "PROJECT_CFLAGS += $(PROJECT_GCCOPTIONS)\n" );
505 fprintf ( fMakefile
, "\n" );
509 MingwBackend::IncludeInAllTarget ( const Module
& module
) const
511 if ( MingwModuleHandler::ReferenceObjects ( module
) )
513 if ( module
.type
== BootSector
)
515 if ( module
.type
== Iso
)
517 if ( module
.type
== LiveIso
)
519 if ( module
.type
== Test
)
525 MingwBackend::GenerateAllTarget ( const vector
<MingwModuleHandler
*>& handlers
) const
527 fprintf ( fMakefile
, "all:" );
529 size_t iend
= handlers
.size ();
530 for ( size_t i
= 0; i
< iend
; i
++ )
532 const Module
& module
= handlers
[i
]->module
;
533 if ( IncludeInAllTarget ( module
) )
535 if ( wrap_count
++ == 5 )
536 fprintf ( fMakefile
, " \\\n\t\t" ), wrap_count
= 0;
539 GetTargetMacro(module
).c_str () );
542 fprintf ( fMakefile
, "\n\t\n\n" );
546 MingwBackend::GetBuildToolDependencies () const
549 for ( size_t i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
551 Module
& module
= *ProjectNode
.modules
[i
];
552 if ( !module
.enabled
)
554 if ( module
.type
== BuildTool
)
556 if ( dependencies
.length () > 0 )
558 dependencies
+= module
.GetDependencyPath ();
565 MingwBackend::GenerateInitTarget () const
569 GetBuildToolDependencies ().c_str () );
570 fprintf ( fMakefile
, "\n" );
574 MingwBackend::GenerateRegTestsRunTarget () const
577 "REGTESTS_RUN_TARGET = regtests.dll\n" );
579 "$(REGTESTS_RUN_TARGET):\n" );
581 "\t$(cp) $(REGTESTS_TARGET) $(REGTESTS_RUN_TARGET)\n" );
582 fprintf ( fMakefile
, "\n" );
586 MingwBackend::GenerateXmlBuildFilesMacro() const
589 "XMLBUILDFILES = %s \\\n",
590 ProjectNode
.GetProjectFilename ().c_str () );
591 string xmlbuildFilenames
;
592 int numberOfExistingFiles
= 0;
593 for ( size_t i
= 0; i
< ProjectNode
.xmlbuildfiles
.size (); i
++ )
595 XMLInclude
& xmlbuildfile
= *ProjectNode
.xmlbuildfiles
[i
];
596 if ( !xmlbuildfile
.fileExists
)
598 numberOfExistingFiles
++;
599 if ( xmlbuildFilenames
.length () > 0 )
600 xmlbuildFilenames
+= " ";
601 xmlbuildFilenames
+= NormalizeFilename ( xmlbuildfile
.topIncludeFilename
);
602 if ( numberOfExistingFiles
% 5 == 4 || i
== ProjectNode
.xmlbuildfiles
.size () - 1 )
606 xmlbuildFilenames
.c_str ());
607 if ( i
== ProjectNode
.xmlbuildfiles
.size () - 1 )
609 fprintf ( fMakefile
, "\n" );
616 xmlbuildFilenames
.resize ( 0 );
618 numberOfExistingFiles
++;
620 fprintf ( fMakefile
, "\n" );
624 MingwBackend::GetBin2ResExecutable ()
626 return NormalizeFilename ( Environment::GetOutputPath () + SSEP
+ "tools/bin2res/bin2res" + EXEPOSTFIX
);
630 MingwBackend::UnpackWineResources ()
632 printf ( "Unpacking WINE resources..." );
633 WineResource
wineResource ( ProjectNode
,
634 GetBin2ResExecutable () );
635 wineResource
.UnpackResources ( configuration
.Verbose
);
640 MingwBackend::GenerateTestSupportCode ()
642 printf ( "Generating test support code..." );
643 TestSupportCode
testSupportCode ( ProjectNode
);
644 testSupportCode
.GenerateTestSupportCode ( configuration
.Verbose
);
649 MingwBackend::GetProxyMakefileTree () const
651 if ( configuration
.GenerateProxyMakefilesInSourceTree
)
654 return Environment::GetOutputPath ();
658 MingwBackend::GenerateProxyMakefiles ()
660 printf ( "Generating proxy makefiles..." );
661 ProxyMakefile
proxyMakefile ( ProjectNode
);
662 proxyMakefile
.GenerateProxyMakefiles ( configuration
.Verbose
,
663 GetProxyMakefileTree () );
668 MingwBackend::CheckAutomaticDependencies ()
670 if ( configuration
.AutomaticDependencies
)
672 printf ( "Checking automatic dependencies..." );
673 AutomaticDependency
automaticDependency ( ProjectNode
);
674 automaticDependency
.Process ();
675 automaticDependency
.CheckAutomaticDependencies ( configuration
.Verbose
);
681 MingwBackend::IncludeDirectoryTarget ( const string
& directory
) const
683 if ( directory
== "$(INTERMEDIATE)" SSEP
"tools")
690 MingwBackend::GenerateDirectories ()
692 printf ( "Creating directories..." );
693 intermediateDirectory
->GenerateTree ( "", configuration
.Verbose
);
694 outputDirectory
->GenerateTree ( "", configuration
.Verbose
);
695 if ( !configuration
.MakeHandlesInstallDirectories
)
696 installDirectory
->GenerateTree ( "", configuration
.Verbose
);
701 MingwBackend::TryToDetectThisCompiler ( const string
& compiler
)
703 string command
= ssprintf (
708 int exitcode
= system ( command
.c_str () );
709 return (exitcode
== 0);
713 MingwBackend::DetectCompiler ()
715 printf ( "Detecting compiler..." );
717 bool detectedCompiler
= false;
718 const string
& ROS_PREFIXValue
= Environment::GetVariable ( "ROS_PREFIX" );
719 if ( ROS_PREFIXValue
.length () > 0 )
721 compilerPrefix
= ROS_PREFIXValue
;
722 compilerCommand
= compilerPrefix
+ "-gcc";
723 detectedCompiler
= TryToDetectThisCompiler ( compilerCommand
);
726 if ( !detectedCompiler
)
729 compilerCommand
= "gcc";
730 detectedCompiler
= TryToDetectThisCompiler ( compilerCommand
);
733 if ( !detectedCompiler
)
735 compilerPrefix
= "mingw32";
736 compilerCommand
= compilerPrefix
+ "-gcc";
737 detectedCompiler
= TryToDetectThisCompiler ( compilerCommand
);
739 if ( detectedCompiler
)
740 printf ( "detected (%s)\n", compilerCommand
.c_str () );
742 printf ( "not detected\n" );
746 MingwBackend::TryToDetectThisNetwideAssembler ( const string
& assembler
)
748 string command
= ssprintf (
753 int exitcode
= system ( command
.c_str () );
754 return (exitcode
== 0);
758 MingwBackend::DetectNetwideAssembler ()
760 printf ( "Detecting netwide assembler..." );
762 nasmCommand
= "nasm";
763 bool detectedNasm
= TryToDetectThisNetwideAssembler ( nasmCommand
);
767 nasmCommand
= "nasmw";
768 detectedNasm
= TryToDetectThisNetwideAssembler ( nasmCommand
);
772 printf ( "detected (%s)\n", nasmCommand
.c_str () );
774 printf ( "not detected\n" );
778 MingwBackend::DetectPipeSupport ()
780 printf ( "Detecting compiler -pipe support..." );
782 string pipe_detection
= "tools" SSEP
"rbuild" SSEP
"backend" SSEP
"mingw" SSEP
"pipe_detection.c";
783 string pipe_detectionObjectFilename
= ReplaceExtension ( pipe_detection
,
785 string command
= ssprintf (
786 "%s -pipe -c %s -o %s 1>%s 2>%s",
787 compilerCommand
.c_str (),
788 pipe_detection
.c_str (),
789 pipe_detectionObjectFilename
.c_str (),
792 int exitcode
= system ( command
.c_str () );
793 FILE* f
= fopen ( pipe_detectionObjectFilename
.c_str (), "rb" );
796 usePipe
= (exitcode
== 0);
798 unlink ( pipe_detectionObjectFilename
.c_str () );
804 printf ( "detected\n" );
806 printf ( "not detected\n" );
810 MingwBackend::DetectPCHSupport ()
812 printf ( "Detecting compiler pre-compiled header support..." );
814 string path
= "tools" SSEP
"rbuild" SSEP
"backend" SSEP
"mingw" SSEP
"pch_detection.h";
815 string cmd
= ssprintf (
816 "%s -c %s 1>%s 2>%s",
817 compilerCommand
.c_str (),
821 system ( cmd
.c_str () );
824 FILE* f
= fopen ( path
.c_str (), "rb" );
829 unlink ( path
.c_str () );
835 printf ( "detected\n" );
837 printf ( "not detected\n" );
841 MingwBackend::GetNonModuleInstallTargetFiles (
842 vector
<string
>& out
) const
844 for ( size_t i
= 0; i
< ProjectNode
.installfiles
.size (); i
++ )
846 const InstallFile
& installfile
= *ProjectNode
.installfiles
[i
];
847 string targetFilenameNoFixup
= installfile
.base
+ SSEP
+ installfile
.newname
;
848 string targetFilename
= MingwModuleHandler::PassThruCacheDirectory (
849 NormalizeFilename ( targetFilenameNoFixup
),
851 out
.push_back ( targetFilename
);
856 MingwBackend::GetModuleInstallTargetFiles (
857 vector
<string
>& out
) const
859 for ( size_t i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
861 const Module
& module
= *ProjectNode
.modules
[i
];
862 if ( !module
.enabled
)
864 if ( module
.installName
.length () > 0 )
866 string targetFilenameNoFixup
;
867 if ( module
.installBase
.length () > 0 )
868 targetFilenameNoFixup
= module
.installBase
+ SSEP
+ module
.installName
;
870 targetFilenameNoFixup
= module
.installName
;
871 string targetFilename
= MingwModuleHandler::PassThruCacheDirectory (
872 NormalizeFilename ( targetFilenameNoFixup
),
874 out
.push_back ( targetFilename
);
880 MingwBackend::GetInstallTargetFiles (
881 vector
<string
>& out
) const
883 GetNonModuleInstallTargetFiles ( out
);
884 GetModuleInstallTargetFiles ( out
);
888 MingwBackend::OutputInstallTarget ( const string
& sourceFilename
,
889 const string
& targetFilename
,
890 const string
& targetDirectory
)
892 string fullTargetFilename
;
893 if ( targetDirectory
.length () > 0)
894 fullTargetFilename
= targetDirectory
+ SSEP
+ targetFilename
;
896 fullTargetFilename
= targetFilename
;
897 string normalizedTargetFilename
= MingwModuleHandler::PassThruCacheDirectory (
898 NormalizeFilename ( fullTargetFilename
),
900 string normalizedTargetDirectory
= MingwModuleHandler::PassThruCacheDirectory (
901 NormalizeFilename ( targetDirectory
),
905 normalizedTargetFilename
.c_str (),
906 sourceFilename
.c_str (),
907 normalizedTargetDirectory
.c_str () );
911 "\t${cp} %s %s 1>$(NUL)\n",
912 sourceFilename
.c_str (),
913 normalizedTargetFilename
.c_str () );
917 MingwBackend::OutputNonModuleInstallTargets ()
919 for ( size_t i
= 0; i
< ProjectNode
.installfiles
.size (); i
++ )
921 const InstallFile
& installfile
= *ProjectNode
.installfiles
[i
];
922 OutputInstallTarget ( installfile
.GetPath (),
929 MingwBackend::OutputModuleInstallTargets ()
931 for ( size_t i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
933 const Module
& module
= *ProjectNode
.modules
[i
];
934 if ( !module
.enabled
)
936 if ( module
.installName
.length () > 0 )
938 string sourceFilename
= MingwModuleHandler::PassThruCacheDirectory (
939 NormalizeFilename ( module
.GetPath () ),
941 OutputInstallTarget ( sourceFilename
,
943 module
.installBase
);
949 MingwBackend::GetRegistrySourceFiles ()
951 return "bootdata" SSEP
"hivecls.inf "
952 "bootdata" SSEP
"hivedef.inf "
953 "bootdata" SSEP
"hiveinst.inf "
954 "bootdata" SSEP
"hivesft.inf "
955 "bootdata" SSEP
"hivesys.inf";
959 MingwBackend::GetRegistryTargetFiles ()
961 string system32ConfigDirectory
= NormalizeFilename (
962 MingwModuleHandler::PassThruCacheDirectory (
963 "system32" SSEP
"config" SSEP
,
964 installDirectory
) );
965 return system32ConfigDirectory
+ SSEP
"default " +
966 system32ConfigDirectory
+ SSEP
"sam " +
967 system32ConfigDirectory
+ SSEP
"security " +
968 system32ConfigDirectory
+ SSEP
"software " +
969 system32ConfigDirectory
+ SSEP
"system";
973 MingwBackend::OutputRegistryInstallTarget ()
975 string system32ConfigDirectory
= NormalizeFilename (
976 MingwModuleHandler::PassThruCacheDirectory (
977 "system32" SSEP
"config" SSEP
,
978 installDirectory
) );
980 string registrySourceFiles
= GetRegistrySourceFiles ();
981 string registryTargetFiles
= GetRegistryTargetFiles ();
983 "install_registry: %s\n",
984 registryTargetFiles
.c_str () );
986 "%s: %s %s $(MKHIVE_TARGET)\n",
987 registryTargetFiles
.c_str (),
988 registrySourceFiles
.c_str (),
989 system32ConfigDirectory
.c_str () );
991 "\t$(ECHO_MKHIVE)\n" );
993 "\t$(MKHIVE_TARGET) bootdata %s bootdata" SSEP
"hiveinst.inf\n",
994 system32ConfigDirectory
.c_str () );
1000 MingwBackend::GenerateInstallTarget ()
1002 vector
<string
> vInstallTargetFiles
;
1003 GetInstallTargetFiles ( vInstallTargetFiles
);
1004 string installTargetFiles
= v2s ( vInstallTargetFiles
, 5 );
1005 string registryTargetFiles
= GetRegistryTargetFiles ();
1007 fprintf ( fMakefile
,
1009 installTargetFiles
.c_str (),
1010 registryTargetFiles
.c_str () );
1011 OutputNonModuleInstallTargets ();
1012 OutputModuleInstallTargets ();
1013 OutputRegistryInstallTarget ();
1014 fprintf ( fMakefile
,
1019 MingwBackend::GetModuleTestTargets (
1020 vector
<string
>& out
) const
1022 for ( size_t i
= 0; i
< ProjectNode
.modules
.size (); i
++ )
1024 const Module
& module
= *ProjectNode
.modules
[i
];
1025 if ( !module
.enabled
)
1027 if ( module
.type
== Test
)
1028 out
.push_back ( module
.name
);
1033 MingwBackend::GenerateTestTarget ()
1035 vector
<string
> vTestTargets
;
1036 GetModuleTestTargets ( vTestTargets
);
1037 string testTargets
= v2s ( vTestTargets
, 5 );
1039 fprintf ( fMakefile
,
1041 testTargets
.c_str () );
1042 fprintf ( fMakefile
,
1047 MingwBackend::GenerateDirectoryTargets ()
1049 intermediateDirectory
->CreateRule ( fMakefile
, "" );
1050 outputDirectory
->CreateRule ( fMakefile
, "" );
1051 installDirectory
->CreateRule ( fMakefile
, "" );