* Build bin2res, winmm, comctl32, aclui, acledit

* Correct dependencies for build tool invocations
* Normalize paths in the generated makefile


svn path=/branches/xmlbuildsystem/; revision=13168
This commit is contained in:
Casper Hornstrup
2005-01-20 22:19:01 +00:00
parent a04e56cbf4
commit 49d3351175
31 changed files with 249 additions and 28 deletions
+14
View File
@@ -0,0 +1,14 @@
<module name="acledit" type="win32dll">
<importlibrary definition="acledit.def" />
<include base="acledit">.</include>
<define name="UNICODE" />
<define name="_UNICODE" />
<define name="__REACTOS__" />
<library>ntdll</library>
<library>kernel32</library>
<library>advapi32</library>
<library>user32</library>
<file>acledit.c</file>
<file>stubs.c</file>
<file>acledit.rc</file>
</module>
+18
View File
@@ -0,0 +1,18 @@
<module name="aclui" type="win32dll">
<importlibrary definition="aclui.def" />
<include base="aclui">.</include>
<define name="UNICODE" />
<define name="_UNICODE" />
<define name="__REACTOS__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x0500</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x0600</define>
<library>rosrtl</library>
<library>ntdll</library>
<library>kernel32</library>
<library>user32</library>
<library>comctl32</library>
<file>aclui.c</file>
<file>aclui.rc</file>
</module>
+51
View File
@@ -0,0 +1,51 @@
<module name="comctl32" type="win32dll">
<dependency>bin2res</dependency>
<dependency>winebuild</dependency>
<importlibrary definition="comctl32.spec.def" />
<include base="comctl32">.</include>
<include base="ReactOS">include/wine</include>
<define name="UNICODE" />
<define name="_UNICODE" />
<define name="__REACTOS__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<library>wine</library>
<library>ntdll</library>
<library>kernel32</library>
<library>advapi32</library>
<library>gdi32</library>
<library>user32</library>
<library>winmm</library>
<file>animate.c</file>
<file>comboex.c</file>
<file>comctl32undoc.c</file>
<file>commctrl.c</file>
<file>datetime.c</file>
<file>draglist.c</file>
<file>flatsb.c</file>
<file>header.c</file>
<file>hotkey.c</file>
<file>imagelist.c</file>
<file>ipaddress.c</file>
<file>listview.c</file>
<file>monthcal.c</file>
<file>nativefont.c</file>
<file>pager.c</file>
<file>progress.c</file>
<file>propsheet.c</file>
<file>rebar.c</file>
<file>smoothscroll.c</file>
<file>string.c</file>
<file>status.c</file>
<file>syslink.c</file>
<file>tab.c</file>
<file>toolbar.c</file>
<file>tooltips.c</file>
<file>trackbar.c</file>
<file>treeview.c</file>
<file>updown.c</file>
<file>rsrc.rc</file>
<file>comctl32.spec</file>
</module>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 398 B

