Generate map files
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.h
Modified: branches/xmlbuildsystem/reactos/tools/winebuild/winebuild.mak

Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.cpp
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.cpp	2005-04-02 21:06:44 UTC (rev 14460)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.cpp	2005-04-02 21:45:16 UTC (rev 14461)
@@ -938,6 +938,41 @@
 }
 
 void
+MingwModuleHandler::GenerateBuildMapCode ()
+{
+	fprintf ( fMakefile,
+	          "ifeq ($(ROS_BUILDMAP),full)\n" );
+
+	string mapFilename = PassThruCacheDirectory (
+		GetBasename ( module.GetPath () ) + ".map",
+		true );
+	CLEAN_FILE ( mapFilename );
+	
+	fprintf ( fMakefile,
+	          "\t$(ECHO_OBJDUMP)\n" );
+	fprintf ( fMakefile,
+	          "\t$(Q)${objdump} -d -S $@ > %s\n",
+	          mapFilename.c_str () );
+
+	fprintf ( fMakefile,
+	          "else\n" );
+	fprintf ( fMakefile,
+	          "ifeq ($(ROS_BUILDMAP),yes)\n" );
+
+	fprintf ( fMakefile,
+	          "\t$(ECHO_NM)\n" );
+	fprintf ( fMakefile,
+	          "\t$(Q)${nm} --numeric-sort $@ > %s\n",
+	          mapFilename.c_str () );
+
+	fprintf ( fMakefile,
+	          "endif\n" );
+
+	fprintf ( fMakefile,
+	          "endif\n" );
+}
+
+void
 MingwModuleHandler::GenerateLinkerCommand (
 	const string& dependencies,
 	const string& linker,
@@ -1018,8 +1053,11 @@
 		          GetLinkerMacro ().c_str () );
 	}
 
-	fprintf ( fMakefile, "\t$(ECHO_RSYM)\n" );
+	GenerateBuildMapCode ();
+
 	fprintf ( fMakefile,
+	          "\t$(ECHO_RSYM)\n" );
+	fprintf ( fMakefile,
 	          "\t$(Q)$(RSYM_TARGET) $@ $@\n\n" );
 }
 
@@ -1242,7 +1280,7 @@
 
 	fprintf (
 		fMakefile,
-		"%s += $(PROJECT_CFLAGS)\n",
+		"%s += $(PROJECT_CFLAGS) -g\n",
 		cflagsMacro.c_str () );
 
 	fprintf (
@@ -1252,7 +1290,7 @@
 
 	fprintf (
 		fMakefile,
-		"%s_LFLAGS += $(PROJECT_LFLAGS)\n",
+		"%s_LFLAGS += $(PROJECT_LFLAGS) -g\n",
 		module.name.c_str () );
 
 	fprintf (

Modified: branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.h
--- branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.h	2005-04-02 21:06:44 UTC (rev 14460)
+++ branches/xmlbuildsystem/reactos/tools/rbuild/backend/mingw/modulehandler.h	2005-04-02 21:45:16 UTC (rev 14461)
@@ -147,6 +147,7 @@
 	bool IsWineModule () const;
 	std::string GetDefinitionFilename () const;
 	static std::string RemoveVariables ( std::string path);
+	void GenerateBuildMapCode ();
 public:
 	const Module& module;
 	string_list clean_files;

Modified: branches/xmlbuildsystem/reactos/tools/winebuild/winebuild.mak
--- branches/xmlbuildsystem/reactos/tools/winebuild/winebuild.mak	2005-04-02 21:06:44 UTC (rev 14460)
+++ branches/xmlbuildsystem/reactos/tools/winebuild/winebuild.mak	2005-04-02 21:45:16 UTC (rev 14461)
@@ -12,7 +12,7 @@
 ifneq ($(INTERMEDIATE),$(OUTPUT))
 $(WINEBUILD_OUT): $(TOOLS_OUT)
 	$(ECHO_MKDIR)
-	@{mkdir} $@
+	${mkdir} $@
 endif
 
 WINEBUILD_TARGET = \