- Added 'MessageHeader' module type for handling .mc files

- turn .mc generated files (RC & Headers) into real dependencies

svn path=/trunk/; revision=33616
This commit is contained in:
Marc Piulachs 2008-05-20 19:46:14 +00:00
parent 3c976797cd
commit c912e98ba3
14 changed files with 1713 additions and 1652 deletions

View file

@ -28,6 +28,7 @@
<include>include/ndk</include>
<include>include/reactos</include>
<include root="intermediate">include/reactos</include>
<include root="intermediate">include/reactos/mc</include>
<include>include/reactos/libs</include>
<directory name="base">

View file

@ -1,5 +1,6 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<group>
<module name="ntdll" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll">
<bootstrap installbase="$(CDOUTPUT)/system32" />
<importlibrary definition="def/ntdll.def" />
@ -18,6 +19,7 @@
<linkerflag>-lgcc</linkerflag>
<linkerflag>-nostdlib</linkerflag>
<linkerflag>-nostartfiles</linkerflag>
<dependency>ntstatus</dependency>
<directory name="csr">
<file>api.c</file>
<file>capture.c</file>
@ -50,8 +52,5 @@
<directory name="inc">
<pch>ntdll.h</pch>
</directory>
<directory name="def">
<file>ntstatus.mc</file>
</directory>
</module>
</group>

View file

@ -9,6 +9,7 @@
<define name="_WIN32_WINNT">0x0600</define>
<define name="__NO_CTYPE_INLINES" />
<define name="WINVER">0x609</define>
<dependency>errcodes</dependency>
<pch>k32.h</pch>
<directory name="debug">
<file>debugger.c</file>
@ -117,7 +118,6 @@
</directory>
</if>
</directory>
<file>errcodes.mc</file>
</module>
<module name="kernel32" type="win32dll" baseaddress="${BASEADDRESS_KERNEL32}" installbase="system32" installname="kernel32.dll">
<importlibrary definition="kernel32.def" />

View file

@ -0,0 +1,15 @@
<?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<group>
<module name="ntstatus" type="messageheader">
<file>ntstatus.mc</file>
</module>
<module name="bugcodes" type="messageheader">
<file>bugcodes.mc</file>
</module>
<module name="errcodes" type="messageheader">
<file>errcodes.mc</file>
</module>
</group>

View file

@ -4,6 +4,9 @@
<directory name="idl">
<xi:include href="idl/idl.rbuild" />
</directory>
<directory name="mc">
<xi:include href="mc/mc.rbuild" />
</directory>
<directory name="wine">
<xi:include href="wine/wineheaders.rbuild" />
</directory>

View file

@ -32,6 +32,7 @@
<library>kdcom</library>
<library>bootvid</library>
<library>wdmguid</library>
<dependency>bugcodes</dependency>
<directory name="include">
<pch>ntoskrnl.h</pch>
</directory>
@ -440,7 +441,6 @@
<directory name="wmi">
<file>wmi.c</file>
</directory>
<file>bugcodes.mc</file>
<file>ntoskrnl.rc</file>
<linkerflag>-nostartfiles</linkerflag>
<linkerflag>-nostdlib</linkerflag>

View file

