Place .h files generated from .idl definitions in the intermediate directory
authorThomas Bluemel <thomas@reactsoft.com>
Sun, 24 Jun 2007 12:54:54 +0000 (12:54 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Sun, 24 Jun 2007 12:54:54 +0000 (12:54 +0000)
svn path=/trunk/; revision=27269

reactos/ReactOS.rbuild
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/include.cpp
reactos/tools/rbuild/rbuild.h

index 35f27ff..840905d 100644 (file)
@@ -62,6 +62,7 @@
   <include>.</include>
   <include>include</include>
   <include>include/psdk</include>
+  <include base="__intermediate">include/psdk</include>
   <include>include/dxsdk</include>
   <include>include/crt</include>
   <include>include/ddk</include>
index 5656ff6..bb345b8 100644 (file)
@@ -323,6 +323,8 @@ MingwModuleHandler::GetActualSourceFilename (
                else //if ( module.type == IdlHeader )
                {
                        newname = basename + ".h";
+                       PassThruCacheDirectory ( NormalizeFilename ( newname ),
+                                                    backend->intermediateDirectory );
                        return new FileLocation ( fileLocation->directory, filename );
                }
        }
@@ -341,7 +343,7 @@ MingwModuleHandler::GetExtraDependencies (
                if ( (module.type == RpcServer) || (module.type == RpcClient) )
                        return GetRpcServerHeaderFilename ( basename ) + " " + GetRpcClientHeaderFilename ( basename );
                else
-                       return GetIdlHeaderFilename ( basename );                       
+                       return GetIdlHeaderFilename ( basename );
        }
        else
                return "";
@@ -522,9 +524,6 @@ MingwModuleHandler::GetObjectFilename (
        else
                directoryTree = backend->intermediateDirectory;
 
-       if (newExtension == ".h")
-               directoryTree = NULL;
-
        string obj_file = PassThruCacheDirectory (
                NormalizeFilename ( ReplaceExtension (
                        RemoveVariables ( sourceFilename ),
@@ -679,13 +678,20 @@ MingwModuleHandler::ConcatenatePaths (
 /* static */ string
 MingwModuleHandler::GenerateGccIncludeParametersFromVector ( const vector<Include*>& includes )
 {
-       string parameters;
+       string parameters, path_prefix;
        for ( size_t i = 0; i < includes.size (); i++ )
        {
                Include& include = *includes[i];
                if ( parameters.length () > 0 )
                        parameters += " ";
-               parameters += "-I" + include.directory;
+               if ( include.baseValue == "__intermediate" )
+                       path_prefix = backend->intermediateDirectory->name + cSep;
+               else if (include.baseValue == "__output" )
+                       path_prefix = backend->outputDirectory->name + cSep;
+               else
+                       path_prefix = "";
+
+               parameters += "-I" + path_prefix + include.directory;
        }
        return parameters;
 }
@@ -1234,7 +1240,8 @@ MingwModuleHandler::GetRpcClientHeaderFilename ( string basename ) const
 string
 MingwModuleHandler::GetIdlHeaderFilename ( string basename ) const
 {
-       return basename + ".h";
+       return PassThruCacheDirectory ( basename + ".h",
+                                       backend->intermediateDirectory );
 }
 
 void
index 6707f98..0c9ab39 100644 (file)
@@ -52,6 +52,7 @@ Include::Include ( const Project& project,
 {
        this->directory = NormalizeFilename ( basePath + sSep + directory );
        this->basePath = NormalizeFilename ( basePath );
+       this->baseValue = basePath;
 }
 
 Include::~Include ()
@@ -65,26 +66,40 @@ Include::ProcessXML()
        att = node->GetAttribute ( "base", false );
        if ( att )
        {
-               if ( !module )
-                       throw XMLInvalidBuildFileException (
-                               node->location,
-                               "'base' attribute illegal from global <include>" );
                bool referenceResolved = false;
-               if ( att->value == project.name )
+               baseValue = att->value;
+
+               if ( !module )
                {
-                       basePath = ".";
-                       referenceResolved = true;
+                       if ( att->value == "__intermediate" || att->value == "__output" )
+                               referenceResolved = true;
+                       else
+                       {
+                               throw XMLInvalidBuildFileException (
+                                       node->location,
+                                       "'base' attribute illegal from global <include>" );
+                       }
                }
-               else
+
+               if ( !referenceResolved )
                {
-                       const Module* base = project.LocateModule ( att->value );
-                       if ( base != NULL )
+                       if ( att->value == project.name )
                        {
-                               baseModule = base;
-                               basePath = base->GetBasePath ();
+                               basePath = ".";
                                referenceResolved = true;
                        }
+                       else
+                       {
+                               const Module* base = project.LocateModule ( att->value );
+                               if ( base != NULL )
+                               {
+                                       baseModule = base;
+                                       basePath = base->GetBasePath ();
+                                       referenceResolved = true;
+                               }
+                       }
                }
+
                if ( !referenceResolved )
                        throw XMLInvalidBuildFileException (
                                node->location,
index edac7ac..e4f6ab0 100644 (file)
@@ -366,6 +366,7 @@ public:
        const Module* baseModule;
        std::string directory;
        std::string basePath;
+       std::string baseValue;
 
        Include ( const Project& project,
                  const XMLElement* includeNode );