From a09fa8cc1c9969e3377d0520f9c1ef62e300e652 Mon Sep 17 00:00:00 2001 From: Casper Hornstrup Date: Mon, 21 Nov 2005 20:59:32 +0000 Subject: [PATCH] Revert 19411 svn path=/trunk/; revision=19423 --- reactos/tools/rbuild/compilationunit.cpp | 42 ---------- reactos/tools/rbuild/doc/rbuild.txt | 23 +---- reactos/tools/rbuild/global.cpp | 70 ---------------- reactos/tools/rbuild/module.cpp | 83 +++++++------------ reactos/tools/rbuild/project.cpp | 50 +++++------ reactos/tools/rbuild/rbuild.cpp | 44 +++++++++- reactos/tools/rbuild/rbuild.h | 37 +-------- reactos/tools/rbuild/rbuild.mak | 15 ---- reactos/tools/rbuild/test.h | 8 -- reactos/tools/rbuild/tests/alltests.cpp | 2 - .../rbuild/tests/compilationunittest.cpp | 36 -------- .../rbuild/tests/data/compilationunit.xml | 11 --- reactos/tools/tools.mak | 6 +- 13 files changed, 104 insertions(+), 323 deletions(-) delete mode 100644 reactos/tools/rbuild/compilationunit.cpp delete mode 100644 reactos/tools/rbuild/global.cpp delete mode 100644 reactos/tools/rbuild/tests/compilationunittest.cpp delete mode 100644 reactos/tools/rbuild/tests/data/compilationunit.xml diff --git a/reactos/tools/rbuild/compilationunit.cpp b/reactos/tools/rbuild/compilationunit.cpp deleted file mode 100644 index 7bae5378d5e..00000000000 --- a/reactos/tools/rbuild/compilationunit.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ -#include "pch.h" -#include - -#include "rbuild.h" - -using std::string; -using std::vector; - -CompilationUnit::CompilationUnit ( const Project& project, - const Module* module, - const XMLElement& node ) - : project(project), - module(module), - node(node) -{ -} - -CompilationUnit::~CompilationUnit () -{ -} - -void -CompilationUnit::ProcessXML () -{ -} diff --git a/reactos/tools/rbuild/doc/rbuild.txt b/reactos/tools/rbuild/doc/rbuild.txt index 832212f1c56..b514b69dc2a 100644 --- a/reactos/tools/rbuild/doc/rbuild.txt +++ b/reactos/tools/rbuild/doc/rbuild.txt @@ -129,7 +129,7 @@ Value: None. Elements: - bootstrap, component, compilationunit, define, dependency, directory, file, if, importlibrary, include, invoke, library, linkerscript, property. + bootstrap, component, define, dependency, directory, file, if, importlibrary, include, invoke, library, linkerscript, property. Module types @@ -190,25 +190,6 @@ Elements: None. -CompilationUnit element ------------------------ -A compilationunit element specifies that one or more source code files are to be compiled as a single compilation unit. - -Syntax: - - ... - - -Attributes: - None. - -Value: - None. - -Elements: - directory, file, if. - - Component element ----------------- A component element specifies that imports from a library are to be stubbed so tests can be run without actually calling the functions in the library. This element can only be used for modules of type test. @@ -332,7 +313,7 @@ Value: None. Elements: - compilationunit, compilerflag, define, directory, file, if, include, property. + compilerflag, define, directory, file, if, include, property. Importlibrary element diff --git a/reactos/tools/rbuild/global.cpp b/reactos/tools/rbuild/global.cpp deleted file mode 100644 index 2b521fd497e..00000000000 --- a/reactos/tools/rbuild/global.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - */ -#include "rbuild.h" - -using std::string; -using std::vector; - -string ExePrefix; -string ExePostfix; -string sSep; -string sBadSep; -char cSep; -char cBadSep; - - -void -InitializeEnvironment () -{ - char *SepValue, *ExePostfixValue, *ExePrefixValue;; - - SepValue = getenv ( "SEP" ); - if ( SepValue && ( 0 == strcmp ( SepValue, DEF_SSEP ) || 0 == strcmp ( SepValue, DEF_SBAD_SEP ) ) ) - { - cSep = SepValue[0]; - sSep = SepValue; - } - else - { - cSep = DEF_CSEP; - sSep = DEF_SSEP; - } - if ( cSep == DEF_CSEP ) - { - cBadSep = DEF_CBAD_SEP; - sBadSep = DEF_SBAD_SEP; - } - else - { - cBadSep = DEF_CSEP; - sBadSep = DEF_SSEP; - } - ExePostfixValue = getenv ( "EXEPOSTFIX" ); - ExePrefixValue = getenv ( "EXEPREFIX" ); - if ( ( ExePostfixValue == NULL || 0 == strlen ( ExePostfixValue ) ) && - ( ExePrefixValue == NULL || 0 == strlen ( ExePrefixValue ) ) ) - { - ExePostfix = DEF_EXEPOSTFIX; - ExePrefix = DEF_EXEPREFIX; - } - else - { - ExePostfix = ExePostfixValue ? ExePostfixValue : ""; - ExePrefix = ExePrefixValue ? ExePrefixValue : ""; - } -} diff --git a/reactos/tools/rbuild/module.cpp b/reactos/tools/rbuild/module.cpp index 3333f263bf6..1b5644bce8c 100644 --- a/reactos/tools/rbuild/module.cpp +++ b/reactos/tools/rbuild/module.cpp @@ -182,22 +182,20 @@ GetBooleanValue ( const string& value ) IfableData::~IfableData() { size_t i; - for ( i = 0; i < files.size (); i++ ) + for ( i = 0; i < files.size(); i++ ) delete files[i]; - for ( i = 0; i < includes.size (); i++ ) + for ( i = 0; i < includes.size(); i++ ) delete includes[i]; - for ( i = 0; i < defines.size (); i++ ) + for ( i = 0; i < defines.size(); i++ ) delete defines[i]; - for ( i = 0; i < libraries.size (); i++ ) + for ( i = 0; i < libraries.size(); i++ ) delete libraries[i]; - for ( i = 0; i < properties.size (); i++ ) + for ( i = 0; i < properties.size(); i++ ) delete properties[i]; - for ( i = 0; i < compilerFlags.size (); i++ ) + for ( i = 0; i < compilerFlags.size(); i++ ) delete compilerFlags[i]; - for ( i = 0; i < ifs.size (); i++ ) + for ( i = 0; i < ifs.size(); i++ ) delete ifs[i]; - for ( i = 0; i < compilationUnits.size (); i++ ) - delete compilationUnits[i]; } void IfableData::ProcessXML () @@ -217,8 +215,6 @@ void IfableData::ProcessXML () compilerFlags[i]->ProcessXML (); for ( i = 0; i < ifs.size (); i++ ) ifs[i]->ProcessXML (); - for ( i = 0; i < compilationUnits.size (); i++ ) - compilationUnits[i]->ProcessXML (); } Module::Module ( const Project& project, @@ -417,10 +413,7 @@ Module::ProcessXML() size_t i; for ( i = 0; i < node.subElements.size(); i++ ) - { - ParseContext parseContext; - ProcessXMLSubElement ( *node.subElements[i], path, parseContext ); - } + ProcessXMLSubElement ( *node.subElements[i], path ); for ( i = 0; i < invocations.size(); i++ ) invocations[i]->ProcessXML (); for ( i = 0; i < dependencies.size(); i++ ) @@ -441,7 +434,7 @@ Module::ProcessXML() void Module::ProcessXMLSubElement ( const XMLElement& e, const string& path, - ParseContext& parseContext ) + If* pIf /*= NULL*/ ) { bool subs_invalid = false; string subpath ( path ); @@ -477,19 +470,17 @@ Module::ProcessXMLSubElement ( const XMLElement& e, first, switches, false ); - if ( parseContext.ifData ) - parseContext.ifData->data.files.push_back ( pFile ); + if ( pIf ) + pIf->data.files.push_back ( pFile ); else non_if_data.files.push_back ( pFile ); - if ( parseContext.compilationUnit ) - parseContext.compilationUnit->files.push_back ( pFile ); subs_invalid = true; } else if ( e.name == "library" && e.value.size () ) { Library* pLibrary = new Library ( e, *this, e.value ); - if ( parseContext.ifData ) - parseContext.ifData->data.libraries.push_back ( pLibrary ); + if ( pIf ) + pIf->data.libraries.push_back ( pLibrary ); else non_if_data.libraries.push_back ( pLibrary ); subs_invalid = true; @@ -503,8 +494,8 @@ Module::ProcessXMLSubElement ( const XMLElement& e, else if ( e.name == "include" ) { Include* include = new Include ( project, this, &e ); - if ( parseContext.ifData ) - parseContext.ifData->data.includes.push_back ( include ); + if ( pIf ) + pIf->data.includes.push_back ( include ); else non_if_data.includes.push_back ( include ); subs_invalid = true; @@ -512,15 +503,15 @@ Module::ProcessXMLSubElement ( const XMLElement& e, else if ( e.name == "define" ) { Define* pDefine = new Define ( project, this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.defines.push_back ( pDefine ); + if ( pIf ) + pIf->data.defines.push_back ( pDefine ); else non_if_data.defines.push_back ( pDefine ); subs_invalid = true; } else if ( e.name == "invoke" ) { - if ( parseContext.ifData ) + if ( pIf ) throw InvalidBuildFileException ( e.location, " is not a valid sub-element of " ); @@ -529,7 +520,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e, } else if ( e.name == "dependency" ) { - if ( parseContext.ifData ) + if ( pIf ) throw InvalidBuildFileException ( e.location, " is not a valid sub-element of " ); @@ -538,7 +529,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e, } else if ( e.name == "importlibrary" ) { - if ( parseContext.ifData ) + if ( pIf ) throw InvalidBuildFileException ( e.location, " is not a valid sub-element of " ); @@ -551,29 +542,29 @@ Module::ProcessXMLSubElement ( const XMLElement& e, } else if ( e.name == "if" ) { - If* pOldIf = parseContext.ifData; - parseContext.ifData = new If ( e, project, this ); + If* pOldIf = pIf; + pIf = new If ( e, project, this ); if ( pOldIf ) - pOldIf->data.ifs.push_back ( parseContext.ifData ); + pOldIf->data.ifs.push_back ( pIf ); else - non_if_data.ifs.push_back ( parseContext.ifData ); + non_if_data.ifs.push_back ( pIf ); subs_invalid = false; } else if ( e.name == "ifnot" ) { - If* pOldIf = parseContext.ifData; - parseContext.ifData = new If ( e, project, this, true ); + If* pOldIf = pIf; + pIf = new If ( e, project, this, true ); if ( pOldIf ) - pOldIf->data.ifs.push_back ( parseContext.ifData ); + pOldIf->data.ifs.push_back ( pIf ); else - non_if_data.ifs.push_back ( parseContext.ifData ); + non_if_data.ifs.push_back ( pIf ); subs_invalid = false; } else if ( e.name == "compilerflag" ) { CompilerFlag* pCompilerFlag = new CompilerFlag ( project, this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilerFlags.push_back ( pCompilerFlag ); + if ( pIf ) + pIf->data.compilerFlags.push_back ( pCompilerFlag ); else non_if_data.compilerFlags.push_back ( pCompilerFlag ); subs_invalid = true; @@ -610,7 +601,7 @@ Module::ProcessXMLSubElement ( const XMLElement& e, } else if ( e.name == "pch" ) { - if ( parseContext.ifData ) + if ( pIf ) throw InvalidBuildFileException ( e.location, " is not a valid sub-element of " ); @@ -622,23 +613,13 @@ Module::ProcessXMLSubElement ( const XMLElement& e, e, *this, File ( FixSeparator ( path + cSep + e.value ), false, "", true ) ); subs_invalid = true; } - else if ( e.name == "compilationunit" ) - { - CompilationUnit* pCompilationUnit = new CompilationUnit ( project, this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilationUnits.push_back ( pCompilationUnit ); - else - non_if_data.compilationUnits.push_back ( pCompilationUnit ); - parseContext.compilationUnit = pCompilationUnit; - subs_invalid = false; - } if ( subs_invalid && e.subElements.size() > 0 ) throw InvalidBuildFileException ( e.location, "<%s> cannot have sub-elements", e.name.c_str() ); for ( size_t i = 0; i < e.subElements.size (); i++ ) - ProcessXMLSubElement ( *e.subElements[i], subpath, parseContext ); + ProcessXMLSubElement ( *e.subElements[i], subpath, pIf ); } ModuleType diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index 297a63e175a..e74e44f4f4d 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -66,11 +66,6 @@ Environment::GetInstallPath () "reactos" ); } -ParseContext::ParseContext () - : ifData (NULL), - compilationUnit (NULL) -{ -} Project::Project ( const string& filename ) : xmlfile (filename), @@ -259,10 +254,7 @@ Project::ProcessXML ( const string& path ) size_t i; for ( i = 0; i < node->subElements.size (); i++ ) - { - ParseContext parseContext; - ProcessXMLSubElement ( *node->subElements[i], path, parseContext ); - } + ProcessXMLSubElement ( *node->subElements[i], path ); for ( i = 0; i < modules.size (); i++ ) modules[i]->ProcessXML (); for ( i = 0; i < linkerFlags.size (); i++ ) @@ -277,13 +269,13 @@ Project::ProcessXML ( const string& path ) void Project::ProcessXMLSubElement ( const XMLElement& e, const string& path, - ParseContext& parseContext ) + If* pIf ) { bool subs_invalid = false; string subpath(path); if ( e.name == "module" ) { - if ( parseContext.ifData ) + if ( pIf ) throw InvalidBuildFileException ( e.location, " is not a valid sub-element of " ); @@ -318,8 +310,8 @@ Project::ProcessXMLSubElement ( const XMLElement& e, else if ( e.name == "include" ) { Include* include = new Include ( *this, &e ); - if ( parseContext.ifData ) - parseContext.ifData->data.includes.push_back ( include ); + if ( pIf ) + pIf->data.includes.push_back ( include ); else non_if_data.includes.push_back ( include ); subs_invalid = true; @@ -327,8 +319,8 @@ Project::ProcessXMLSubElement ( const XMLElement& e, else if ( e.name == "define" ) { Define* define = new Define ( *this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.defines.push_back ( define ); + if ( pIf ) + pIf->data.defines.push_back ( define ); else non_if_data.defines.push_back ( define ); subs_invalid = true; @@ -336,8 +328,8 @@ Project::ProcessXMLSubElement ( const XMLElement& e, else if ( e.name == "compilerflag" ) { CompilerFlag* pCompilerFlag = new CompilerFlag ( *this, e ); - if ( parseContext.ifData ) - parseContext.ifData->data.compilerFlags.push_back ( pCompilerFlag ); + if ( pIf ) + pIf->data.compilerFlags.push_back ( pCompilerFlag ); else non_if_data.compilerFlags.push_back ( pCompilerFlag ); subs_invalid = true; @@ -349,29 +341,29 @@ Project::ProcessXMLSubElement ( const XMLElement& e, } else if ( e.name == "if" ) { - If* pOldIf = parseContext.ifData; - parseContext.ifData = new If ( e, *this, NULL ); + If* pOldIf = pIf; + pIf = new If ( e, *this, NULL ); if ( pOldIf ) - pOldIf->data.ifs.push_back ( parseContext.ifData ); + pOldIf->data.ifs.push_back ( pIf ); else - non_if_data.ifs.push_back ( parseContext.ifData ); + non_if_data.ifs.push_back ( pIf ); subs_invalid = false; } else if ( e.name == "ifnot" ) { - If* pOldIf = parseContext.ifData; - parseContext.ifData = new If ( e, *this, NULL, true ); + If* pOldIf = pIf; + pIf = new If ( e, *this, NULL, true ); if ( pOldIf ) - pOldIf->data.ifs.push_back ( parseContext.ifData ); + pOldIf->data.ifs.push_back ( pIf ); else - non_if_data.ifs.push_back ( parseContext.ifData ); + non_if_data.ifs.push_back ( pIf ); subs_invalid = false; } else if ( e.name == "property" ) { Property* property = new Property ( e, *this, NULL ); - if ( parseContext.ifData ) - parseContext.ifData->data.properties.push_back ( property ); + if ( pIf ) + pIf->data.properties.push_back ( property ); else non_if_data.properties.push_back ( property ); } @@ -381,7 +373,7 @@ Project::ProcessXMLSubElement ( const XMLElement& e, "<%s> cannot have sub-elements", e.name.c_str() ); for ( size_t i = 0; i < e.subElements.size (); i++ ) - ProcessXMLSubElement ( *e.subElements[i], subpath, parseContext ); + ProcessXMLSubElement ( *e.subElements[i], subpath, pIf ); } Module* @@ -413,3 +405,5 @@ Project::GetProjectFilename () const { return xmlfile; } + + diff --git a/reactos/tools/rbuild/rbuild.cpp b/reactos/tools/rbuild/rbuild.cpp index 00e685b6b6c..d7edd1349fb 100644 --- a/reactos/tools/rbuild/rbuild.cpp +++ b/reactos/tools/rbuild/rbuild.cpp @@ -35,6 +35,13 @@ static string BuildSystem; static string RootXmlFile = "ReactOS.xml"; static Configuration configuration; +string ExePrefix; +string ExePostfix; +string sSep; +string sBadSep; +char cSep; +char cBadSep; + bool ParseAutomaticDependencySwitch ( char switchChar2, char* switchStart ) @@ -186,7 +193,42 @@ ParseArguments ( int argc, char** argv ) int main ( int argc, char** argv ) { - InitializeEnvironment (); + char *SepValue, *ExePostfixValue, *ExePrefixValue;; + + SepValue = getenv("SEP"); + if (SepValue && (0 == strcmp(SepValue, DEF_SSEP) || 0 == strcmp(SepValue, DEF_SBAD_SEP))) + { + cSep = SepValue[0]; + sSep = SepValue; + } + else + { + cSep = DEF_CSEP; + sSep = DEF_SSEP; + } + if (cSep == DEF_CSEP) + { + cBadSep = DEF_CBAD_SEP; + sBadSep = DEF_SBAD_SEP; + } + else + { + cBadSep = DEF_CSEP; + sBadSep = DEF_SSEP; + } + ExePostfixValue = getenv("EXEPOSTFIX"); + ExePrefixValue = getenv("EXEPREFIX"); + if ((ExePostfixValue == NULL || 0 == strlen(ExePostfixValue)) && + (ExePrefixValue == NULL || 0 == strlen(ExePrefixValue))) + { + ExePostfix = DEF_EXEPOSTFIX; + ExePrefix = DEF_EXEPREFIX; + } + else + { + ExePostfix = ExePostfixValue ? ExePostfixValue : ""; + ExePrefix = ExePrefixValue ? ExePrefixValue : ""; + } if ( !ParseArguments ( argc, argv ) ) { diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index 20c9899f2fd..53ab14e364a 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -91,7 +91,6 @@ class InstallFile; class PchFile; class StubbedComponent; class StubbedSymbol; -class CompilationUnit; class SourceFileTest; @@ -122,7 +121,6 @@ public: const std::string& defaultValue ); }; - class FileSupportCode { public: @@ -130,20 +128,9 @@ public: std::string filename ); }; - -class ParseContext -{ -public: - If* ifData; - CompilationUnit* compilationUnit; - ParseContext (); -}; - - class IfableData { public: - std::vector compilationUnits; std::vector files; std::vector includes; std::vector defines; @@ -190,7 +177,7 @@ private: void ReadXml (); void ProcessXMLSubElement ( const XMLElement& e, const std::string& path, - ParseContext& parseContext ); + If* pIf = NULL ); // disable copy semantics Project ( const Project& ); @@ -290,7 +277,7 @@ private: std::string GetDefaultModuleBaseaddress () const; void ProcessXMLSubElement ( const XMLElement& e, const std::string& path, - ParseContext& parseContext ); + If* pIf = NULL ); }; @@ -784,26 +771,6 @@ private: std::string StripSymbol ( std::string symbol ); }; - -class CompilationUnit -{ -public: - const Project& project; - const Module* module; - const XMLElement& node; - std::vector files; - - CompilationUnit ( const Project& project, - const Module* module, - const XMLElement& node ); - ~CompilationUnit (); - void ProcessXML(); -}; - - -extern void -InitializeEnvironment (); - extern std::string Right ( const std::string& s, size_t n ); diff --git a/reactos/tools/rbuild/rbuild.mak b/reactos/tools/rbuild/rbuild.mak index f4ba5698325..cde64588801 100644 --- a/reactos/tools/rbuild/rbuild.mak +++ b/reactos/tools/rbuild/rbuild.mak @@ -152,11 +152,9 @@ RBUILD_BACKEND_SOURCES = \ RBUILD_COMMON_SOURCES = \ $(RBUILD_BACKEND_SOURCES) \ $(addprefix $(RBUILD_BASE_), \ - global.cpp \ automaticdependency.cpp \ bootstrap.cpp \ cdfile.cpp \ - compilationunit.cpp \ compilerflag.cpp \ configuration.cpp \ define.cpp \ @@ -221,7 +219,6 @@ RBUILD_HEADERS = \ RBUILD_TESTS = \ tests$(SEP)cdfiletest.cpp \ - tests$(SEP)compilationunittest.cpp \ tests$(SEP)definetest.cpp \ tests$(SEP)functiontest.cpp \ tests$(SEP)iftest.cpp \ @@ -259,10 +256,6 @@ $(RBUILD_TARGET): $(RBUILD_OBJECTS) | $(RBUILD_OUT) $(ECHO_LD) ${host_gpp} $(RBUILD_OBJECTS) $(RBUILD_HOST_LFLAGS) -o $@ -$(RBUILD_INT_)global.o: $(RBUILD_BASE_)global.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) - $(ECHO_CC) - ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ - $(RBUILD_INT_)automaticdependency.o: $(RBUILD_BASE_)automaticdependency.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ @@ -275,10 +268,6 @@ $(RBUILD_INT_)cdfile.o: $(RBUILD_BASE_)cdfile.cpp $(RBUILD_HEADERS) | $(RBUILD_I $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ -$(RBUILD_INT_)compilationunit.o: $(RBUILD_BASE_)compilationunit.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) - $(ECHO_CC) - ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ - $(RBUILD_INT_)compilerflag.o: $(RBUILD_BASE_)compilerflag.cpp $(RBUILD_HEADERS) | $(RBUILD_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ @@ -391,10 +380,6 @@ $(RBUILD_TESTS_INT_)cdfiletest.o: $(RBUILD_TESTS_BASE_)cdfiletest.cpp $(RBUILD_H $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ -$(RBUILD_TESTS_INT_)compilationunittest.o: $(RBUILD_TESTS_BASE_)compilationunittest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) - $(ECHO_CC) - ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ - $(RBUILD_TESTS_INT_)definetest.o: $(RBUILD_TESTS_BASE_)definetest.cpp $(RBUILD_HEADERS) | $(RBUILD_TESTS_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ diff --git a/reactos/tools/rbuild/test.h b/reactos/tools/rbuild/test.h index 4b8ec491d55..8aaee42bf9f 100644 --- a/reactos/tools/rbuild/test.h +++ b/reactos/tools/rbuild/test.h @@ -21,8 +21,6 @@ #include "rbuild.h" #include "backend/mingw/mingw.h" -#define SSEP DEF_SSEP - #define RBUILD_BASE "tools" SSEP "rbuild" SSEP class BaseTest @@ -155,10 +153,4 @@ public: void Run (); }; -class CompilationUnitTest : public BaseTest -{ -public: - void Run (); -}; - #endif /* __TEST_H */ diff --git a/reactos/tools/rbuild/tests/alltests.cpp b/reactos/tools/rbuild/tests/alltests.cpp index ee2a702483b..b7a9edbadc0 100644 --- a/reactos/tools/rbuild/tests/alltests.cpp +++ b/reactos/tools/rbuild/tests/alltests.cpp @@ -196,7 +196,6 @@ private: tests.push_back(new SourceFileTest()); tests.push_back(new CDFileTest()); tests.push_back(new SymbolTest()); - tests.push_back(new CompilationUnitTest()); } }; @@ -204,7 +203,6 @@ private: int main(int argc, char** argv) { - InitializeEnvironment (); TestDispatcher testDispatcher; testDispatcher.Run(); return 0; diff --git a/reactos/tools/rbuild/tests/compilationunittest.cpp b/reactos/tools/rbuild/tests/compilationunittest.cpp deleted file mode 100644 index 64ab8dd1e85..00000000000 --- a/reactos/tools/rbuild/tests/compilationunittest.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ -#include "test.h" - -using std::string; - -void CompilationUnitTest::Run() -{ - string projectFilename ( RBUILD_BASE "tests/data/compilationunit.xml" ); - Project project ( projectFilename ); - ARE_EQUAL ( 1, project.modules.size () ); - - Module& module1 = *project.modules[0]; - IS_TRUE ( module1.type == BuildTool ); - - ARE_EQUAL ( 2, module1.non_if_data.files.size()); - ARE_EQUAL ( 1, module1.non_if_data.compilationUnits.size () ); - - CompilationUnit& compilationUnit1 = *module1.non_if_data.compilationUnits[0]; - ARE_EQUAL ( 2, compilationUnit1.files.size () ); -} diff --git a/reactos/tools/rbuild/tests/data/compilationunit.xml b/reactos/tools/rbuild/tests/data/compilationunit.xml deleted file mode 100644 index 92719cdf164..00000000000 --- a/reactos/tools/rbuild/tests/data/compilationunit.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - file1.c - file2.c - - - - diff --git a/reactos/tools/tools.mak b/reactos/tools/tools.mak index 2ee18039024..eb724c27f68 100644 --- a/reactos/tools/tools.mak +++ b/reactos/tools/tools.mak @@ -5,9 +5,9 @@ TOOLS_INT_ = $(TOOLS_INT)$(SEP) TOOLS_OUT = $(OUTPUT_)$(TOOLS_BASE) TOOLS_OUT_ = $(TOOLS_OUT)$(SEP) -TOOLS_CFLAGS = $(CFLAGS) -Wall -Wpointer-arith -Wno-strict-aliasing -TOOLS_CPPFLAGS = $(CPPFLAGS) -Wall -Wpointer-arith -TOOLS_LFLAGS = $(LFLAGS) +TOOLS_CFLAGS = -Wall -Wpointer-arith -Wno-strict-aliasing +TOOLS_CPPFLAGS = -Wall -Wpointer-arith +TOOLS_LFLAGS = $(TOOLS_INT): | $(INTERMEDIATE) $(ECHO_MKDIR)