From d7fdb5701e3d8c5ea6caa18d77f836e2172c466d Mon Sep 17 00:00:00 2001 From: Casper Hornstrup Date: Sat, 2 Apr 2005 21:45:16 +0000 Subject: [PATCH] Generate map files svn path=/branches/xmlbuildsystem/; revision=14461 --- .../rbuild/backend/mingw/modulehandler.cpp | 44 +++++++++++++++++-- .../rbuild/backend/mingw/modulehandler.h | 1 + reactos/tools/winebuild/winebuild.mak | 2 +- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index 3fa62b07d60..ce744933476 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -937,6 +937,41 @@ MingwModuleHandler::GenerateCommands ( sourceFilename.c_str () ); } +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, @@ -1018,7 +1053,10 @@ MingwModuleHandler::GenerateLinkerCommand ( 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 @@ MingwModuleHandler::GenerateOtherMacros () fprintf ( fMakefile, - "%s += $(PROJECT_CFLAGS)\n", + "%s += $(PROJECT_CFLAGS) -g\n", cflagsMacro.c_str () ); fprintf ( @@ -1252,7 +1290,7 @@ MingwModuleHandler::GenerateOtherMacros () fprintf ( fMakefile, - "%s_LFLAGS += $(PROJECT_LFLAGS)\n", + "%s_LFLAGS += $(PROJECT_LFLAGS) -g\n", module.name.c_str () ); fprintf ( diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index c5b820cc107..87927fd295c 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -147,6 +147,7 @@ private: bool IsWineModule () const; std::string GetDefinitionFilename () const; static std::string RemoveVariables ( std::string path); + void GenerateBuildMapCode (); public: const Module& module; string_list clean_files; diff --git a/reactos/tools/winebuild/winebuild.mak b/reactos/tools/winebuild/winebuild.mak index 3b3248e1221..1cecc1d5d80 100644 --- a/reactos/tools/winebuild/winebuild.mak +++ b/reactos/tools/winebuild/winebuild.mak @@ -12,7 +12,7 @@ $(WINEBUILD_INT): $(TOOLS_INT) ifneq ($(INTERMEDIATE),$(OUTPUT)) $(WINEBUILD_OUT): $(TOOLS_OUT) $(ECHO_MKDIR) - @{mkdir} $@ + ${mkdir} $@ endif WINEBUILD_TARGET = \