diff --git a/reactos/Makefile b/reactos/Makefile index f9041b99059..f214a4a0394 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -21,6 +21,11 @@ # a path separator at the end. The variable defaults to the current # directory. # +# ROS_INSTALL +# This variable controls where to install output files to when using +# 'make install'. N.B. Don't put a path separator at the end. The variable +# defaults to .\reactos. +# # ROS_BUILDMAP # This variable controls if map files are to be generated for executable # output files. Map files have the extension .map. The value can be either @@ -63,6 +68,7 @@ else endif endif ifeq ($(HALFVERBOSEECHO),yes) + ECHO_CP =@echo [COPY] $@ ECHO_MKDIR =@echo [MKDIR] $@ ECHO_BUILDNO =@echo [BUILDNO] $@ ECHO_INVOKE =@echo [INVOKE] $< @@ -87,6 +93,7 @@ ifeq ($(HALFVERBOSEECHO),yes) ECHO_REGTESTS=@echo [REGTESTS] $@ ECHO_TEST =@echo [TEST] $@ else + ECHO_CP = ECHO_MKDIR = ECHO_BUILDNO = ECHO_INVOKE = diff --git a/reactos/media/directory.xml b/reactos/media/directory.xml index 4927d0eb209..41c6d89e8a3 100644 --- a/reactos/media/directory.xml +++ b/reactos/media/directory.xml @@ -1,6 +1,12 @@ + + + + + + diff --git a/reactos/media/drivers/etc/etc.xml b/reactos/media/drivers/etc/etc.xml index b0addb97f86..23872aae472 100644 --- a/reactos/media/drivers/etc/etc.xml +++ b/reactos/media/drivers/etc/etc.xml @@ -1 +1,2 @@ services +services diff --git a/reactos/media/fonts/fonts.xml b/reactos/media/fonts/fonts.xml new file mode 100644 index 00000000000..fae43b4ee65 --- /dev/null +++ b/reactos/media/fonts/fonts.xml @@ -0,0 +1,28 @@ +c0419bt_.ttf +c0582bt_.ttf +c0583bt_.ttf +c0611bt_.ttf +c0632bt_.ttf +c0633bt_.ttf +c0648bt_.ttf +c0649bt_.ttf +cour.ttf +courb.ttf +courbi.ttf +helb____.ttf +TGMarlett.ttf +timr____.ttf +UTB_____.ttf +UTBI____.ttf +UTI_____.ttf +UTRG____.ttf +Vera.ttf +VeraBd.ttf +VeraBI.ttf +VeraIt.ttf +VeraMoBd.ttf +VeraMoBI.ttf +VeraMoIt.ttf +VeraMono.ttf +VeraSe.ttf +VeraSeBd.ttf diff --git a/reactos/media/inf/inf.xml b/reactos/media/inf/inf.xml new file mode 100644 index 00000000000..4a93b9f0cdd --- /dev/null +++ b/reactos/media/inf/inf.xml @@ -0,0 +1,4 @@ +layout.inf +NET_NIC.inf +scsi.inf +syssetup.inf diff --git a/reactos/media/nls/nls.xml b/reactos/media/nls/nls.xml index 2a816b00e9c..907972cd10e 100644 --- a/reactos/media/nls/nls.xml +++ b/reactos/media/nls/nls.xml @@ -1,3 +1,59 @@ c_437.nls c_1252.nls l_intl.nls + +c_037.nls +c_037.nls +c_10000.nls +c_10006.nls +c_10007.nls +c_10029.nls +c_1006.nls +c_10079.nls +c_10081.nls +c_1026.nls +c_1250.nls +c_1251.nls +c_1252.nls +c_1253.nls +c_1254.nls +c_1255.nls +c_1256.nls +c_1257.nls +c_1258.nls +c_20866.nls +c_28591.nls +c_28592.nls +c_28593.nls +c_28594.nls +c_28595.nls +c_28596.nls +c_28597.nls +c_28598.nls +c_28599.nls +c_424.nls +c_437.nls +c_500.nls +c_737.nls +c_775.nls +c_850.nls +c_852.nls +c_855.nls +c_856.nls +c_857.nls +c_860.nls +c_861.nls +c_862.nls +c_863.nls +c_864.nls +c_865.nls +c_866.nls +c_869.nls +c_874.nls +c_875.nls +c_878.nls +c_932.nls +c_936.nls +c_949.nls +c_950.nls +l_intl.nls diff --git a/reactos/tools/rbuild/backend/mingw/mingw.cpp b/reactos/tools/rbuild/backend/mingw/mingw.cpp index 27482c3c0fb..59f0da19829 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.cpp +++ b/reactos/tools/rbuild/backend/mingw/mingw.cpp @@ -20,6 +20,28 @@ using std::map; typedef set set_string; typedef map directory_map; + +string +v2s ( const string_list& v, int wrap_at ) +{ + if ( !v.size() ) + return ""; + string s; + int wrap_count = 0; + for ( size_t i = 0; i < v.size(); i++ ) + { + if ( !v[i].size() ) + continue; + if ( wrap_at > 0 && wrap_count++ == wrap_at ) + s += " \\\n\t\t"; + else if ( s.size() ) + s += " "; + s += v[i]; + } + return s; +} + + class Directory { public: @@ -262,6 +284,7 @@ MingwBackend::Process () GenerateGlobalVariables (); GenerateXmlBuildFilesMacro (); ProcessModules (); + GenerateInstallTarget (); GenerateDirectories (); CheckAutomaticDependencies (); CloseMakefile (); @@ -590,3 +613,85 @@ MingwBackend::DetectPCHSupport () // TODO FIXME - eventually check for ROS_USE_PCH env var and // allow that to override use_pch if true } + +string +MingwBackend::GetNonModuleInstallDirectories ( const string& installDirectory ) +{ + string directories; + for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) + { + const InstallFile& installfile = *ProjectNode.installfiles[i]; + string targetDirectory ( installDirectory + SSEP + installfile.base ); + if ( directories.size () > 0 ) + directories += " "; + directories += MingwModuleHandler::PassThruCacheDirectory ( + FixupTargetFilename ( targetDirectory ), + true ); + } + return directories; +} + +string +MingwBackend::GetInstallDirectories ( const string& installDirectory ) +{ + return GetNonModuleInstallDirectories ( installDirectory ); +} + +void +MingwBackend::GetNonModuleInstallFiles ( + vector& out ) const +{ + for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) + { + const InstallFile& installfile = *ProjectNode.installfiles[i]; + out.push_back ( NormalizeFilename ( installfile.GetPath () ) ); + } +} + +void +MingwBackend::GetInstallFiles ( + vector& out ) const +{ + GetNonModuleInstallFiles ( out ); +} + +void +MingwBackend::OutputInstallfileCopyCommands ( const string& installDirectory ) +{ + for ( size_t i = 0; i < ProjectNode.installfiles.size (); i++ ) + { + const InstallFile& installfile = *ProjectNode.installfiles[i]; + string targetFilenameNoFixup = installDirectory + SSEP + installfile.base + SSEP + installfile.newname; + string targetFilename = MingwModuleHandler::PassThruCacheDirectory ( + FixupTargetFilename ( targetFilenameNoFixup ), + true ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); + fprintf ( fMakefile, + "\t${cp} %s %s\n", + installfile.GetPath ().c_str (), + targetFilename.c_str () ); + } +} + +void +MingwBackend::GenerateInstallTarget () +{ + string installDirectoryNoFixup = "reactos"; + string installDirectory = MingwModuleHandler::PassThruCacheDirectory ( + FixupTargetFilename ( installDirectoryNoFixup ), + true ); + string installDirectories = GetInstallDirectories ( installDirectoryNoFixup ); + vector vInstallFiles; + GetInstallFiles ( vInstallFiles ); + string installFiles = v2s ( vInstallFiles, 5 ); + + fprintf ( fMakefile, + "install: all %s %s %s\n", + installDirectory.c_str (), + installDirectories.c_str (), + installFiles.c_str () ); + OutputInstallfileCopyCommands ( installDirectoryNoFixup ); + fprintf ( fMakefile, + "\n" ); +} diff --git a/reactos/tools/rbuild/backend/mingw/mingw.h b/reactos/tools/rbuild/backend/mingw/mingw.h index 696bc35c31a..7843581e77d 100644 --- a/reactos/tools/rbuild/backend/mingw/mingw.h +++ b/reactos/tools/rbuild/backend/mingw/mingw.h @@ -12,6 +12,9 @@ class Directory; class MingwModuleHandler; +extern std::string +v2s ( const string_list& v, int wrap_at ); + class MingwBackend : public Backend { public: @@ -41,6 +44,12 @@ private: void DetectPipeSupport (); void DetectPCHSupport (); void ProcessModules (); + std::string GetNonModuleInstallDirectories ( const std::string& installDirectory ); + std::string GetInstallDirectories ( const std::string& installDirectory ); + void GetNonModuleInstallFiles ( std::vector& out ) const; + void GetInstallFiles ( std::vector& out ) const; + void OutputInstallfileCopyCommands ( const std::string& installDirectory ); + void GenerateInstallTarget (); FILE* fMakefile; bool use_pch; Directory *int_directories, *out_directories; diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 512a660e3a6..3024d10b24a 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -40,26 +40,6 @@ PrefixFilename ( return out; } -string -v2s ( const string_list& v, int wrap_at ) -{ - if ( !v.size() ) - return ""; - string s; - int wrap_count = 0; - for ( size_t i = 0; i < v.size(); i++ ) - { - if ( !v[i].size() ) - continue; - if ( wrap_at > 0 && wrap_count++ == wrap_at ) - s += " \\\n\t\t"; - else if ( s.size() ) - s += " "; - s += v[i]; - } - return s; -} - string GetTargetMacro ( const Module& module, bool with_dollar ) { @@ -1570,6 +1550,7 @@ MingwModuleHandler::GetDefinitionDependencies ( } } + MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( const Module& module_ ) : MingwModuleHandler ( module_ ) { @@ -2205,6 +2186,8 @@ MingwIsoModuleHandler::OutputBootstrapfileCopyCommands ( { string targetFilenameNoFixup ( bootcdDirectory + SSEP + m.bootstrap->base + SSEP + m.bootstrap->nameoncd ); string targetFilename ( GetTargetMacro ( module ) ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); fprintf ( fMakefile, "\t${cp} %s %s\n", m.GetPath ().c_str (), @@ -2221,7 +2204,11 @@ MingwIsoModuleHandler::OutputCdfileCopyCommands ( { const CDFile& cdfile = *module.project.cdfiles[i]; string targetFilenameNoFixup = bootcdDirectory + SSEP + cdfile.base + SSEP + cdfile.nameoncd; - string targetFilename = GetTargetMacro(module); + string targetFilename = MingwModuleHandler::PassThruCacheDirectory ( + FixupTargetFilename ( targetFilenameNoFixup ), + true ); + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); fprintf ( fMakefile, "\t${cp} %s %s\n", cdfile.GetPath ().c_str (), diff --git a/reactos/tools/rbuild/installfile.cpp b/reactos/tools/rbuild/installfile.cpp new file mode 100644 index 00000000000..1e497f40203 --- /dev/null +++ b/reactos/tools/rbuild/installfile.cpp @@ -0,0 +1,42 @@ +#include "pch.h" +#include + +#include "rbuild.h" + +using std::string; + +InstallFile::InstallFile ( const Project& project_, + const XMLElement& installfileNode, + const string& path ) + : project ( project_ ), + node ( installfileNode ) +{ + const XMLAttribute* att = node.GetAttribute ( "base", false ); + if ( att != NULL ) + base = att->value; + else + base = ""; + + att = node.GetAttribute ( "newname", false ); + if ( att != NULL ) + newname = att->value; + else + newname = node.value; + name = node.value; + this->path = path; +} + +InstallFile::~InstallFile () +{ +} + +string +InstallFile::GetPath () const +{ + return path + SSEP + name; +} + +void +InstallFile::ProcessXML() +{ +} diff --git a/reactos/tools/rbuild/project.cpp b/reactos/tools/rbuild/project.cpp index e3d51fa7760..c10da9fa2ad 100644 --- a/reactos/tools/rbuild/project.cpp +++ b/reactos/tools/rbuild/project.cpp @@ -24,6 +24,8 @@ Project::~Project () delete linkerFlags[i]; for ( i = 0; i < cdfiles.size (); i++ ) delete cdfiles[i]; + for ( i = 0; i < installfiles.size (); i++ ) + delete installfiles[i]; delete head; } @@ -220,6 +222,8 @@ Project::ProcessXML ( const string& path ) non_if_data.ProcessXML (); for ( i = 0; i < cdfiles.size (); i++ ) cdfiles[i]->ProcessXML (); + for ( i = 0; i < installfiles.size (); i++ ) + installfiles[i]->ProcessXML (); } void @@ -251,6 +255,12 @@ Project::ProcessXMLSubElement ( const XMLElement& e, cdfiles.push_back ( cdfile ); subs_invalid = true; } + else if ( e.name == "installfile" ) + { + InstallFile* installfile = new InstallFile ( *this, e, path ); + installfiles.push_back ( installfile ); + subs_invalid = true; + } else if ( e.name == "directory" ) { const XMLAttribute* att = e.GetAttribute ( "name", true ); diff --git a/reactos/tools/rbuild/rbuild.h b/reactos/tools/rbuild/rbuild.h index b7db6cf9202..0a1949eed64 100644 --- a/reactos/tools/rbuild/rbuild.h +++ b/reactos/tools/rbuild/rbuild.h @@ -58,6 +58,7 @@ class Property; class AutomaticDependency; class Bootstrap; class CDFile; +class InstallFile; class PchFile; class StubbedComponent; class StubbedSymbol; @@ -89,6 +90,7 @@ public: std::vector modules; std::vector linkerFlags; std::vector cdfiles; + std::vector installfiles; IfableData non_if_data; Project ( const std::string& filename ); @@ -518,6 +520,25 @@ public: }; +class InstallFile +{ +public: + const Project& project; + const XMLElement& node; + std::string name; + std::string base; + std::string newname; + std::string path; + + InstallFile ( const Project& project, + const XMLElement& bootstrapNode, + const std::string& path ); + ~InstallFile (); + void ProcessXML (); + std::string GetPath () const; +}; + + class PchFile { public: diff --git a/reactos/tools/rbuild/rbuild.mak b/reactos/tools/rbuild/rbuild.mak index 6f79c3b749c..ce6754021ac 100644 --- a/reactos/tools/rbuild/rbuild.mak +++ b/reactos/tools/rbuild/rbuild.mak @@ -117,6 +117,7 @@ RBUILD_COMMON_SOURCES = \ define.cpp \ exception.cpp \ include.cpp \ + installfile.cpp \ linkerflag.cpp \ module.cpp \ project.cpp \ @@ -209,6 +210,10 @@ $(RBUILD_INT_)include.o: $(RBUILD_BASE_)include.cpp $(RBUILD_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ +$(RBUILD_INT_)installfile.o: $(RBUILD_BASE_)installfile.cpp $(RBUILD_INT) + $(ECHO_CC) + ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ + $(RBUILD_INT_)linkerflag.o: $(RBUILD_BASE_)linkerflag.cpp $(RBUILD_INT) $(ECHO_CC) ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@ diff --git a/reactos/tools/rbuild/rbuild.txt b/reactos/tools/rbuild/rbuild.txt index 1b21fea68b1..9e90c9aec79 100644 --- a/reactos/tools/rbuild/rbuild.txt +++ b/reactos/tools/rbuild/rbuild.txt @@ -341,6 +341,24 @@ Elements: None. +Installfile element +------------------- +An installfile element specifies the name of a file that is to be installed when using 'make install'. + +Syntax: + ReadMe.txt + +Attributes: + base - Put file in this directory within the install directory. This attribute is optional. + newname - Name of file within the install directory. This attribute is optional. + +Value: + Name of file. + +Elements: + None. + + Invoke element -------------- An invoke element specifies the name of a module which is to be executed before the current module is processed.