+12
View File
@@ -1,9 +1,18 @@
<directory name="acledit">
<xi:include href="acledit/acledit.xml" />
</directory>
<directory name="aclui">
<xi:include href="aclui/aclui.xml" />
</directory>
<directory name="adns">
<xi:include href="adns/adns.xml" />
</directory>
<directory name="advapi32">
<xi:include href="advapi32/advapi32.xml" />
</directory>
<directory name="comctl32">
<xi:include href="comctl32/comctl32.xml" />
</directory>
<directory name="dnsapi">
<xi:include href="dnsapi/dnsapi.xml" />
</directory>
@@ -46,6 +55,9 @@
<directory name="user32">
<xi:include href="user32/user32.xml" />
</directory>
<directory name="winmm">
<xi:include href="winmm/winmm.xml" />
</directory>
<directory name="ws2_32">
<xi:include href="ws2_32/ws2_32.xml" />
</directory>
+29
View File
@@ -0,0 +1,29 @@
<module name="winmm" type="win32dll">
<dependency>bin2res</dependency>
<dependency>winebuild</dependency>
<importlibrary definition="winmm.spec.def" />
<include base="winmm">.</include>
<include base="ReactOS">include/wine</include>
<define name="UNICODE" />
<define name="_UNICODE" />
<define name="__REACTOS__" />
<define name="__USE_W32API" />
<define name="_WIN32_IE">0x600</define>
<define name="_WIN32_WINNT">0x501</define>
<define name="WINVER">0x501</define>
<library>wine</library>
<library>ntdll</library>
<library>kernel32</library>
<library>advapi32</library>
<library>user32</library>
<file>driver.c</file>
<file>joystick.c</file>
<file>lolvldrv.c</file>
<file>mci.c</file>
<file>mmio.c</file>
<file>playsound.c</file>
<file>time.c</file>
<file>winmm.c</file>
<file>winmm_res.rc</file>
<file>winmm.spec</file>
</module>
+6
View File
@@ -0,0 +1,6 @@
<module name="bin2res" type="buildtool">
<include base="ReactOS">include/wine</include>
<define name="__REACTOS__" />
<file>bin2res.c</file>
<file>mkstemps.c</file>
</module>
+3 -3
View File
@@ -184,6 +184,7 @@ MingwBackend::GenerateGlobalVariables ()
fprintf ( fMakefile, "mkdir = tools%crmkdir\n", CSEP );
fprintf ( fMakefile, "NUL=NUL\n" );
fprintf ( fMakefile, "winebuild = tools" SSEP "winebuild" SSEP "winebuild\n" );
fprintf ( fMakefile, "bin2res = tools" SSEP "winebuild" SSEP "bin2res\n" );
fprintf ( fMakefile, "\n" );
GenerateGlobalCFlagsAndProperties (
"=",
@@ -197,13 +198,12 @@ MingwBackend::GenerateGlobalVariables ()
fprintf ( fMakefile, "\n" );
fprintf ( fMakefile, ".PHONY: clean\n\n" );
//fprintf ( fMakefile, "clean:\n\t-@${rm} $(PROJECT_CLEAN)\n\n" );
}
void
MingwBackend::GenerateAllTarget ()
{
fprintf ( fMakefile, "all:" );
fprintf ( fMakefile, "all:" );
for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )
{
Module& module = *ProjectNode.modules[i];
@@ -227,5 +227,5 @@ MingwBackend::ProcessModule ( Module& module )
string
FixupTargetFilename ( const string& targetFilename )
{
return string("$(ROS_INTERMEDIATE)") + targetFilename;
return string("$(ROS_INTERMEDIATE)") + NormalizeFilename ( targetFilename );
}
@@ -136,6 +136,16 @@ MingwModuleHandler::GetModuleArchiveFilename ( const Module& module ) const
".a" );
}
bool
MingwModuleHandler::IsGeneratedFile ( const File& file ) const
{
string extension = GetExtension ( file.name );
if ( extension == ".spec" || extension == "SPEC" )
return true;
else
return false;
}
string
MingwModuleHandler::GetImportLibraryDependencies ( const Module& module ) const
{
@@ -191,13 +201,17 @@ MingwModuleHandler::GetAllDependencies ( const Module& module ) const
}
string
MingwModuleHandler::GetSourceFilenames ( const Module& module ) const
MingwModuleHandler::GetSourceFilenames ( const Module& module,
bool includeGeneratedFiles ) const
{
size_t i;
string sourceFilenames ( "" );
for ( i = 0; i < module.files.size (); i++ )
sourceFilenames += " " + GetActualSourceFilename ( module.files[i]->name );
{
if ( includeGeneratedFiles || !IsGeneratedFile ( *module.files[i] ) )
sourceFilenames += " " + GetActualSourceFilename ( module.files[i]->name );
}
vector<If*> ifs = module.ifs;
for ( i = 0; i < ifs.size(); i++ )
{
@@ -206,11 +220,28 @@ MingwModuleHandler::GetSourceFilenames ( const Module& module ) const
for ( j = 0; j < rIf.ifs.size(); j++ )
ifs.push_back ( rIf.ifs[j] );
for ( j = 0; j < rIf.files.size(); j++ )
sourceFilenames += " " + GetActualSourceFilename ( rIf.files[j]->name );
{
if ( includeGeneratedFiles || !IsGeneratedFile ( *rIf.files[j] ) )
sourceFilenames += " " + GetActualSourceFilename ( rIf.files[j]->name );
}
}
return sourceFilenames;
}
string
MingwModuleHandler::GetSourceFilenames ( const Module& module ) const
{
return GetSourceFilenames ( module,
true );
}
string
MingwModuleHandler::GetSourceFilenamesWithoutGeneratedFiles ( const Module& module ) const
{
return GetSourceFilenames ( module,
false );
}
string
MingwModuleHandler::GetObjectFilename ( const string& sourceFilename ) const
{
@@ -1009,7 +1040,7 @@ MingwModuleHandler::GetInvocationParameters ( const Invoke& invoke ) const
parameters += invokeFile.switches;
parameters += " ";
}
parameters += invokeFile.name;
parameters += invokeFile.name ;
}
return parameters;
@@ -1033,20 +1064,20 @@ MingwModuleHandler::GenerateInvocations ( const Module& module ) const
string invokeTarget = module.GetInvocationTarget ( i );
fprintf ( fMakefile,
"%s: %s\n\n",
invoke.GetTargets ().c_str (),
".PHONY: %s\n\n",
invokeTarget.c_str () );
fprintf ( fMakefile,
"%s: %s\n",
"%s: %s\n\n",
invokeTarget.c_str (),
invoke.GetTargets ().c_str () );
fprintf ( fMakefile,
"%s: %s\n",
invoke.GetTargets ().c_str (),
FixupTargetFilename ( invoke.invokeModule->GetPath () ).c_str () );
fprintf ( fMakefile,
"\t%s %s\n\n",
FixupTargetFilename ( invoke.invokeModule->GetPath () ).c_str (),
GetInvocationParameters ( invoke ).c_str () );
fprintf ( fMakefile,
".PNONY: %s\n\n",
invokeTarget.c_str () );
}
}
@@ -1061,7 +1092,7 @@ void
MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module ) const
{
string preconditionDependenciesName = GetPreconditionDependenciesName ( module );
string sourceFilenames = GetSourceFilenames ( module );
string sourceFilenames = GetSourceFilenamesWithoutGeneratedFiles ( module );
string dependencies = GetModuleDependencies ( module );
string s = GetInvocationDependencies ( module );
if ( s.length () > 0 )
@@ -1330,10 +1361,10 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul
}
else
{
fprintf ( fMakefile, "%s:\n",
target.c_str ());
fprintf ( fMakefile, ".PHONY: %s\n\n",
target.c_str ());
fprintf ( fMakefile, "%s:\n",
target.c_str ());
}
}
@@ -1385,10 +1416,10 @@ MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ( const
}
else
{
fprintf ( fMakefile, "%s:\n",
target.c_str () );
fprintf ( fMakefile, ".PHONY: %s\n\n",
target.c_str ());
fprintf ( fMakefile, "%s:\n",
target.c_str () );
}
}
@@ -1447,10 +1478,10 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul
}
else
{
fprintf ( fMakefile, "%s:\n\n",
target.c_str ());
fprintf ( fMakefile, ".PHONY: %s\n\n",
target.c_str ());
fprintf ( fMakefile, "%s:\n\n",
target.c_str ());
}
}
@@ -1465,11 +1496,33 @@ MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler ()
void
MingwWin32DLLModuleHandler::Process ( const Module& module )
{
GenerateExtractWineDLLResourcesTarget ( module );
GeneratePreconditionDependencies ( module );
GenerateWin32DLLModuleTarget ( module );
GenerateInvocations ( module );
}
void
MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ( const Module& module )
{
fprintf ( fMakefile, ".PHONY: %s_extractresources\n\n",
module.name.c_str () );
fprintf ( fMakefile, "%s_extractresources: bin2res\n",
module.name.c_str () );
for ( size_t i = 0; i < module.files.size (); i++ )
{
File& file = *module.files[i];
string extension = GetExtension ( file.name );
if ( extension == ".rc" || extension == ".RC" )
{
string resource = FixupTargetFilename ( file.name );
fprintf ( fMakefile, "\t@echo ${bin2res} -f -x %s\n",
resource.c_str () );
}
}
fprintf ( fMakefile, "\n");
}
void
MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module )
{
@@ -1497,10 +1550,10 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module
}
else
{
fprintf ( fMakefile, "%s:\n\n",
target.c_str ());
fprintf ( fMakefile, ".PHONY: %s\n\n",
target.c_str ());
target.c_str () );
fprintf ( fMakefile, "%s:\n\n",
target.c_str () );
}
}
@@ -1548,9 +1601,9 @@ MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ( const Module& module
}
else
{
fprintf ( fMakefile, "%s:\n\n",
target.c_str ());
fprintf ( fMakefile, ".PHONY: %s\n\n",
target.c_str ());
fprintf ( fMakefile, "%s:\n\n",
target.c_str ());
}
}
@@ -19,7 +19,7 @@ public:
void GenerateDirectoryTargets () const;
protected:
const std::string &PassThruCacheDirectory ( const std::string &f ) const;
const std::string &PassThruCacheDirectory ( const std::string &f ) const;
std::string GetWorkingDirectory () const;
std::string GetDirectory (const std::string& filename ) const;
std::string GetExtension ( const std::string& filename ) const;
@@ -28,10 +28,14 @@ protected:
const std::string& newExtension ) const;
std::string GetActualSourceFilename ( const std::string& filename ) const;
std::string GetModuleArchiveFilename ( const Module& module ) const;
bool IsGeneratedFile ( const File& file ) const;
std::string GetImportLibraryDependencies ( const Module& module ) const;
std::string GetModuleDependencies ( const Module& module ) const;
std::string GetAllDependencies ( const Module& module ) const;
std::string GetSourceFilenames ( const Module& module,
bool includeGeneratedFiles ) const;
std::string GetSourceFilenames ( const Module& module ) const;
std::string GetSourceFilenamesWithoutGeneratedFiles ( const Module& module ) const;
std::string GetObjectFilename ( const std::string& sourceFilename ) const;
std::string GetObjectFilenames ( const Module& module ) const;
@@ -54,7 +58,7 @@ protected:
std::string GetDefinitionDependencies ( const Module& module ) const;
std::string GetLinkingDependencies ( const Module& module ) const;
static FILE* fMakefile;
static std::set<std::string> directory_set;
static std::set<std::string> directory_set;
private:
std::string ConcatenatePaths ( const std::string& path1,
const std::string& path2 ) const;
@@ -202,6 +206,7 @@ public:
MingwWin32DLLModuleHandler ();
virtual void Process ( const Module& module );
private:
void GenerateExtractWineDLLResourcesTarget ( const Module& module );
void GenerateWin32DLLModuleTarget ( const Module& module );
};
+1
View File
@@ -30,6 +30,7 @@ OBJECTS = $(BASE_OBJECTS) rbuild.o
TESTS = \
tests/definetest.o \
tests/functiontest.o \
tests/iftest.o \
tests/includetest.o \
tests/invoketest.o \
+10 -1
View File
@@ -21,6 +21,15 @@ FixSeparator ( const string& s )
return s2;
}
string
NormalizeFilename ( const string& filename )
{
Path path;
string normalizedPath = path.Fixup ( filename, true );
string relativeNormalizedPath = path.RelativeFromWorkingDirectory ( normalizedPath );
return FixSeparator ( relativeNormalizedPath );
}
Module::Module ( const Project& project,
const XMLElement& moduleNode,
const string& modulePath )
@@ -449,7 +458,7 @@ Invoke::GetTargets () const
InvokeFile& file = *output[i];
if ( targets.length () > 0 )
targets += " ";
targets += file.name;
targets += NormalizeFilename ( file.name );
}
return targets;
}
+3
View File
@@ -315,4 +315,7 @@ public:
extern std::string
FixSeparator ( const std::string& s );
extern std::string
NormalizeFilename ( const std::string& filename );
#endif /* __RBUILD_H */
+7
View File
@@ -2,6 +2,7 @@
#define __TEST_H
#include "rbuild.h"
#include "backend/mingw/mingw.h"
class BaseTest
{
@@ -95,4 +96,10 @@ public:
void Run();
};
class FunctionTest : public BaseTest
{
public:
void Run();
};
#endif /* __TEST_H */
+1
View File
@@ -176,6 +176,7 @@ private:
tests.push_back(new InvokeTest());
tests.push_back(new LinkerFlagTest());
tests.push_back(new IfTest());
tests.push_back(new FunctionTest());
}
};
@@ -0,0 +1,9 @@
#include "test.h"
using std::string;
void FunctionTest::Run ()
{
string fixedupFilename = FixupTargetFilename ( "." SSEP "dir1" SSEP "dir2" SSEP ".." SSEP "filename.txt" );
ARE_EQUAL ( "$(ROS_INTERMEDIATE)dir1" SSEP "filename.txt", fixedupFilename );
}
+3
View File
@@ -1,3 +1,6 @@
<directory name="bin2res">
<xi:include href="bin2res/bin2res.xml" />
</directory>
<module name="buildno" type="buildtool">
<include base="buildno">.</include>
<file>buildno.c</file>