* Implement <autoregister>
[reactos.git] / reactos / tools / rbuild / backend / mingw / mingw.h
index b67fb01..4c392d2 100644 (file)
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2005 Casper S. Hornstrup
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
 #ifndef MINGW_H
 #define MINGW_H
 
@@ -15,43 +32,22 @@ class MingwModuleHandler;
 extern std::string
 v2s ( const string_list& v, int wrap_at );
 
-typedef std::map<std::string,Directory*> directory_map;
-
-
-class Directory
-{
-public:
-       std::string name;
-       directory_map subdirs;
-       Directory ( const std::string& name );
-       void Add ( const char* subdir );
-       void GenerateTree ( const std::string& parent,
-                           bool verbose );
-       std::string EscapeSpaces ( std::string path );
-       void CreateRule ( FILE* f,
-                         const std::string& parent );
-private:
-       bool mkdir_p ( const char* path );
-       std::string ReplaceVariable ( std::string name,
-                                     std::string value,
-                                     std::string path );
-       std::string GetEnvironmentVariable ( const std::string& name );
-       void ResolveVariablesInPath ( char* buf,
-                                     std::string path );
-       bool CreateDirectory ( std::string path );
-};
-
 
 class MingwBackend : public Backend
 {
 public:
        MingwBackend ( Project& project,
                       Configuration& configuration );
-       virtual ~MingwBackend ();
+       ~MingwBackend ();
        virtual void Process ();
        std::string AddDirectoryTarget ( const std::string& directory,
                                         Directory* directoryTree );
+       const Module& GetAliasedModuleOrModule ( const Module& module ) const;
+       std::string compilerPrefix;
        std::string compilerCommand;
+       std::string nasmCommand;
+       std::string binutilsPrefix;
+       std::string binutilsCommand;
        bool usePipe;
        Directory* intermediateDirectory;
        Directory* outputDirectory;
@@ -81,14 +77,26 @@ private:
        std::string GetBin2ResExecutable ();
        void UnpackWineResources ();
        void GenerateTestSupportCode ();
+       void GenerateCompilationUnitSupportCode ();
+       void GenerateSysSetup ();
+       std::string GetProxyMakefileTree () const;
        void GenerateProxyMakefiles ();
        void CheckAutomaticDependencies ();
        bool IncludeDirectoryTarget ( const std::string& directory ) const;
        bool TryToDetectThisCompiler ( const std::string& compiler );
        void DetectCompiler ();
+       bool TryToDetectThisNetwideAssembler ( const std::string& assembler );
+       bool TryToDetectThisBinutils ( const std::string& binutils );
+       std::string GetBinutilsVersion ( const std::string& binutilsCommand );
+       bool IsSupportedBinutilsVersion ( const std::string& binutilsVersion );
+       void DetectBinutils ();
+       void DetectNetwideAssembler ();
        void DetectPipeSupport ();
        void DetectPCHSupport ();
+       bool CanEnablePreCompiledHeaderSupportForModule ( const Module& module );
        void ProcessModules ();
+       void CheckAutomaticDependenciesForModuleOnly ();
+       void ProcessNormal ();
        std::string GetNonModuleInstallDirectories ( const std::string& installDirectory );
        std::string GetInstallDirectories ( const std::string& installDirectory );
        void GetNonModuleInstallFiles ( std::vector<std::string>& out ) const;
@@ -118,12 +126,15 @@ class ProxyMakefile
 public:
        ProxyMakefile ( const Project& project );
        ~ProxyMakefile ();
-       void GenerateProxyMakefiles ( bool verbose );
+       void GenerateProxyMakefiles ( bool verbose,
+                                      std::string outputTree );
 private:
        std::string GeneratePathToParentDirectory ( int numberOfParentDirectories );
        std::string GetPathToTopDirectory ( Module& module );
+       bool GenerateProxyMakefile ( Module& module );
        void GenerateProxyMakefileForModule ( Module& module,
-                                              bool verbose );
+                                              bool verbose,
+                                              std::string outputTree );
        const Project& project;
 };