ROS_BUILDNOSTRIP environment variable to control building of non-symbol-stripped...
[reactos.git] / reactos / tools / rbuild / backend / mingw / modulehandler.cpp
index fe15b2e..d18cf9e 100644 (file)
@@ -1146,6 +1146,32 @@ MingwModuleHandler::GenerateBuildMapCode ()
                  "endif\n" );\r
 }\r
 \r
+void\r
+MingwModuleHandler::GenerateBuildNonSymbolStrippedCode ()\r
+{\r
+       fprintf ( fMakefile,\r
+                 "ifeq ($(ROS_BUILDNOSTRIP),yes)\n" );\r
+\r
+       string filename = module.GetPath ();\r
+       string outputFilename = PassThruCacheDirectory (\r
+               filename,\r
+               backend->outputDirectory );\r
+       string nostripFilename = PassThruCacheDirectory (\r
+               GetBasename ( filename ) + ".nostrip" + GetExtension ( filename ),\r
+               backend->outputDirectory );\r
+       CLEAN_FILE ( nostripFilename );\r
+       \r
+       fprintf ( fMakefile,\r
+                 "\t$(ECHO_CP)\n" );\r
+       fprintf ( fMakefile,\r
+                         "\t${cp} %s %s 1>$(NUL)\n",\r
+                         outputFilename.c_str (),\r
+                 nostripFilename.c_str () );\r
+       \r
+       fprintf ( fMakefile,\r
+                 "endif\n" );\r
+}\r
+\r
 void\r
 MergeStringVector ( const vector<string>& input,\r
                        vector<string>& output )\r
@@ -1289,6 +1315,8 @@ MingwModuleHandler::GenerateLinkerCommand (
 \r
        GenerateBuildMapCode ();\r
 \r
+       GenerateBuildNonSymbolStrippedCode ();\r
+\r
        fprintf ( fMakefile,\r
                  "\t$(ECHO_RSYM)\n" );\r
        fprintf ( fMakefile,\r