diff --git a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
index 09b1b7ead42..8e935cd6655 100644
--- a/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
+++ b/reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
@@ -747,7 +747,7 @@ CBBackend::_generate_cbproj ( const Module& module )
else if ( extension == ".idl" || extension == ".IDL" )
{
fprintf ( OUT, "\t\t\t\r\n" );
- fprintf ( OUT, "\t\t\t\r\n", outdir.c_str(), widl_options.c_str(), windres_defines.c_str(), widl_options.c_str() );
+ fprintf ( OUT, "\t\t\t\r\n", outdir.c_str(), widl_options.c_str(), windres_defines.c_str(), widl_options.c_str() );
}
else if ( extension == ".spec" || extension == ".SPEC" )
{
diff --git a/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp b/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
new file mode 100644
index 00000000000..8b3e6d5c2a7
--- /dev/null
+++ b/reactos/tools/rbuild/backend/dependencymap/dependencymap.cpp
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2007 Christoph von Wittich
+ *
+ * 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.
+ */
+#ifdef _MSC_VER
+#pragma warning ( disable : 4786 )
+#endif//_MSC_VER
+
+#include
+#include
+#include
+#include
+
+#include
+
+#include "dependencymap.h"
+#include "../mingw/mingw.h"
+
+using std::string;
+using std::vector;
+using std::ifstream;
+
+#ifdef OUT
+#undef OUT
+#endif//OUT
+
+
+static class DepMapFactory : public Backend::Factory
+{
+ public:
+
+ DepMapFactory() : Factory("DepMap", "Dependency Map") {}
+ Backend *operator() (Project &project,
+ Configuration& configuration)
+ {
+ return new DepMapBackend(project, configuration);
+ }
+
+} factory;
+
+
+DepMapBackend::DepMapBackend(Project &project,
+ Configuration& configuration) : Backend(project, configuration)
+{
+
+}
+
+void DepMapBackend::Process()
+{
+ string filename_depmap ( "dependencymap.xml" );
+ printf ( "Creating dependecy map: %s\n", filename_depmap.c_str() );
+
+ m_DepMapFile = fopen ( filename_depmap.c_str(), "wb" );
+
+ if ( !m_DepMapFile )
+ {
+ printf ( "Could not create file '%s'.\n", filename_depmap.c_str() );
+ return;
+ }
+
+ _generate_depmap ( m_DepMapFile );
+
+ fclose ( m_DepMapFile );
+ printf ( "Done.\n" );
+}
+
+void
+DepMapBackend::_clean_project_files ( void )
+{
+ remove ( "dependencymap.xml" );
+}
+
+void
+DepMapBackend::_generate_depmap ( FILE* OUT )
+{
+
+ /* add dependencies */
+ for ( size_t i = 0; i < ProjectNode.modules.size(); i++ )
+ {
+ Module& module = *ProjectNode.modules[i];
+
+ if ((module.type != Iso) &&
+ (module.type != LiveIso) &&
+ (module.type != IsoRegTest) &&
+ (module.type != LiveIsoRegTest))
+ {
+ vector ifs_list;
+ ifs_list.push_back ( &module.project.non_if_data );
+ ifs_list.push_back ( &module.non_if_data );
+ while ( ifs_list.size() )
+ {
+ const IfableData& data = *ifs_list.back();
+ ifs_list.pop_back();
+ const vector& libs = data.libraries;
+ for ( size_t j = 0; j < libs.size(); j++ )
+ {
+ //add module.name and libs[j]->name
+ }
+ }
+ }
+ }
+
+/* save data to file
+ fprintf ( OUT, "\r\n" );
+*/
+}
+
+
+DepMapConfiguration::DepMapConfiguration ( const std::string &name )
+{
+ /* nothing to do here */
+}
+
+
diff --git a/reactos/tools/rbuild/backend/dependencymap/dependencymap.h b/reactos/tools/rbuild/backend/dependencymap/dependencymap.h
new file mode 100644
index 00000000000..493daf6ba9b
--- /dev/null
+++ b/reactos/tools/rbuild/backend/dependencymap/dependencymap.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2007 Christoph von Wittich
+ *
+ * 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.
+ */
+#ifndef __DEPMAP_H__
+#define __DEPMAP_H__
+
+#include
+#include
+#include
+
+#include "../backend.h"
+
+class DepMapConfiguration
+{
+ public:
+ DepMapConfiguration(const std::string &name = "");
+ virtual ~DepMapConfiguration() {}
+ std::string name;
+};
+
+class DepMapBackend : public Backend
+{
+ public:
+
+ DepMapBackend(Project &project,
+ Configuration& configuration);
+ virtual ~DepMapBackend() {}
+
+ virtual void Process();
+
+ private:
+
+ FILE* m_DepMapFile;
+
+ std::vector m_configurations;
+ void _generate_depmap ( FILE* OUT );
+ void _clean_project_files ( void );
+
+};
+
+
+#endif // __DEPMAP_H__
+
diff --git a/reactos/tools/rbuild/rbuild.mak b/reactos/tools/rbuild/rbuild.mak
index cc7b536e955..3b83d67941e 100644
--- a/reactos/tools/rbuild/rbuild.mak
+++ b/reactos/tools/rbuild/rbuild.mak
@@ -119,6 +119,23 @@ $(RBUILD_CODEBLOCKS_OUT): | $(RBUILD_BACKEND_OUT)
${mkdir} $@
endif
+RBUILD_DEPMAP_BASE = $(RBUILD_BACKEND_BASE_)dependencymap
+RBUILD_DEPMAP_BASE_ = $(RBUILD_DEPMAP_BASE)$(SEP)
+RBUILD_DEPMAP_INT = $(INTERMEDIATE_)$(RBUILD_DEPMAP_BASE)
+RBUILD_DEPMAP_INT_ = $(RBUILD_DEPMAP_INT)$(SEP)
+RBUILD_DEPMAP_OUT = $(OUTPUT_)$(RBUILD_DEPMAP_BASE)
+RBUILD_DEPMAP_OUT_ = $(RBUILD_DEPMAP_OUT)$(SEP)
+
+$(RBUILD_DEPMAP_INT): | $(RBUILD_BACKEND_INT)
+ $(ECHO_MKDIR)
+ ${mkdir} $@
+
+ifneq ($(INTERMEDIATE),$(OUTPUT))
+$(RBUILD_DEPMAP_OUT): | $(RBUILD_BACKEND_OUT)
+ $(ECHO_MKDIR)
+ ${mkdir} $@
+endif
+
RBUILD_MSVC_BASE = $(RBUILD_BACKEND_BASE_)msvc
RBUILD_MSVC_BASE_ = $(RBUILD_MSVC_BASE)$(SEP)
@@ -158,6 +175,11 @@ RBUILD_BACKEND_CODEBLOCKS_BASE_SOURCES = $(addprefix $(RBUILD_CODEBLOCKS_BASE_),
codeblocks.cpp \
)
+RBUILD_BACKEND_DEPMAP_BASE_SOURCES = $(addprefix $(RBUILD_DEPMAP_BASE_), \
+ dependencymap.cpp \
+ )
+
+
RBUILD_BACKEND_MSVC_BASE_SOURCES = $(addprefix $(RBUILD_MSVC_BASE_), \
genguid.cpp \
msvc.cpp \
@@ -170,6 +192,7 @@ RBUILD_BACKEND_SOURCES = \
$(RBUILD_BACKEND_DEVCPP_BASE_SOURCES) \
$(RBUILD_BACKEND_MSVC_BASE_SOURCES) \
$(RBUILD_BACKEND_CODEBLOCKS_BASE_SOURCES) \
+ $(RBUILD_BACKEND_DEPMAP_BASE_SOURCES) \
$(RBUILD_BACKEND_BASE_)backend.cpp
RBUILD_COMMON_SOURCES = \
@@ -225,6 +248,9 @@ RBUILD_BACKEND_MSVCCPP_HEADERS = \
RBUILD_BACKEND_CODEBLOCKS_HEADERS = \
codeblocks.h
+RBUILD_BACKEND_DEPMAP_HEADERS = \
+ dependencymap.h
+
RBUILD_BACKEND_MINGW_HEADERS = \
mingw.h \
modulehandler.h
@@ -234,7 +260,8 @@ RBUILD_BACKEND_HEADERS = \
$(addprefix devcpp$(SEP), $(RBUILD_BACKEND_DEVCPP_HEADERS)) \
$(addprefix msvc$(SEP), $(RBUILD_BACKEND_MSVC_HEADERS)) \
$(addprefix mingw$(SEP), $(RBUILD_BACKEND_MINGW_HEADERS)) \
- $(addprefix codeblocks$(SEP), $(RBUILD_BACKEND_CODEBLOCKS_HEADERS))
+ $(addprefix codeblocks$(SEP), $(RBUILD_BACKEND_CODEBLOCKS_HEADERS)) \
+ $(addprefix dependencymap$(SEP), $(RBUILD_BACKEND_DEPMAP_HEADERS))
RBUILD_HEADERS = \
$(addprefix $(RBUILD_BASE_), \
@@ -403,6 +430,10 @@ $(RBUILD_CODEBLOCKS_INT_)codeblocks.o: $(RBUILD_CODEBLOCKS_BASE_)codeblocks.cpp
$(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
+$(RBUILD_DEPMAP_INT_)dependencymap.o: $(RBUILD_DEPMAP_BASE_)dependencymap.cpp $(RBUILD_HEADERS) | $(RBUILD_DEPMAP_INT)
+ $(ECHO_CC)
+ ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@
+
$(RBUILD_MSVC_INT_)genguid.o: $(RBUILD_MSVC_BASE_)genguid.cpp $(RBUILD_HEADERS) | $(RBUILD_MSVC_INT)
$(ECHO_CC)
${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@