4cdb08d6d5cffea67a8f0edb72132a3aac8b07b1
[reactos.git] / reactos / tools / rbuild / rbuild.h
1 /*
2 * Copyright (C) 2005 Casper S. Hornstrup
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18 #ifndef __RBUILD_H
19 #define __RBUILD_H
20
21 #include "pch.h"
22
23 #ifdef WIN32
24 #include <direct.h>
25 #include <io.h>
26 #endif/*WIN32*/
27 #include <sys/stat.h>
28 #include <time.h>
29 #ifdef _MSC_VER
30 #include <sys/utime.h>
31 #else/*_MSC_VER*/
32 #include <utime.h>
33 #ifdef WIN32
34 #include <process.h>
35 #endif/*WIN32*/
36 #endif/*_MSC_VER*/
37
38 #include <infhost.h>
39
40 #include "ssprintf.h"
41 #include "exception.h"
42 #include "xml.h"
43
44 class Backend; // forward declaration
45
46 typedef std::vector<std::string> string_list;
47
48 extern std::string ExePrefix;
49 extern std::string ExePostfix;
50 extern std::string sSep;
51 extern std::string sBadSep;
52 extern char cSep;
53 extern char cBadSep;
54
55 #ifdef WIN32
56 #define DEF_EXEPREFIX ""
57 #define DEF_EXEPOSTFIX ".exe"
58 #define DEF_CSEP '\\'
59 #define DEF_CBAD_SEP '/'
60 #define DEF_SSEP "\\"
61 #define DEF_SBAD_SEP "/"
62 #else
63 #define DEF_EXEPREFIX "./"
64 #define DEF_EXEPOSTFIX ""
65 #define DEF_CSEP '/'
66 #define DEF_CBAD_SEP '\\'
67 #define DEF_SSEP "/"
68 #define DEF_SBAD_SEP "\\"
69 #endif
70
71 #define MS_VS_DEF_VERSION "7.10"
72
73 class Directory;
74 class Project;
75 class IfableData;
76 class Module;
77 class Include;
78 class Define;
79 class File;
80 class Library;
81 class Invoke;
82 class InvokeFile;
83 class Dependency;
84 class ImportLibrary;
85 class If;
86 class CompilerFlag;
87 class LinkerFlag;
88 class LinkerScript;
89 class Property;
90 class TestSupportCode;
91 class WineResource;
92 class AutomaticDependency;
93 class Bootstrap;
94 class CDFile;
95 class InstallFile;
96 class PchFile;
97 class StubbedComponent;
98 class StubbedSymbol;
99 class CompilationUnit;
100 class FileLocation;
101 class AutoRegister;
102
103 class SourceFileTest;
104
105
106 typedef std::map<std::string,Directory*> directory_map;
107
108 class Directory
109 {
110 public:
111 std::string name;
112 directory_map subdirs;
113 Directory ( const std::string& name );
114 void Add ( const char* subdir );
115 void GenerateTree ( const std::string& parent,
116 bool verbose );
117 std::string EscapeSpaces ( std::string path );
118 void CreateRule ( FILE* f,
119 const std::string& parent );
120 private:
121 bool mkdir_p ( const char* path );
122 std::string ReplaceVariable ( std::string name,
123 std::string value,
124 std::string path );
125 std::string GetEnvironmentVariable ( const std::string& name );
126 void ResolveVariablesInPath ( char* buf,
127 std::string path );
128 bool CreateDirectory ( std::string path );
129 };
130
131
132 class Configuration
133 {
134 public:
135 Configuration ();
136 ~Configuration ();
137 bool Verbose;
138 bool CleanAsYouGo;
139 bool AutomaticDependencies;
140 bool CheckDependenciesForModuleOnly;
141 bool CompilationUnitsEnabled;
142 std::string CheckDependenciesForModuleOnlyModule;
143 std::string VSProjectVersion;
144 bool MakeHandlesInstallDirectories;
145 bool GenerateProxyMakefilesInSourceTree;
146 };
147
148 class Environment
149 {
150 public:
151 static std::string GetVariable ( const std::string& name );
152 static std::string GetIntermediatePath ();
153 static std::string GetOutputPath ();
154 static std::string GetInstallPath ();
155 static std::string GetEnvironmentVariablePathOrDefault ( const std::string& name,
156 const std::string& defaultValue );
157 };
158
159
160 class FileSupportCode
161 {
162 public:
163 static void WriteIfChanged ( char* outbuf,
164 std::string filename );
165 };
166
167
168 class ParseContext
169 {
170 public:
171 If* ifData;
172 CompilationUnit* compilationUnit;
173 ParseContext ();
174 };
175
176
177 class IfableData
178 {
179 public:
180 std::vector<CompilationUnit*> compilationUnits;
181 std::vector<File*> files;
182 std::vector<Include*> includes;
183 std::vector<Define*> defines;
184 std::vector<Library*> libraries;
185 std::vector<Property*> properties;
186 std::vector<CompilerFlag*> compilerFlags;
187 std::vector<If*> ifs;
188
189 ~IfableData();
190 void ProcessXML();
191 };
192
193 class Project
194 {
195 std::string xmlfile;
196 XMLElement *node, *head;
197 Backend* _backend;
198 public:
199 const Configuration& configuration;
200 std::string name;
201 std::string makefile;
202 XMLIncludes xmlbuildfiles;
203 std::vector<Module*> modules;
204 std::vector<LinkerFlag*> linkerFlags;
205 std::vector<CDFile*> cdfiles;
206 std::vector<InstallFile*> installfiles;
207 IfableData non_if_data;
208
209 Project ( const Configuration& configuration,
210 const std::string& filename );
211 ~Project ();
212 void SetBackend ( Backend* backend ) { _backend = backend; }
213 Backend& GetBackend() { return *_backend; }
214 void WriteConfigurationFile ();
215 void ExecuteInvocations ();
216
217 void ProcessXML ( const std::string& path );
218 Module* LocateModule ( const std::string& name );
219 const Module* LocateModule ( const std::string& name ) const;
220 std::string GetProjectFilename () const;
221 std::string ResolveProperties ( const std::string& s ) const;
222 private:
223 std::string ResolveNextProperty ( std::string& s ) const;
224 const Property* LookupProperty ( const std::string& name ) const;
225 void SetConfigurationOption ( char* s,
226 std::string name,
227 std::string* alternativeName );
228 void SetConfigurationOption ( char* s,
229 std::string name );
230 void ReadXml ();
231 void ProcessXMLSubElement ( const XMLElement& e,
232 const std::string& path,
233 ParseContext& parseContext );
234
235 // disable copy semantics
236 Project ( const Project& );
237 Project& operator = ( const Project& );
238 };
239
240
241 enum ModuleType
242 {
243 BuildTool = 0,
244 StaticLibrary = 1,
245 ObjectLibrary = 2,
246 Kernel = 3,
247 KernelModeDLL = 4,
248 KernelModeDriver = 5,
249 NativeDLL = 6,
250 NativeCUI = 7,
251 Win32DLL = 8,
252 Win32CUI = 9,
253 Win32GUI = 10,
254 BootLoader = 11,
255 BootSector = 12,
256 Iso = 13,
257 LiveIso = 14,
258 Test = 15,
259 RpcServer = 16,
260 RpcClient = 17,
261 Alias = 18
262 };
263
264 enum HostType
265 {
266 HostFalse,
267 HostDefault,
268 HostTrue
269 };
270
271 class Module
272 {
273 public:
274 const Project& project;
275 const XMLElement& node;
276 std::string xmlbuildFile;
277 std::string name;
278 std::string guid;
279 std::string extension;
280 std::string entrypoint;
281 std::string baseaddress;
282 std::string path;
283 ModuleType type;
284 ImportLibrary* importLibrary;
285 bool mangledSymbols;
286 bool isUnicode;
287 Bootstrap* bootstrap;
288 AutoRegister* autoRegister;
289 IfableData non_if_data;
290 std::vector<Invoke*> invocations;
291 std::vector<Dependency*> dependencies;
292 std::vector<CompilerFlag*> compilerFlags;
293 std::vector<LinkerFlag*> linkerFlags;
294 std::vector<StubbedComponent*> stubbedComponents;
295 LinkerScript* linkerScript;
296 PchFile* pch;
297 bool cplusplus;
298 std::string prefix;
299 HostType host;
300 std::string installBase;
301 std::string installName;
302 std::string aliasedModuleName;
303 bool useWRC;
304 bool allowWarnings;
305 bool enabled;
306
307 Module ( const Project& project,
308 const XMLElement& moduleNode,
309 const std::string& modulePath );
310 ~Module ();
311 ModuleType GetModuleType ( const std::string& location,
312 const XMLAttribute& attribute );
313 bool HasImportLibrary () const;
314 bool IsDLL () const;
315 bool GenerateInOutputTree () const;
316 std::string GetTargetName () const; // "foo.exe"
317 std::string GetDependencyPath () const; // "path/foo.exe" or "path/libfoo.a"
318 std::string GetBasePath () const; // "path"
319 std::string GetPath () const; // "path/foo.exe"
320 std::string GetPathWithPrefix ( const std::string& prefix ) const; // "path/prefixfoo.exe"
321 void GetTargets ( string_list& ) const;
322 std::string GetInvocationTarget ( const int index ) const;
323 bool HasFileWithExtension ( const IfableData&, const std::string& extension ) const;
324 void InvokeModule () const;
325 void ProcessXML ();
326 void GetSourceFilenames ( string_list& list,
327 bool includeGeneratedFiles ) const;
328 private:
329 std::string GetDefaultModuleExtension () const;
330 std::string GetDefaultModuleEntrypoint () const;
331 std::string GetDefaultModuleBaseaddress () const;
332 void ProcessXMLSubElement ( const XMLElement& e,
333 const std::string& path,
334 ParseContext& parseContext );
335 };
336
337
338 class Include
339 {
340 public:
341 const Project& project;
342 const Module* module;
343 const XMLElement* node;
344 const Module* baseModule;
345 std::string directory;
346 std::string basePath;
347
348 Include ( const Project& project,
349 const XMLElement* includeNode );
350 Include ( const Project& project,
351 const Module* module,
352 const XMLElement* includeNode );
353 Include ( const Project& project,
354 std::string directory,
355 std::string basePath );
356 ~Include ();
357 void ProcessXML();
358 private:
359 };
360
361
362 class Define
363 {
364 public:
365 const Project& project;
366 const Module* module;
367 const XMLElement& node;
368 std::string name;
369 std::string value;
370
371 Define ( const Project& project,
372 const XMLElement& defineNode );
373 Define ( const Project& project,
374 const Module* module,
375 const XMLElement& defineNode );
376 ~Define();
377 void ProcessXML();
378 private:
379 void Initialize();
380 };
381
382
383 class File
384 {
385 public:
386 std::string name;
387 bool first;
388 std::string switches;
389 bool isPreCompiledHeader;
390
391 File ( const std::string& _name,
392 bool _first,
393 std::string _switches,
394 bool _isPreCompiledHeader );
395
396 void ProcessXML();
397 };
398
399
400 class Library
401 {
402 public:
403 const XMLElement& node;
404 const Module& module;
405 std::string name;
406 const Module* importedModule;
407
408 Library ( const XMLElement& _node,
409 const Module& _module,
410 const std::string& _name );
411
412 void ProcessXML();
413 };
414
415
416 class Invoke
417 {
418 public:
419 const XMLElement& node;
420 const Module& module;
421 const Module* invokeModule;
422 std::vector<InvokeFile*> input;
423 std::vector<InvokeFile*> output;
424
425 Invoke ( const XMLElement& _node,
426 const Module& _module );
427
428 void ProcessXML();
429 void GetTargets ( string_list& targets ) const;
430 std::string GetParameters () const;
431 private:
432 void ProcessXMLSubElement ( const XMLElement& e );
433 void ProcessXMLSubElementInput ( const XMLElement& e );
434 void ProcessXMLSubElementOutput ( const XMLElement& e );
435 };
436
437
438 class InvokeFile
439 {
440 public:
441 const XMLElement& node;
442 std::string name;
443 std::string switches;
444
445 InvokeFile ( const XMLElement& _node,
446 const std::string& _name );
447
448 void ProcessXML ();
449 };
450
451
452 class Dependency
453 {
454 public:
455 const XMLElement& node;
456 const Module& module;
457 const Module* dependencyModule;
458
459 Dependency ( const XMLElement& _node,
460 const Module& _module );
461
462 void ProcessXML();
463 };
464
465
466 class ImportLibrary
467 {
468 public:
469 const XMLElement& node;
470 const Module& module;
471 std::string basename;
472 std::string definition;
473
474 ImportLibrary ( const XMLElement& _node,
475 const Module& module );
476
477 void ProcessXML ();
478 };
479
480
481 class If
482 {
483 public:
484 const XMLElement& node;
485 const Project& project;
486 const Module* module;
487 const bool negated;
488 std::string property, value;
489 IfableData data;
490
491 If ( const XMLElement& node_,
492 const Project& project_,
493 const Module* module_,
494 const bool negated_ = false );
495 ~If();
496
497 void ProcessXML();
498 };
499
500
501 class CompilerFlag
502 {
503 public:
504 const Project& project;
505 const Module* module;
506 const XMLElement& node;
507 std::string flag;
508
509 CompilerFlag ( const Project& project,
510 const XMLElement& compilerFlagNode );
511 CompilerFlag ( const Project& project,
512 const Module* module,
513 const XMLElement& compilerFlagNode );
514 ~CompilerFlag ();
515 void ProcessXML();
516 private:
517 void Initialize();
518 };
519
520
521 class LinkerFlag
522 {
523 public:
524 const Project& project;
525 const Module* module;
526 const XMLElement& node;
527 std::string flag;
528
529 LinkerFlag ( const Project& project,
530 const XMLElement& linkerFlagNode );
531 LinkerFlag ( const Project& project,
532 const Module* module,
533 const XMLElement& linkerFlagNode );
534 ~LinkerFlag ();
535 void ProcessXML();
536 private:
537 void Initialize();
538 };
539
540
541 class LinkerScript
542 {
543 public:
544 const Project& project;
545 const Module* module;
546 const XMLElement& node;
547 const Module* baseModule;
548 std::string directory;
549 std::string basePath;
550
551 LinkerScript ( const Project& project,
552 const Module* module,
553 const XMLElement& node );
554 ~LinkerScript ();
555 void ProcessXML();
556 };
557
558
559 class Property
560 {
561 public:
562 const XMLElement& node;
563 const Project& project;
564 const Module* module;
565 std::string name, value;
566
567 Property ( const XMLElement& node_,
568 const Project& project_,
569 const Module* module_ );
570
571 void ProcessXML();
572 };
573
574
575 class TestSupportCode
576 {
577 public:
578 const Project& project;
579
580 TestSupportCode ( const Project& project );
581 ~TestSupportCode ();
582 void GenerateTestSupportCode ( bool verbose );
583 private:
584 bool IsTestModule ( const Module& module );
585 void GenerateTestSupportCodeForModule ( Module& module,
586 bool verbose );
587 std::string GetHooksFilename ( Module& module );
588 char* WriteStubbedSymbolToHooksFile ( char* buffer,
589 const StubbedComponent& component,
590 const StubbedSymbol& symbol );
591 char* WriteStubbedComponentToHooksFile ( char* buffer,
592 const StubbedComponent& component );
593 void WriteHooksFile ( Module& module );
594 std::string GetStubsFilename ( Module& module );
595 char* WriteStubbedSymbolToStubsFile ( char* buffer,
596 const StubbedComponent& component,
597 const StubbedSymbol& symbol,
598 int stubIndex );
599 char* WriteStubbedComponentToStubsFile ( char* buffer,
600 const StubbedComponent& component,
601 int* stubIndex );
602 void WriteStubsFile ( Module& module );
603 std::string GetStartupFilename ( Module& module );
604 bool IsUnknownCharacter ( char ch );
605 std::string GetTestDispatcherName ( std::string filename );
606 bool IsTestFile ( std::string& filename ) const;
607 void GetSourceFilenames ( string_list& list,
608 Module& module ) const;
609 char* WriteTestDispatcherPrototypesToStartupFile ( char* buffer,
610 Module& module );
611 char* WriteRegisterTestsFunctionToStartupFile ( char* buffer,
612 Module& module );
613 void WriteStartupFile ( Module& module );
614 };
615
616
617 class WineResource
618 {
619 public:
620 const Project& project;
621 std::string bin2res;
622
623 WineResource ( const Project& project,
624 std::string bin2res );
625 ~WineResource ();
626 void UnpackResources ( bool verbose );
627 private:
628 bool IsSpecFile ( const File& file );
629 bool IsWineModule ( const Module& module );
630 bool IsResourceFile ( const File& file );
631 std::string GetResourceFilename ( const Module& module );
632 void UnpackResourcesInModule ( Module& module,
633 bool verbose );
634 };
635
636
637 class SourceFile
638 {
639 public:
640 SourceFile ( AutomaticDependency* automaticDependency,
641 const Module& module,
642 const std::string& filename,
643 SourceFile* parent,
644 bool isNonAutomaticDependency );
645 SourceFile* ParseFile ( const std::string& normalizedFilename );
646 void Parse ();
647 std::string Location () const;
648 std::vector<SourceFile*> files;
649 AutomaticDependency* automaticDependency;
650 const Module& module;
651 std::string filename;
652 std::string filenamePart;
653 std::string directoryPart;
654 std::vector<SourceFile*> parents; /* List of files, this file is included from */
655 bool isNonAutomaticDependency;
656 std::string cachedDependencies;
657 time_t lastWriteTime;
658 time_t youngestLastWriteTime; /* Youngest last write time of this file and all children */
659 SourceFile* youngestFile;
660 private:
661 void GetDirectoryAndFilenameParts ();
662 void Close ();
663 void Open ();
664 void SkipWhitespace ();
665 bool ReadInclude ( std::string& filename,
666 bool& searchCurrentDirectory,
667 bool& includeNext );
668 bool IsIncludedFrom ( const std::string& normalizedFilename );
669 SourceFile* GetParentSourceFile ();
670 bool CanProcessFile ( const std::string& extension );
671 bool IsParentOf ( const SourceFile* parent,
672 const SourceFile* child );
673 std::string buf;
674 const char *p;
675 const char *end;
676 };
677
678
679 class AutomaticDependency
680 {
681 friend class SourceFileTest;
682 public:
683 const Project& project;
684
685 AutomaticDependency ( const Project& project );
686 ~AutomaticDependency ();
687 std::string GetFilename ( const std::string& filename );
688 bool LocateIncludedFile ( const std::string& directory,
689 const std::string& includedFilename,
690 std::string& resolvedFilename );
691 bool LocateIncludedFile ( SourceFile* sourceFile,
692 const Module& module,
693 const std::string& includedFilename,
694 bool searchCurrentDirectory,
695 bool includeNext,
696 std::string& resolvedFilename );
697 SourceFile* RetrieveFromCacheOrParse ( const Module& module,
698 const std::string& filename,
699 SourceFile* parentSourceFile );
700 SourceFile* RetrieveFromCache ( const std::string& filename );
701 void CheckAutomaticDependencies ( bool verbose );
702 void CheckAutomaticDependenciesForModule ( Module& module,
703 bool verbose );
704 private:
705 void GetModulesToCheck ( Module& module, std::vector<const Module*>& modules );
706 void CheckAutomaticDependencies ( const Module& module,
707 bool verbose );
708 void CheckAutomaticDependenciesForFile ( SourceFile* sourceFile );
709 void GetIncludeDirectories ( std::vector<Include*>& includes,
710 const Module& module,
711 Include& currentDirectory,
712 bool searchCurrentDirectory );
713 void GetModuleFiles ( const Module& module,
714 std::vector<File*>& files ) const;
715 void ParseFiles ();
716 void ParseFiles ( const Module& module );
717 void ParseFile ( const Module& module,
718 const File& file );
719 std::map<std::string, SourceFile*> sourcefile_map;
720 };
721
722
723 class Bootstrap
724 {
725 public:
726 const Project& project;
727 const Module* module;
728 const XMLElement& node;
729 std::string base;
730 std::string nameoncd;
731
732 Bootstrap ( const Project& project,
733 const Module* module,
734 const XMLElement& bootstrapNode );
735 ~Bootstrap ();
736 void ProcessXML();
737 private:
738 bool IsSupportedModuleType ( ModuleType type );
739 void Initialize();
740 };
741
742
743 class CDFile
744 {
745 public:
746 const Project& project;
747 const XMLElement& node;
748 std::string name;
749 std::string base;
750 std::string nameoncd;
751 std::string path;
752
753 CDFile ( const Project& project,
754 const XMLElement& bootstrapNode,
755 const std::string& path );
756 ~CDFile ();
757 void ProcessXML();
758 std::string GetPath () const;
759 };
760
761
762 class InstallFile
763 {
764 public:
765 const Project& project;
766 const XMLElement& node;
767 std::string name;
768 std::string base;
769 std::string newname;
770 std::string path;
771
772 InstallFile ( const Project& project,
773 const XMLElement& bootstrapNode,
774 const std::string& path );
775 ~InstallFile ();
776 void ProcessXML ();
777 std::string GetPath () const;
778 };
779
780
781 class PchFile
782 {
783 public:
784 const XMLElement& node;
785 const Module& module;
786 File file;
787
788 PchFile (
789 const XMLElement& node,
790 const Module& module,
791 const File file );
792 void ProcessXML();
793 };
794
795
796 class StubbedComponent
797 {
798 public:
799 const Module* module;
800 const XMLElement& node;
801 std::string name;
802 std::vector<StubbedSymbol*> symbols;
803
804 StubbedComponent ( const Module* module_,
805 const XMLElement& stubbedComponentNode );
806 ~StubbedComponent ();
807 void ProcessXML ();
808 void ProcessXMLSubElement ( const XMLElement& e );
809 };
810
811
812 class StubbedSymbol
813 {
814 public:
815 const XMLElement& node;
816 std::string symbol;
817 std::string newname;
818 std::string strippedName;
819
820 StubbedSymbol ( const XMLElement& stubbedSymbolNode );
821 ~StubbedSymbol ();
822 void ProcessXML();
823 private:
824 std::string StripSymbol ( std::string symbol );
825 };
826
827
828 class CompilationUnit
829 {
830 public:
831 const Project* project;
832 const Module* module;
833 const XMLElement* node;
834 std::string name;
835 std::vector<File*> files;
836
837 CompilationUnit ( File* file );
838 CompilationUnit ( const Project* project,
839 const Module* module,
840 const XMLElement* node );
841 ~CompilationUnit ();
842 void ProcessXML();
843 bool IsGeneratedFile () const;
844 bool HasFileWithExtension ( const std::string& extension ) const;
845 bool IsFirstFile () const;
846 FileLocation* GetFilename ( Directory* intermediateDirectory ) const;
847 std::string GetSwitches () const;
848 };
849
850
851 class CompilationUnitSupportCode
852 {
853 public:
854 const Project& project;
855
856 CompilationUnitSupportCode ( const Project& project );
857 ~CompilationUnitSupportCode ();
858 void Generate ( bool verbose );
859 private:
860 void GenerateForModule ( Module& module,
861 bool verbose );
862 std::string GetCompilationUnitFilename ( Module& module,
863 CompilationUnit& compilationUnit );
864 void WriteCompilationUnitFile ( Module& module,
865 CompilationUnit& compilationUnit );
866 };
867
868
869 class FileLocation
870 {
871 public:
872 Directory* directory;
873 std::string filename;
874 FileLocation ( Directory* directory,
875 std::string filename );
876 };
877
878
879 enum AutoRegisterType
880 {
881 DllRegisterServer,
882 DllInstall,
883 Both
884 };
885
886 class AutoRegister
887 {
888 public:
889 const Project& project;
890 const Module* module;
891 const XMLElement& node;
892 std::string infSection;
893 AutoRegisterType type;
894 AutoRegister ( const Project& project_,
895 const Module* module_,
896 const XMLElement& node_ );
897 ~AutoRegister ();
898 void ProcessXML();
899 private:
900 bool IsSupportedModuleType ( ModuleType type );
901 AutoRegisterType GetAutoRegisterType( std::string type );
902 void Initialize ();
903 };
904
905
906 class SysSetupGenerator
907 {
908 public:
909 const Project& project;
910 SysSetupGenerator ( const Project& project );
911 ~SysSetupGenerator ();
912 void Generate ();
913 private:
914 std::string GetDirectoryId ( const Module& module );
915 std::string GetFlags ( const Module& module );
916 void Generate ( HINF inf,
917 const Module& module );
918 };
919
920
921 extern void
922 InitializeEnvironment ();
923
924 extern std::string
925 Right ( const std::string& s, size_t n );
926
927 extern std::string
928 Replace ( const std::string& s, const std::string& find, const std::string& with );
929
930 extern std::string
931 ChangeSeparator ( const std::string& s,
932 const char fromSeparator,
933 const char toSeparator );
934
935 extern std::string
936 FixSeparator ( const std::string& s );
937
938 extern std::string
939 FixSeparatorForSystemCommand ( const std::string& s );
940
941 extern std::string
942 DosSeparator ( const std::string& s );
943
944 extern std::string
945 ReplaceExtension (
946 const std::string& filename,
947 const std::string& newExtension );
948
949 extern std::string
950 GetSubPath (
951 const std::string& location,
952 const std::string& path,
953 const std::string& att_value );
954
955 extern std::string
956 GetExtension ( const std::string& filename );
957
958 extern std::string
959 GetDirectory ( const std::string& filename );
960
961 extern std::string
962 GetFilename ( const std::string& filename );
963
964 extern std::string
965 NormalizeFilename ( const std::string& filename );
966
967 extern std::string
968 ToLower ( std::string filename );
969
970 #endif /* __RBUILD_H */