@ -242,6 +242,9 @@ MingwModuleHandler::InstanciateHandler (
case Alias:
handler = new MingwAliasModuleHandler ( module );
break;
case MessageHeader:
handler = new MingwMessageHeaderModuleHandler (module);
break;
case IdlHeader:
handler = new MingwIdlHeaderModuleHandler ( module );
break;
@ -395,6 +398,8 @@ MingwModuleHandler::ReferenceObjects (
return true;
if ( module.type == IdlHeader )
return true;
if ( module.type == MessageHeader)
return true;
return false;
}
@ -2309,22 +2314,31 @@ MingwModuleHandler::GetDefaultDependencies (
dependencies.push_back ( "$(DXSDK_TARGET) $(dxsdk_HEADERS)" );
}
/* Check if any dependent library relies on the generated headers */
for ( size_t i = 0; i < module.project.modules.size (); i++ )
if (module.name != "errcodes" &&
module.name != "bugcodes" &&
module.name != "ntstatus")
{
const Module& m = *module.project.modules[i];
for ( size_t j = 0; j < m.non_if_data.compilationUnits.size (); j++ )
{
CompilationUnit& compilationUnit = *m.non_if_data.compilationUnits[j];
const FileLocation& sourceFile = compilationUnit.GetFilename ();
string extension = GetExtension ( sourceFile );
if (extension == ".mc" || extension == ".MC" )
{
string dependency = ssprintf ( "$(%s_MCHEADERS)", m.name.c_str () );
dependencies.push_back ( dependency );
}
}
dependencies.push_back ( "$(ERRCODES_TARGET) $(ERRCODES_MCHEADERS)" );
dependencies.push_back ( "$(BUGCODES_TARGET) $(BUGCODES_MCHEADERS)" );
dependencies.push_back ( "$(NTSTATUS_TARGET) $(NTSTATUS_MCHEADERS)" );
}
///* Check if any dependent library relies on the generated headers */
//for ( size_t i = 0; i < module.project.modules.size (); i++ )
//{
// const Module& m = *module.project.modules[i];
// for ( size_t j = 0; j < m.non_if_data.compilationUnits.size (); j++ )
// {
// CompilationUnit& compilationUnit = *m.non_if_data.compilationUnits[j];
// const FileLocation& sourceFile = compilationUnit.GetFilename ();
// string extension = GetExtension ( sourceFile );
// if (extension == ".mc" || extension == ".MC" )
// {
// string dependency = ssprintf ( "$(%s_MCHEADERS)", m.name.c_str () );
// dependencies.push_back ( dependency );
// }
// }
//}
}
void
@ -3827,6 +3841,19 @@ MingwAliasModuleHandler::Process ()
{
}
MingwMessageHeaderModuleHandler::MingwMessageHeaderModuleHandler (
const Module& module_ )
: MingwModuleHandler ( module_ )
{
}
void
MingwMessageHeaderModuleHandler::Process ()
{
GenerateRules ();
}
MingwIdlHeaderModuleHandler::MingwIdlHeaderModuleHandler (
const Module& module_ )

View file

@ -469,6 +469,13 @@ public:
virtual void Process ();
};
class MingwMessageHeaderModuleHandler : public MingwModuleHandler
{
public:
MingwMessageHeaderModuleHandler ( const Module& module );
virtual HostType DefaultHost() { return HostFalse; }
virtual void Process ();
};
class MingwAliasModuleHandler : public MingwModuleHandler
{

View file

@ -71,6 +71,7 @@ Bootstrap::IsSupportedModuleType ( ModuleType type )
case RpcProxy:
case Alias:
case IdlHeader:
case MessageHeader:
case EmbeddedTypeLib:
case ElfExecutable:
return false;

View file

@ -1003,6 +1003,8 @@ Module::GetModuleType ( const string& location, const XMLAttribute& attribute )
return ElfExecutable;
if ( attribute.value == "cabinet" )
return Cabinet;
if ( attribute.value == "messageheader" )
return MessageHeader;
throw InvalidAttributeValueException ( location,
attribute.name,
attribute.value );
@ -1045,6 +1047,7 @@ Module::GetTargetDirectoryTree () const
case RpcProxy:
case Alias:
case IdlHeader:
case MessageHeader:
return IntermediateDirectory;
case TypeDontCare:
break;
@ -1104,6 +1107,7 @@ Module::GetDefaultModuleExtension () const
case Alias:
case ElfExecutable:
case IdlHeader:
case MessageHeader:
return "";
case EmbeddedTypeLib:
return ".tlb";
@ -1160,6 +1164,7 @@ Module::GetDefaultModuleEntrypoint () const
case Alias:
case BootProgram:
case IdlHeader:
case MessageHeader:
case ElfExecutable:
case EmbeddedTypeLib:
case Cabinet:
@ -1211,6 +1216,7 @@ Module::GetDefaultModuleBaseaddress () const
case Alias:
case BootProgram:
case IdlHeader:
case MessageHeader:
case EmbeddedTypeLib:
case Cabinet:
return "";
@ -1261,6 +1267,7 @@ Module::IsDLL () const
case RpcProxy:
case Alias:
case IdlHeader:
case MessageHeader:
case EmbeddedTypeLib:
case ElfExecutable:
case Cabinet:

View file

@ -305,7 +305,8 @@ enum ModuleType
HostStaticLibrary,
TypeDontCare,
Cabinet,
KeyboardLayout
KeyboardLayout,
MessageHeader
};
enum HostType