* Implement <autoregister>
[reactos.git] / reactos / tools / rbuild / backend / mingw / mingw.h
index f19cf82..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,56 +32,22 @@ class MingwModuleHandler;
 extern std::string
 v2s ( const string_list& v, int wrap_at );
 
-typedef std::map<std::string,Directory*> directory_map;
-
-
-class Environment
-{
-public:
-       static std::string GetVariable ( const std::string& name );
-};
-
-
-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 );
-       std::string GetEnvironmentVariablePathOrDefault ( const std::string& name,
-                                                         const std::string& defaultValue );
-       std::string GetIntermediatePath ();
-       std::string GetOutputPath ();
-       std::string GetInstallPath ();
-       void ResolveVariablesInPath ( char* buf,
-                                     std::string path );
-       bool CreateDirectory ( std::string path );
-};
-
 
 class MingwBackend : public Backend
 {
 public:
        MingwBackend ( Project& project,
-                      bool verbose,
-                      bool cleanAsYouGo );
-       virtual ~MingwBackend ();
+                      Configuration& configuration );
+       ~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;
@@ -89,14 +72,31 @@ private:
        void GenerateAllTarget ( const std::vector<MingwModuleHandler*>& handlers ) const;
        std::string GetBuildToolDependencies () const;
        void GenerateInitTarget () const;
+       void GenerateRegTestsRunTarget () const;
        void GenerateXmlBuildFilesMacro() const;
+       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;
@@ -113,9 +113,29 @@ private:
        std::string GetRegistryTargetFiles ();
        void OutputRegistryInstallTarget ();
        void GenerateInstallTarget ();
+       void GetModuleTestTargets ( std::vector<std::string>& out ) const;
+       void GenerateTestTarget ();
        void GenerateDirectoryTargets ();
        FILE* fMakefile;
        bool use_pch;
 };
 
+
+class ProxyMakefile
+{
+public:
+       ProxyMakefile ( const Project& project );
+       ~ProxyMakefile ();
+       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,
+                                              std::string outputTree );
+       const Project& project;
+};
+
 #endif /* MINGW_H */