fixed some dependency issues, verbose support, 'make clean' gets more
authorRoyce Mitchell III <royce3@ev1.net>
Wed, 9 Mar 2005 08:12:30 +0000 (08:12 +0000)
committerRoyce Mitchell III <royce3@ev1.net>
Wed, 9 Mar 2005 08:12:30 +0000 (08:12 +0000)
svn path=/branches/xmlbuildsystem/; revision=13899

15 files changed:
reactos/Makefile
reactos/tools/Makefile
reactos/tools/buildno/makefile
reactos/tools/cdmake/makefile
reactos/tools/nci/makefile
reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.h
reactos/tools/rbuild/makefile
reactos/tools/rbuild/module.cpp
reactos/tools/rbuild/rbuild.h
reactos/tools/unicode/makefile
reactos/tools/wmc/makefile
reactos/tools/wpp/Makefile
reactos/tools/wrc/makefile

index 68543c4..0a874e8 100644 (file)
@@ -1,37 +1,52 @@
-host_gcc = gcc
-host_gpp = g++
-host_ld = ld
-host_ar = ar
-host_objcopy = objcopy
+# Default to half-verbose mode
+ifeq ($(VERBOSE),no)
+  Q = @
+  HALFVERBOSEECHO = @:
+else
+ifeq ($(VERBOSE),yes)
+  Q =
+  HALFVERBOSEECHO = @:
+else
+  Q = @
+  HALFVERBOSEECHO = @echo
+endif
+endif
+
+
+host_gcc = $(Q)gcc
+host_gpp = $(Q)g++
+host_ld = $(Q)ld
+host_ar = $(Q)ar
+host_objcopy = $(Q)objcopy
 ifeq ($(HOST),mingw32-linux)
        EXEPREFIX = ./
        EXEPOSTFIX =
        SEP = /
-       nmkdir = mkdir -p
-       gcc = mingw32-gcc
-       gpp = mingw32-g++
-       ld = mingw32-ld
-       ar = mingw32-ar
-       objcopy = mingw32-objcopy
-       dlltool = mingw32-dlltool
-       windres = mingw32-windres
+       nmkdir = $(Q)mkdir -p
+       gcc = $(Q)mingw32-gcc
+       gpp = $(Q)mingw32-g++
+       ld = $(Q)mingw32-ld
+       ar = $(Q)mingw32-ar
+       objcopy = $(Q)mingw32-objcopy
+       dlltool = $(Q)mingw32-dlltool
+       windres = $(Q)mingw32-windres
        rm = rm -f
-       cp = cp
+       cp = $(Q)cp
        NUL = /dev/null
 else # mingw32-windows
        EXEPREFIX =
        EXEPOSTFIX = .exe
        SEP = \$(EMPTY_VAR)
-       nmkdir = mkdir
-       gcc = gcc
-       gpp = g++
-       ld = ld
-       ar = ar
-       objcopy = objcopy
-       dlltool = dlltool
-       windres = windres
+       nmkdir = $(Q)mkdir
+       gcc = $(Q)gcc
+       gpp = $(Q)g++
+       ld = $(Q)ld
+       ar = $(Q)ar
+       objcopy = $(Q)objcopy
+       dlltool = $(Q)dlltool
+       windres = $(Q)windres
        rm = del /f /q
-       cp = copy /y
+       cp = $(Q)copy /y
        NUL = NUL
 endif
 
@@ -62,7 +77,8 @@ PREAUTO := \
 
 Makefile.auto: $(RMKDIR_TARGET) $(BUILDNO_TARGET) $(NCI_SERVICE_FILES) $(WMC_TARGET) $(WRC_TARGET) \
                $(RSYM_TARGET) $(CDMAKE_TARGET) $(RBUILD_TARGET) $(PREAUTO) $(XMLBUILDFILES)
-       tools$(SEP)rbuild$(SEP)rbuild$(EXEPOSTFIX) mingw
+       $(HALFVERBOSEECHO) [RBUILD]  makefile.auto
+       $(Q)tools$(SEP)rbuild$(SEP)rbuild$(EXEPOSTFIX) mingw
 
 
 include$(SEP)reactos$(SEP)bugcodes.h ntoskrnl$(SEP)bugcodes.rc: $(WMC_TARGET) ntoskrnl$(SEP)ntoskrnl.mc
index 1e0d2ef..db16985 100644 (file)
@@ -14,9 +14,11 @@ RMKDIR_HOST_CFLAGS = -g -Werror -Wall
 RMKDIR_HOST_LFLAGS = -g
 
 $(RMKDIR_TARGET): $(RMKDIR_OBJECTS)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gcc} $(RMKDIR_OBJECTS) $(RMKDIR_HOST_LFLAGS) -o $(RMKDIR_TARGET)
 
 $(RMKDIR_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(RMKDIR_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: rmkdir_clean
@@ -41,9 +43,11 @@ RSYM_HOST_CFLAGS = -g -Werror -Wall
 RSYM_HOST_LFLAGS = -g
 
 $(RSYM_TARGET): $(RSYM_OBJECTS)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gcc} $(RSYM_OBJECTS) $(RSYM_HOST_LFLAGS) -o $(RSYM_TARGET)
 
 $(RSYM_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(RSYM_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: rsym_clean
index a7136ac..33aebff 100644 (file)
@@ -17,9 +17,11 @@ BUILDNO_HOST_CFLAGS = -Iinclude/reactos -g -Werror -Wall
 BUILDNO_HOST_LFLAGS = -g
 
 $(BUILDNO_TARGET): $(BUILDNO_OBJECTS)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gpp} $(BUILDNO_OBJECTS) $(BUILDNO_HOST_CFLAGS) -o $(BUILDNO_TARGET)
 
 $(BUILDNO_OBJECTS): %.o : %.cpp include$(SEP)reactos$(SEP)version.h
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gpp} $(BUILDNO_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: buildno_clean
index 57c4fef..36a0151 100644 (file)
@@ -15,9 +15,11 @@ CDMAKE_HOST_CFLAGS = -Iinclude -g -Werror -Wall
 CDMAKE_HOST_LFLAGS = -g
 
 $(CDMAKE_TARGET): $(CDMAKE_OBJECTS)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gcc} $(CDMAKE_OBJECTS) $(CDMAKE_HOST_CFLAGS) -o $(CDMAKE_TARGET)
 
 $(CDMAKE_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(CDMAKE_CFLAGS) -c $< -o $@
 
 .PHONY: cdmake_clean
index 92a2c25..3eaa91a 100644 (file)
@@ -14,9 +14,11 @@ NCI_HOST_CFLAGS = -Iinclude -g -Werror -Wall
 NCI_HOST_LFLAGS = -g
 
 $(NCI_TARGET): $(NCI_OBJECTS)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gcc} $(NCI_OBJECTS) $(NCI_HOST_CFLAGS) -o $(NCI_TARGET)
 
 $(NCI_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(NCI_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: nci_clean
@@ -45,7 +47,8 @@ NCI_SERVICE_FILES = \
        $(WIN32K_USER_STUBS)
 
 $(NCI_SERVICE_FILES): $(NCI_TARGET)
-       @$(EXEPREFIX)$(NCI_TARGET) \
+       $(HALFVERBOSEECHO) [NCI]     $@
+       $(Q)$(EXEPREFIX)$(NCI_TARGET) \
                $(KERNEL_SVC_DB) \
                $(WIN32K_SVC_DB) \
                $(KERNEL_SERVICE_TABLE) \
index 27d0245..9780ebe 100644 (file)
@@ -165,13 +165,13 @@ MingwBackend::GenerateProjectLFLAGS () const
 void\r
 MingwBackend::GenerateGlobalVariables () const\r
 {\r
-       fprintf ( fMakefile, "mkdir = tools" SSEP "rmkdir" EXEPOSTFIX "\n" );\r
-       fprintf ( fMakefile, "winebuild = tools" SSEP "winebuild" SSEP "winebuild" EXEPOSTFIX "\n" );\r
-       fprintf ( fMakefile, "bin2res = tools" SSEP "bin2res" SSEP "bin2res" EXEPOSTFIX "\n" );\r
-       fprintf ( fMakefile, "cabman = tools" SSEP "cabman" SSEP "cabman" EXEPOSTFIX "\n" );\r
-       fprintf ( fMakefile, "cdmake = tools" SSEP "cdmake" SSEP "cdmake" EXEPOSTFIX "\n" );\r
-       fprintf ( fMakefile, "rsym = tools" SSEP "rsym" EXEPOSTFIX "\n" );\r
-       fprintf ( fMakefile, "wrc = tools" SSEP "wrc" SSEP "wrc" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "mkdir = $(Q)tools" SSEP "rmkdir" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "winebuild = $(Q)tools" SSEP "winebuild" SSEP "winebuild" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "bin2res = $(Q)tools" SSEP "bin2res" SSEP "bin2res" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "cabman = $(Q)tools" SSEP "cabman" SSEP "cabman" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "cdmake = $(Q)tools" SSEP "cdmake" SSEP "cdmake" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "rsym = $(Q)tools" SSEP "rsym" EXEPOSTFIX "\n" );\r
+       fprintf ( fMakefile, "wrc = $(Q)tools" SSEP "wrc" SSEP "wrc" EXEPOSTFIX "\n" );\r
        fprintf ( fMakefile, "\n" );\r
        GenerateGlobalCFlagsAndProperties (\r
                "=",\r
@@ -201,11 +201,14 @@ void
 MingwBackend::GenerateAllTarget () const\r
 {\r
        fprintf ( fMakefile, "all:" );\r
+       int wrap_count = 0;\r
        for ( size_t i = 0; i < ProjectNode.modules.size (); i++ )\r
        {\r
                Module& module = *ProjectNode.modules[i];\r
                if ( IncludeInAllTarget ( module ) )\r
                {\r
+                       if ( wrap_count++ == 5 )\r
+                               fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0;\r
                        fprintf ( fMakefile,\r
                                  " %s",\r
                                  FixupTargetFilename ( module.GetPath () ).c_str () );\r
@@ -316,7 +319,9 @@ MingwBackend::ProcessModule ( Module& module ) const
        MingwModuleHandler* h = MingwModuleHandler::LookupHandler (\r
                module.node.location,\r
                module.type );\r
-       h->Process ( module );\r
+       MingwModuleHandler::string_list clean_files;\r
+       h->Process ( module, clean_files );\r
+       h->GenerateCleanTarget ( module, clean_files );\r
        h->GenerateDirectoryTargets ();\r
 }\r
 \r
index 62f2891..9ad9327 100644 (file)
@@ -12,6 +12,8 @@ using std::set;
 \r
 typedef set<string> set_string;\r
 \r
+#define CLEAN_FILE(f) clean_files.push_back ( f ); /*if ( module.name == "crt" ) printf ( "%s(%i): clean: %s\n", __FILE__, __LINE__, f.c_str() )*/\r
+\r
 map<ModuleType,MingwModuleHandler*>*\r
 MingwModuleHandler::handler_map = NULL;\r
 set_string\r
@@ -134,21 +136,6 @@ MingwModuleHandler::GetImportLibraryDependency ( const Module& importedModule )
                return PassThruCacheDirectory ( FixupTargetFilename ( importedModule.GetDependencyPath () ) );\r
 }\r
 \r
-string\r
-MingwModuleHandler::GetImportLibraryDependencies ( const Module& module ) const\r
-{\r
-       string dependencies ( "" );\r
-       for ( size_t i = 0; i < module.libraries.size (); i++ )\r
-       {\r
-               if ( dependencies.size () > 0 )\r
-                       dependencies += " ";\r
-               const Module* importedModule = module.project.LocateModule ( module.libraries[i]->name );\r
-               assert ( importedModule != NULL );\r
-               dependencies += GetImportLibraryDependency ( *importedModule );\r
-       }\r
-       return dependencies;\r
-}\r
-\r
 string\r
 MingwModuleHandler::GetModuleDependencies ( const Module& module ) const\r
 {\r
@@ -172,10 +159,10 @@ MingwModuleHandler::GetModuleDependencies ( const Module& module ) const
        return dependencies;\r
 }\r
 \r
-string\r
+/*string\r
 MingwModuleHandler::GetAllDependencies ( const Module& module ) const\r
 {\r
-       string dependencies = GetImportLibraryDependencies ( module );\r
+       string dependencies = GetImportMacro ( module );\r
        string s = GetModuleDependencies ( module );\r
        if ( s.length () > 0 )\r
        {\r
@@ -183,7 +170,7 @@ MingwModuleHandler::GetAllDependencies ( const Module& module ) const
                dependencies += s;\r
        }\r
        return dependencies;\r
-}\r
+}*/\r
 \r
 string\r
 MingwModuleHandler::GetSourceFilenames ( const Module& module,\r
@@ -241,6 +228,25 @@ MingwModuleHandler::GetObjectFilename ( const string& sourceFilename )
        return FixupTargetFilename ( ReplaceExtension ( sourceFilename, newExtension ) );\r
 }\r
 \r
+void\r
+MingwModuleHandler::GenerateCleanTarget (\r
+       const Module& module,\r
+       const string_list& clean_files ) const\r
+{\r
+       if ( 0 == clean_files.size() )\r
+               return;\r
+       fprintf ( fMakefile, ".PHONY: %s_clean\n", module.name.c_str() );\r
+       fprintf ( fMakefile, "%s_clean:\n\t-@$(rm)", module.name.c_str() );\r
+       for ( size_t i = 0; i < clean_files.size(); i++ )\r
+       {\r
+               if ( 9==((i+1)%10) )\r
+                       fprintf ( fMakefile, " 2>$(NUL)\n\t-@$(rm)" );\r
+               fprintf ( fMakefile, " %s", clean_files[i].c_str() );\r
+       }\r
+       fprintf ( fMakefile, " 2>$(NUL)\n" );\r
+       fprintf ( fMakefile, "clean: %s_clean\n\n", module.name.c_str() );\r
+}\r
+\r
 string\r
 MingwModuleHandler::GetObjectFilenames ( const Module& module ) const\r
 {\r
@@ -272,32 +278,38 @@ MingwModuleHandler::GenerateDirectoryTargets () const
        if ( directory_set.size () == 0 )\r
                return;\r
        \r
-       set_string::iterator i;\r
+       set_string::iterator it;\r
+       size_t wrap_count = 0;\r
        fprintf ( fMakefile, "directories::" );\r
 \r
-       for ( i = directory_set.begin ();\r
-             i != directory_set.end ();\r
-             i++ )\r
+       for ( it = directory_set.begin ();\r
+             it != directory_set.end ();\r
+             it++ )\r
        {\r
-               if ( IncludeDirectoryTarget ( *i ) )\r
+               if ( IncludeDirectoryTarget ( *it ) )\r
                {\r
+                       if ( wrap_count++ == 5 )\r
+                               fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0;\r
                        fprintf ( fMakefile,\r
                                  " %s",\r
-                                 i->c_str () );\r
+                                 it->c_str () );\r
                }\r
        }\r
 \r
        fprintf ( fMakefile, "\n\n" );\r
+       wrap_count = 0;\r
 \r
-       for ( i = directory_set.begin ();\r
-             i != directory_set.end ();\r
-             i++ )\r
+       for ( it = directory_set.begin ();\r
+             it != directory_set.end ();\r
+             it++ )\r
        {\r
-               if ( IncludeDirectoryTarget ( *i ) )\r
+               if ( IncludeDirectoryTarget ( *it ) )\r
                {\r
+                       if ( wrap_count++ == 5 )\r
+                               fprintf ( fMakefile, " \\\n\t\t" ), wrap_count = 0;\r
                        fprintf ( fMakefile,\r
                                  "%s ",\r
-                                 i->c_str () );\r
+                                 it->c_str () );\r
                }\r
        }\r
 \r
@@ -408,6 +420,23 @@ MingwModuleHandler::GenerateLinkerParametersFromVector ( const vector<LinkerFlag
        return parameters;\r
 }\r
 \r
+string\r
+MingwModuleHandler::GenerateImportLibraryDependenciesFromVector (\r
+       const vector<Library*>& libraries ) const\r
+{\r
+       string dependencies ( "" );\r
+       int wrap_count = 0;\r
+       for ( size_t i = 0; i < libraries.size (); i++ )\r
+       {\r
+               if ( wrap_count++ == 5 )\r
+                       dependencies += " \\\n\t\t", wrap_count = 0;\r
+               else if ( dependencies.size () > 0 )\r
+                       dependencies += " ";\r
+               dependencies += GetImportLibraryDependency ( *libraries[i]->imported_module );\r
+       }\r
+       return dependencies;\r
+}\r
+\r
 string\r
 MingwModuleHandler::GenerateLinkerParameters ( const Module& module ) const\r
 {\r
@@ -470,6 +499,7 @@ MingwModuleHandler::GenerateMacros (
        const vector<File*>& files,\r
        const vector<Include*>& includes,\r
        const vector<Define*>& defines,\r
+       const vector<Library*>& libraries,\r
        const vector<CompilerFlag*>* compilerFlags,\r
        const vector<LinkerFlag*>* linkerFlags,\r
        const vector<If*>& ifs,\r
@@ -477,7 +507,9 @@ MingwModuleHandler::GenerateMacros (
        const string& nasmflags_macro,\r
        const string& windresflags_macro,\r
        const string& linkerflags_macro,\r
-       const string& objs_macro) const\r
+       const string& objs_macro,\r
+       const string& libs_macro,\r
+       const string& linkdeps_macro ) const\r
 {\r
        size_t i;\r
 \r
@@ -508,7 +540,21 @@ MingwModuleHandler::GenerateMacros (
                                linkerParameters.c_str() );\r
                }\r
        }\r
-       \r
+\r
+       if ( libraries.size () > 0 )\r
+       {\r
+               string deps = GenerateImportLibraryDependenciesFromVector ( libraries );\r
+               if ( deps.size () > 0 )\r
+               {\r
+                       fprintf (\r
+                               fMakefile,\r
+                               "%s %s %s\n",\r
+                               libs_macro.c_str(),\r
+                               assignmentOperation,\r
+                               deps.c_str() );\r
+               }\r
+       }\r
+\r
        if ( files.size () > 0 )\r
        {\r
                for ( i = 0; i < files.size (); i++ )\r
@@ -544,7 +590,11 @@ MingwModuleHandler::GenerateMacros (
        for ( i = 0; i < ifs.size(); i++ )\r
        {\r
                If& rIf = *ifs[i];\r
-               if ( rIf.defines.size() || rIf.includes.size() || rIf.files.size() || rIf.ifs.size() )\r
+               if ( rIf.defines.size()\r
+                       || rIf.includes.size()\r
+                       || rIf.libraries.size()\r
+                       || rIf.files.size()\r
+                       || rIf.ifs.size() )\r
                {\r
                        fprintf (\r
                                fMakefile,\r
@@ -556,6 +606,7 @@ MingwModuleHandler::GenerateMacros (
                                rIf.files,\r
                                rIf.includes,\r
                                rIf.defines,\r
+                               rIf.libraries,\r
                                NULL,\r
                                NULL,\r
                                rIf.ifs,\r
@@ -563,7 +614,9 @@ MingwModuleHandler::GenerateMacros (
                                nasmflags_macro,\r
                                windresflags_macro,\r
                                linkerflags_macro,\r
-                               objs_macro );\r
+                               objs_macro,\r
+                               libs_macro,\r
+                               linkdeps_macro );\r
                        fprintf ( \r
                                fMakefile,\r
                                "endif\n\n" );\r
@@ -578,13 +631,16 @@ MingwModuleHandler::GenerateMacros (
        const string& nasmflags_macro,\r
        const string& windresflags_macro,\r
        const string& linkerflags_macro,\r
-       const string& objs_macro) const\r
+       const string& objs_macro,\r
+       const string& libs_macro,\r
+       const string& linkdeps_macro ) const\r
 {\r
        GenerateMacros (\r
                "=",\r
                module.files,\r
                module.includes,\r
                module.defines,\r
+               module.libraries,\r
                &module.compilerFlags,\r
                &module.linkerFlags,\r
                module.ifs,\r
@@ -592,23 +648,56 @@ MingwModuleHandler::GenerateMacros (
                nasmflags_macro,\r
                windresflags_macro,\r
                linkerflags_macro,\r
-               objs_macro );\r
-       fprintf ( fMakefile, "\n" );\r
+               objs_macro,\r
+               libs_macro,\r
+               linkdeps_macro );\r
+\r
+       if ( module.importLibrary )\r
+       {\r
+               string s;\r
+               for ( size_t i = 0; i < module.files.size (); i++ )\r
+               {\r
+                       File& file = *module.files[i];\r
+                       string extension = GetExtension ( file.name );\r
+                       if ( extension == ".spec" || extension == ".SPEC" )\r
+                       {\r
+                               if ( s.length () > 0 )\r
+                                       s += " ";\r
+                               s += GetSpecObjectDependencies ( file.name );\r
+                       }\r
+               }\r
+               if ( s.length () > 0 )\r
+               {\r
+                       fprintf (\r
+                               fMakefile,\r
+                               "%s += %s\n",\r
+                               linkdeps_macro.c_str(),\r
+                               s.c_str() );\r
+               }\r
+       }\r
 \r
        fprintf (\r
                fMakefile,\r
-               "%s += $(PROJECT_CFLAGS)\n\n",\r
+               "%s += $(PROJECT_CFLAGS)\n",\r
                cflags_macro.c_str () );\r
 \r
        fprintf (\r
                fMakefile,\r
-               "%s += $(PROJECT_RCFLAGS)\n\n",\r
+               "%s += $(PROJECT_RCFLAGS)\n",\r
                windresflags_macro.c_str () );\r
 \r
        fprintf (\r
                fMakefile,\r
-               "%s_LFLAGS += $(PROJECT_LFLAGS)\n\n",\r
+               "%s_LFLAGS += $(PROJECT_LFLAGS)\n",\r
                module.name.c_str () );\r
+\r
+       fprintf (\r
+               fMakefile,\r
+               "%s += $(%s)",\r
+               linkdeps_macro.c_str (),\r
+               libs_macro.c_str () );\r
+\r
+       fprintf ( fMakefile, "\n" );\r
 }\r
 \r
 void\r
@@ -622,6 +711,7 @@ MingwModuleHandler::GenerateGccCommand ( const Module& module,
                  "%s: %s\n",\r
                  objectFilename.c_str (),\r
                  sourceFilename.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [CC]      $<\n" );\r
        fprintf ( fMakefile,\r
                 "\t%s -c %s -o %s %s\n",\r
                 cc.c_str (),\r
@@ -641,6 +731,7 @@ MingwModuleHandler::GenerateGccAssemblerCommand ( const Module& module,
                  "%s: %s\n",\r
                  objectFilename.c_str (),\r
                  sourceFilename.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [GAS]     $<\n" );\r
        fprintf ( fMakefile,\r
                  "\t%s -x assembler-with-cpp -c %s -o %s -D__ASM__ %s\n",\r
                  cc.c_str (),\r
@@ -659,9 +750,10 @@ MingwModuleHandler::GenerateNasmCommand ( const Module& module,
                  "%s: %s\n",\r
                  objectFilename.c_str (),\r
                  sourceFilename.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [NASM]    $<\n" );\r
        fprintf ( fMakefile,\r
                  "\t%s -f win32 %s -o %s %s\n",\r
-                 "nasm",\r
+                 "$(Q)nasm",\r
                  sourceFilename.c_str (),\r
                  objectFilename.c_str (),\r
                  nasmflagsMacro.c_str () );\r
@@ -673,14 +765,15 @@ MingwModuleHandler::GenerateWindresCommand ( const Module& module,
                                              const string& windresflagsMacro ) const\r
 {\r
        string objectFilename = PassThruCacheDirectory ( MingwModuleHandler::GetObjectFilename ( sourceFilename ) );\r
-  string rciFilename = ReplaceExtension ( sourceFilename,\r
-                                          ".rci" );\r
-  string resFilename = ReplaceExtension ( sourceFilename,\r
-                                          ".res" );\r
+       string rciFilename = ReplaceExtension ( sourceFilename,\r
+                                               ".rci" );\r
+       string resFilename = ReplaceExtension ( sourceFilename,\r
+                                               ".res" );\r
        fprintf ( fMakefile,\r
                  "%s: %s\n",\r
                  objectFilename.c_str (),\r
                  sourceFilename.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [WRC]     $@\n" );\r
        fprintf ( fMakefile,\r
                 "\t${gcc} -xc -E -DRC_INVOKED ${%s} %s > %s\n",\r
                 windresflagsMacro.c_str (),\r
@@ -692,52 +785,66 @@ MingwModuleHandler::GenerateWindresCommand ( const Module& module,
                 rciFilename.c_str (),\r
                 resFilename.c_str () );\r
        fprintf ( fMakefile,\r
-                "\t${rm} %s\n",\r
+                "\t-@${rm} %s\n",\r
                 rciFilename.c_str () );\r
        fprintf ( fMakefile,\r
                 "\t${windres} %s -o %s\n",\r
                 resFilename.c_str (),\r
                 objectFilename.c_str () );\r
        fprintf ( fMakefile,\r
-                "\t${rm} %s\n",\r
+                "\t-@${rm} %s\n",\r
                 resFilename.c_str () );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateWinebuildCommands ( const Module& module,\r
-                                                const string& sourceFilename ) const\r
+MingwModuleHandler::GenerateWinebuildCommands (\r
+       const Module& module,\r
+       const string& sourceFilename,\r
+       string_list& clean_files ) const\r
 {\r
        string basename = GetBasename ( sourceFilename );\r
+\r
+       string def_file = basename + ".spec.def";\r
+       CLEAN_FILE ( def_file );\r
+\r
+       string stub_file = basename + ".stubs.c";\r
+       CLEAN_FILE ( stub_file );\r
+\r
        fprintf ( fMakefile,\r
-                 "%s.spec.def: %s\n",\r
-                 basename.c_str (),\r
+                 "%s: %s\n",\r
+                 def_file.c_str (),\r
                  sourceFilename.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [WINEBLD] $@\n" );\r
        fprintf ( fMakefile,\r
-                 "\t%s --def=%s -o %s.spec.def\n",\r
+                 "\t%s --def=%s -o %s\n",\r
                  "${winebuild}",\r
                  sourceFilename.c_str (),\r
-                 basename.c_str () );\r
+                 def_file.c_str () );\r
 \r
        fprintf ( fMakefile,\r
-                 "%s.stubs.c: %s\n",\r
-                 basename.c_str (),\r
+                 "%s: %s\n",\r
+                 stub_file.c_str (),\r
                  sourceFilename.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [WINEBLD] $@\n" );\r
        fprintf ( fMakefile,\r
-                 "\t%s --pedll=%s -o %s.stubs.c\n",\r
+                 "\t%s --pedll=%s -o %s\n",\r
                  "${winebuild}",\r
                  sourceFilename.c_str (),\r
-                 basename.c_str () );\r
+                 stub_file.c_str () );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateCommands ( const Module& module,\r
-                                       const string& sourceFilename,\r
-                                       const string& cc,\r
-                                       const string& cppc,\r
-                                       const string& cflagsMacro,\r
-                                       const string& nasmflagsMacro,\r
-                                       const string& windresflagsMacro ) const\r
+MingwModuleHandler::GenerateCommands (\r
+       const Module& module,\r
+       const string& sourceFilename,\r
+       const string& cc,\r
+       const string& cppc,\r
+       const string& cflagsMacro,\r
+       const string& nasmflagsMacro,\r
+       const string& windresflagsMacro,\r
+       string_list& clean_files ) const\r
 {\r
+       CLEAN_FILE ( GetObjectFilename(sourceFilename) );\r
        string extension = GetExtension ( sourceFilename );\r
        if ( extension == ".c" || extension == ".C" )\r
        {\r
@@ -782,7 +889,8 @@ MingwModuleHandler::GenerateCommands ( const Module& module,
        else if ( extension == ".spec" || extension == ".SPEC" )\r
        {\r
                GenerateWinebuildCommands ( module,\r
-                                           sourceFilename );\r
+                                           sourceFilename,\r
+                                           clean_files );\r
                GenerateGccCommand ( module,\r
                                     GetActualSourceFilename ( sourceFilename ),\r
                                     cc,\r
@@ -798,20 +906,27 @@ MingwModuleHandler::GenerateCommands ( const Module& module,
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateLinkerCommand ( const Module& module,\r
-                                            const string& linker,\r
-                                            const string& linkerParameters,\r
-                                            const string& objectFilenames ) const\r
+MingwModuleHandler::GenerateLinkerCommand (\r
+       const Module& module,\r
+       const string& linker,\r
+       const string& linkerParameters,\r
+       const string& objectsMacro,\r
+       const string& libsMacro,\r
+       string_list& clean_files ) const\r
 {\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [LD]      $@\n" );\r
        string targetName ( module.GetTargetName () );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
        if ( module.importLibrary != NULL )\r
        {\r
                static string ros_junk ( "$(ROS_TEMPORARY)" );\r
                string base_tmp = ros_junk + module.name + ".base.tmp";\r
+               CLEAN_FILE ( base_tmp );\r
                string junk_tmp = ros_junk + module.name + ".junk.tmp";\r
+               CLEAN_FILE ( junk_tmp );\r
                string temp_exp = ros_junk + module.name + ".temp.exp";\r
+               CLEAN_FILE ( temp_exp );\r
+               string def_file = module.GetBasePath () + SSEP + module.importLibrary->definition;\r
 \r
                fprintf ( fMakefile,\r
                          "\t%s %s -Wl,--base-file,%s -o %s %s %s %s\n",\r
@@ -819,12 +934,12 @@ MingwModuleHandler::GenerateLinkerCommand ( const Module& module,
                          linkerParameters.c_str (),\r
                          base_tmp.c_str (),\r
                          junk_tmp.c_str (),\r
-                         objectFilenames.c_str (),\r
-                         importLibraryDependencies.c_str (),\r
+                         objectsMacro.c_str (),\r
+                         libsMacro.c_str (),\r
                          GetLinkerMacro ( module ).c_str () );\r
 \r
                fprintf ( fMakefile,\r
-                         "\t${rm} %s\n",\r
+                         "\t-@${rm} %s\n",\r
                          junk_tmp.c_str () );\r
 \r
                string killAt = module.mangledSymbols ? "" : "--kill-at";\r
@@ -832,26 +947,26 @@ MingwModuleHandler::GenerateLinkerCommand ( const Module& module,
                          "\t${dlltool} --dllname %s --base-file %s --def %s --output-exp %s %s\n",\r
                          targetName.c_str (),\r
                          base_tmp.c_str (),\r
-                         ( module.GetBasePath () + SSEP + module.importLibrary->definition ).c_str (),\r
+                         def_file.c_str (),\r
                          temp_exp.c_str (),\r
                          killAt.c_str () );\r
 \r
                fprintf ( fMakefile,\r
-                         "\t${rm} %s\n",\r
+                         "\t-@${rm} %s\n",\r
                          base_tmp.c_str () );\r
 \r
                fprintf ( fMakefile,\r
-                         "\t%s %s %s -o %s %s %s %s\n\n",\r
+                         "\t%s %s %s -o %s %s %s %s\n",\r
                          linker.c_str (),\r
                          linkerParameters.c_str (),\r
                          temp_exp.c_str (),\r
                          target.c_str (),\r
-                         objectFilenames.c_str (),\r
-                         importLibraryDependencies.c_str (),\r
+                         objectsMacro.c_str (),\r
+                         libsMacro.c_str (),\r
                          GetLinkerMacro ( module ).c_str () );\r
 \r
                fprintf ( fMakefile,\r
-                         "\t${rm} %s\n\n",\r
+                         "\t-@${rm} %s\n",\r
                          temp_exp.c_str () );\r
        }\r
        else\r
@@ -861,26 +976,29 @@ MingwModuleHandler::GenerateLinkerCommand ( const Module& module,
                          linker.c_str (),\r
                          linkerParameters.c_str (),\r
                          target.c_str (),\r
-                         objectFilenames.c_str (),\r
-                         importLibraryDependencies.c_str (),\r
+                         objectsMacro.c_str (),\r
+                         libsMacro.c_str (),\r
                          GetLinkerMacro ( module ).c_str () );\r
        }\r
 \r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [RSYM]    $@\n" );\r
        fprintf ( fMakefile,\r
-                     "\t${rsym} %s %s\n\n",\r
-                     target.c_str (),\r
-                     target.c_str () );\r
+                 "\t${rsym} %s %s\n\n",\r
+                 target.c_str (),\r
+                 target.c_str () );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,\r
-                                                const vector<File*>& files,\r
-                                                const vector<If*>& ifs,\r
-                                                const string& cc,\r
-                                                const string& cppc,\r
-                                                const string& cflagsMacro,\r
-                                                const string& nasmflagsMacro,\r
-                                                const string& windresflagsMacro ) const\r
+MingwModuleHandler::GenerateObjectFileTargets (\r
+       const Module& module,\r
+       const vector<File*>& files,\r
+       const vector<If*>& ifs,\r
+       const string& cc,\r
+       const string& cppc,\r
+       const string& cflagsMacro,\r
+       const string& nasmflagsMacro,\r
+       const string& windresflagsMacro,\r
+       string_list& clean_files ) const\r
 {\r
        size_t i;\r
 \r
@@ -893,7 +1011,8 @@ MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
                                   cppc,\r
                                   cflagsMacro,\r
                                   nasmflagsMacro,\r
-                                  windresflagsMacro );\r
+                                  windresflagsMacro,\r
+                                  clean_files );\r
                fprintf ( fMakefile,\r
                          "\n" );\r
        }\r
@@ -907,17 +1026,20 @@ MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
                                            cppc,\r
                                            cflagsMacro,\r
                                            nasmflagsMacro,\r
-                                           windresflagsMacro );\r
+                                           windresflagsMacro,\r
+                                           clean_files );\r
        }\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,\r
-                                                const string& cc,\r
-                                                const string& cppc,\r
-                                                const string& cflagsMacro,\r
-                                                const string& nasmflagsMacro,\r
-                                                const string& windresflagsMacro ) const\r
+MingwModuleHandler::GenerateObjectFileTargets (\r
+       const Module& module,\r
+       const string& cc,\r
+       const string& cppc,\r
+       const string& cflagsMacro,\r
+       const string& nasmflagsMacro,\r
+       const string& windresflagsMacro,\r
+       string_list& clean_files ) const\r
 {\r
        GenerateObjectFileTargets ( module,\r
                                    module.files,\r
@@ -926,12 +1048,13 @@ MingwModuleHandler::GenerateObjectFileTargets ( const Module& module,
                                    cppc,\r
                                    cflagsMacro,\r
                                    nasmflagsMacro,\r
-                                   windresflagsMacro );\r
+                                   windresflagsMacro,\r
+                                   clean_files );\r
        fprintf ( fMakefile, "\n" );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GetCleanTargets ( vector<string>& out,\r
+MingwModuleHandler::GetCleanTargets ( string_list& out,\r
                                       const vector<File*>& files,\r
                                       const vector<If*>& ifs ) const\r
 {\r
@@ -956,6 +1079,8 @@ MingwModuleHandler::GenerateArchiveTarget ( const Module& module,
                  archiveFilename.c_str (),\r
                  objs_macro.c_str ());\r
 \r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [AR]      $@\n" );\r
+\r
        fprintf ( fMakefile,\r
                  "\t%s -rc %s %s\n\n",\r
                  ar.c_str (),\r
@@ -979,13 +1104,25 @@ MingwModuleHandler::GetObjectsMacro ( const Module& module ) const
                          module.name.c_str () );\r
 }\r
 \r
+string\r
+MingwModuleHandler::GetLinkingDependenciesMacro ( const Module& module ) const\r
+{\r
+       return ssprintf ( "$(%s_LINKDEPS)", module.name.c_str () );\r
+}\r
+\r
+string\r
+MingwModuleHandler::GetLibsMacro ( const Module& module ) const\r
+{\r
+       return ssprintf ( "$(%s_LIBS)", module.name.c_str () );\r
+}\r
+\r
 string\r
 MingwModuleHandler::GetLinkerMacro ( const Module& module ) const\r
 {\r
        return ssprintf ( "$(%s_LFLAGS)",\r
                          module.name.c_str () );\r
 }\r
-                                           \r
+\r
 void\r
 MingwModuleHandler::GenerateMacrosAndTargets (\r
        const Module& module,\r
@@ -993,20 +1130,25 @@ MingwModuleHandler::GenerateMacrosAndTargets (
        const string& cppc,\r
        const string& ar,\r
        const string* cflags,\r
-       const string* nasmflags ) const\r
+       const string* nasmflags,\r
+       string_list& clean_files ) const\r
 {\r
        string cflagsMacro = ssprintf ("%s_CFLAGS", module.name.c_str ());\r
        string nasmflagsMacro = ssprintf ("%s_NASMFLAGS", module.name.c_str ());\r
        string windresflagsMacro = ssprintf ("%s_RCFLAGS", module.name.c_str ());\r
        string linkerFlagsMacro = ssprintf ("%s_LFLAGS", module.name.c_str ());\r
        string objectsMacro = ssprintf ("%s_OBJS", module.name.c_str ());\r
+       string libsMacro = ssprintf("%s_LIBS", module.name.c_str ());\r
+       string linkDepsMacro = ssprintf ("%s_LINKDEPS", module.name.c_str ());\r
 \r
        GenerateMacros ( module,\r
                        cflagsMacro,\r
                        nasmflagsMacro,\r
                        windresflagsMacro,\r
                        linkerFlagsMacro,\r
-                       objectsMacro );\r
+                       objectsMacro,\r
+                       libsMacro,\r
+                       linkDepsMacro );\r
 \r
        if ( cflags != NULL )\r
        {\r
@@ -1042,55 +1184,59 @@ MingwModuleHandler::GenerateMacrosAndTargets (
                                    cppc,\r
                                    cflagsMacro,\r
                                    nasmflagsMacro,\r
-                                   windresflagsMacro );\r
+                                   windresflagsMacro,\r
+                                   clean_files );\r
 \r
-       vector<string> clean_files;\r
-       clean_files.push_back ( FixupTargetFilename(module.GetPath()) );\r
-       clean_files.push_back ( ar_target );\r
-       GetCleanTargets ( clean_files, module.files, module.ifs );\r
-\r
-       fprintf ( fMakefile, ".PHONY: %s_clean\n", module.name.c_str() );\r
-       fprintf ( fMakefile, "%s_clean:\n\t-@$(rm)", module.name.c_str() );\r
-       for ( size_t i = 0; i < clean_files.size(); i++ )\r
+       CLEAN_FILE ( ar_target );\r
+       string tgt = FixupTargetFilename(module.GetPath());\r
+       if ( tgt != ar_target )\r
        {\r
-               if ( 9==(i%10) )\r
-                       fprintf ( fMakefile, " 2>$(NUL)\n\t-@$(rm)" );\r
-               fprintf ( fMakefile, " %s", clean_files[i].c_str() );\r
+               CLEAN_FILE ( tgt );\r
        }\r
-       fprintf ( fMakefile, " 2>$(NUL)\n" );\r
-       fprintf ( fMakefile, "clean: %s_clean\n\n", module.name.c_str() );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateMacrosAndTargetsHost ( const Module& module ) const\r
+MingwModuleHandler::GenerateMacrosAndTargetsHost (\r
+       const Module& module,\r
+       string_list& clean_files ) const\r
 {\r
-       GenerateMacrosAndTargets ( module,\r
-                                  "${host_gcc}",\r
-                                  "${host_gpp}",\r
-                                  "${host_ar}",\r
-                                  NULL,\r
-                                  NULL );\r
+       GenerateMacrosAndTargets (\r
+               module,\r
+               "${host_gcc}",\r
+               "${host_gpp}",\r
+               "${host_ar}",\r
+               NULL,\r
+               NULL,\r
+               clean_files );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateMacrosAndTargetsTarget ( const Module& module ) const\r
+MingwModuleHandler::GenerateMacrosAndTargetsTarget (\r
+       const Module& module,\r
+       string_list& clean_files ) const\r
 {\r
-       GenerateMacrosAndTargetsTarget ( module,\r
-                                        NULL,\r
-                                        NULL );\r
+       GenerateMacrosAndTargetsTarget (\r
+               module,\r
+               NULL,\r
+               NULL,\r
+               clean_files );\r
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateMacrosAndTargetsTarget ( const Module& module,\r
-                                                        const string* cflags,\r
-                                                        const string* nasmflags ) const\r
+MingwModuleHandler::GenerateMacrosAndTargetsTarget (\r
+       const Module& module,\r
+       const string* cflags,\r
+       const string* nasmflags,\r
+       string_list& clean_files ) const\r
 {\r
-       GenerateMacrosAndTargets ( module,\r
-                                 "${gcc}",\r
-                                 "${gpp}",\r
-                                 "${ar}",\r
-                                 cflags,\r
-                                 nasmflags );\r
+       GenerateMacrosAndTargets (\r
+               module,\r
+               "${gcc}",\r
+               "${gpp}",\r
+               "${ar}",\r
+               cflags,\r
+               nasmflags,\r
+               clean_files );\r
 }\r
 \r
 string\r
@@ -1138,6 +1284,7 @@ MingwModuleHandler::GenerateInvocations ( const Module& module ) const
                          "%s: %s\n",\r
                          invoke.GetTargets ().c_str (),\r
                          FixupTargetFilename ( invoke.invokeModule->GetPath () ).c_str () );\r
+               fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [INVOKE]  $<\n" );\r
                fprintf ( fMakefile,\r
                          "\t%s %s\n\n",\r
                          FixupTargetFilename ( invoke.invokeModule->GetPath () ).c_str (),\r
@@ -1218,21 +1365,28 @@ MingwModuleHandler::GeneratePreconditionDependencies ( const Module& module ) co
 }\r
 \r
 void\r
-MingwModuleHandler::GenerateImportLibraryTargetIfNeeded ( const Module& module ) const\r
+MingwModuleHandler::GenerateImportLibraryTargetIfNeeded (\r
+       const Module& module,\r
+       string_list& clean_files ) const\r
 {\r
        if ( module.importLibrary != NULL )\r
        {\r
+               string library_target = FixupTargetFilename( module.GetDependencyPath () ).c_str ();\r
+               CLEAN_FILE ( library_target );\r
+\r
                string definitionDependencies = GetDefinitionDependencies ( module );\r
                fprintf ( fMakefile, "%s: %s\n",\r
-                         FixupTargetFilename( module.GetDependencyPath () ).c_str (),\r
+                         library_target.c_str (),\r
                          definitionDependencies.c_str () );\r
 \r
+               fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [DLLTOOL] $@\n" );\r
+\r
                string killAt = module.mangledSymbols ? "" : "--kill-at";\r
                fprintf ( fMakefile,\r
                          "\t${dlltool} --dllname %s --def %s --output-lib %s %s\n\n",\r
                          module.GetTargetName ().c_str (),\r
                          ( module.GetBasePath () + SSEP + module.importLibrary->definition ).c_str (),\r
-                         FixupTargetFilename ( module.GetDependencyPath () ).c_str (),\r
+                         library_target.c_str (),\r
                          killAt.c_str () );\r
        }\r
 }\r
@@ -1265,7 +1419,7 @@ MingwModuleHandler::GetDefinitionDependencies ( const Module& module ) const
        return dependencies;\r
 }\r
 \r
-string\r
+/*string\r
 MingwModuleHandler::GetLinkingDependencies ( const Module& module ) const\r
 {\r
        string dependencies = GetImportLibraryDependencies ( module );\r
@@ -1276,7 +1430,7 @@ MingwModuleHandler::GetLinkingDependencies ( const Module& module ) const
                dependencies += s;\r
        }\r
        return dependencies;\r
-}\r
+}*/\r
 \r
 bool\r
 MingwModuleHandler::IsCPlusPlusModule ( const Module& module ) const\r
@@ -1299,21 +1453,22 @@ MingwBuildToolModuleHandler::MingwBuildToolModuleHandler()
 }\r
 \r
 void\r
-MingwBuildToolModuleHandler::Process ( const Module& module )\r
+MingwBuildToolModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateBuildToolModuleTarget ( module );\r
+       GenerateBuildToolModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& module )\r
+MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
 \r
-       GenerateMacrosAndTargetsHost ( module );\r
+       GenerateMacrosAndTargetsHost ( module, clean_files );\r
 \r
        string linker;\r
        if ( IsCPlusPlusModule ( module ) )\r
@@ -1324,14 +1479,15 @@ MingwBuildToolModuleHandler::GenerateBuildToolModuleTarget ( const Module& modul
        fprintf ( fMakefile, "%s: %s %s\n",\r
                  target.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 linkDepsMacro.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [LD]      $@\n" );\r
        fprintf ( fMakefile,\r
                  "\t%s %s -o %s %s %s\n\n",\r
                  linker.c_str (),\r
                  GetLinkerMacro ( module ).c_str (),\r
                  target.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 libsMacro.c_str () );\r
 }\r
 \r
 \r
@@ -1343,38 +1499,43 @@ MingwKernelModuleHandler::MingwKernelModuleHandler ()
 }\r
 \r
 void\r
-MingwKernelModuleHandler::Process ( const Module& module )\r
+MingwKernelModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateKernelModuleTarget ( module );\r
+       GenerateKernelModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )\r
+MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
-       string targetName ( module.GetTargetName () );\r
-       string target ( FixupTargetFilename (module.GetPath ()) );\r
+       string targetName ( module.GetTargetName () ); // i.e. "ntoskrnl.exe"\r
+       string target ( FixupTargetFilename (module.GetPath ()) ); // i.e. "$(ROS_INT).\ntoskrnl\ntoskrnl.exe"\r
        string workingDirectory = GetWorkingDirectory ();\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
        string base_tmp = ros_junk + module.name + ".base.tmp";\r
+       CLEAN_FILE ( base_tmp );\r
        string junk_tmp = ros_junk + module.name + ".junk.tmp";\r
+       CLEAN_FILE ( junk_tmp );\r
        string temp_exp = ros_junk + module.name + ".temp.exp";\r
+       CLEAN_FILE ( temp_exp );\r
        string gccOptions = ssprintf ("-Wl,-T,%s" SSEP "ntoskrnl.lnk -Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",\r
                                      module.GetBasePath ().c_str (),\r
                                      module.entrypoint.c_str (),\r
                                      module.baseaddress.c_str () );\r
 \r
-       GenerateMacrosAndTargetsTarget ( module );\r
+       GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        fprintf ( fMakefile, "%s: %s %s\n",\r
                  target.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 linkDepsMacro.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [LD]      $@\n" );\r
        fprintf ( fMakefile,\r
                  "\t${gcc} %s %s -Wl,--base-file,%s -o %s %s %s\n",\r
                  GetLinkerMacro ( module ).c_str (),\r
@@ -1382,9 +1543,9 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
                  base_tmp.c_str (),\r
                  junk_tmp.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 linkDepsMacro.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s\n",\r
+                 "\t-@${rm} %s\n",\r
                  junk_tmp.c_str () );\r
        string killAt = module.mangledSymbols ? "" : "--kill-at";\r
        fprintf ( fMakefile,\r
@@ -1394,7 +1555,7 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
                  temp_exp.c_str (),\r
                  killAt.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s\n",\r
+                 "\t-@${rm} %s\n",\r
                  base_tmp.c_str () );\r
        fprintf ( fMakefile,\r
                  "\t${gcc} %s %s -Wl,%s -o %s %s %s\n",\r
@@ -1403,10 +1564,11 @@ MingwKernelModuleHandler::GenerateKernelModuleTarget ( const Module& module )
                  temp_exp.c_str (),\r
                  target.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 linkDepsMacro.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s\n",\r
+                 "\t-@${rm} %s\n",\r
                  temp_exp.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [RSYM]    $@\n" );\r
        fprintf ( fMakefile,\r
                      "\t${rsym} %s %s\n\n",\r
                      target.c_str (),\r
@@ -1422,17 +1584,17 @@ MingwStaticLibraryModuleHandler::MingwStaticLibraryModuleHandler ()
 }\r
 \r
 void\r
-MingwStaticLibraryModuleHandler::Process ( const Module& module )\r
+MingwStaticLibraryModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateStaticLibraryModuleTarget ( module );\r
+       GenerateStaticLibraryModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ( const Module& module )\r
+MingwStaticLibraryModuleHandler::GenerateStaticLibraryModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
-       GenerateMacrosAndTargetsTarget ( module );\r
+       GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 }\r
 \r
 \r
@@ -1444,17 +1606,17 @@ MingwObjectLibraryModuleHandler::MingwObjectLibraryModuleHandler ()
 }\r
 \r
 void\r
-MingwObjectLibraryModuleHandler::Process ( const Module& module )\r
+MingwObjectLibraryModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateObjectLibraryModuleTarget ( module );\r
+       GenerateObjectLibraryModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwObjectLibraryModuleHandler::GenerateObjectLibraryModuleTarget ( const Module& module )\r
+MingwObjectLibraryModuleHandler::GenerateObjectLibraryModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
-       GenerateMacrosAndTargetsTarget ( module );\r
+       GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 }\r
 \r
 \r
@@ -1466,32 +1628,33 @@ MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler ()
 }\r
 \r
 void\r
-MingwKernelModeDLLModuleHandler::Process ( const Module& module )\r
+MingwKernelModeDLLModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateKernelModeDLLModuleTarget ( module );\r
+       GenerateKernelModeDLLModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Module& module )\r
+MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
 \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        if ( module.files.size () > 0 )\r
        {\r
-               GenerateMacrosAndTargetsTarget ( module );\r
+               GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 \r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         importLibraryDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",\r
                                                     module.entrypoint.c_str (),\r
@@ -1499,7 +1662,9 @@ MingwKernelModeDLLModuleHandler::GenerateKernelModeDLLModuleTarget ( const Modul
                GenerateLinkerCommand ( module,\r
                                        "${gcc}",\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1519,37 +1684,40 @@ MingwKernelModeDriverModuleHandler::MingwKernelModeDriverModuleHandler ()
 }\r
 \r
 void\r
-MingwKernelModeDriverModuleHandler::Process ( const Module& module )\r
+MingwKernelModeDriverModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateKernelModeDriverModuleTarget ( module );\r
+       GenerateKernelModeDriverModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 \r
 void\r
-MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ( const Module& module )\r
+MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget (\r
+       const Module& module,\r
+       string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( PassThruCacheDirectory( FixupTargetFilename ( module.GetPath () ) ) );\r
        string workingDirectory = GetWorkingDirectory ();\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
 \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        if ( module.files.size () > 0 )\r
        {\r
-               string* cflags = new string ( "-D__NTDRIVER__" );\r
+               string cflags ( "-D__NTDRIVER__" );\r
                GenerateMacrosAndTargetsTarget ( module,\r
-                                                cflags,\r
-                                                NULL );\r
-               delete cflags;\r
+                                                &cflags,\r
+                                                NULL,\r
+                                                clean_files);\r
 \r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         importLibraryDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -mdll",\r
                                                     module.entrypoint.c_str (),\r
@@ -1557,7 +1725,9 @@ MingwKernelModeDriverModuleHandler::GenerateKernelModeDriverModuleTarget ( const
                GenerateLinkerCommand ( module,\r
                                        "${gcc}",\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1577,32 +1747,33 @@ MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler ()
 }\r
 \r
 void\r
-MingwNativeDLLModuleHandler::Process ( const Module& module )\r
+MingwNativeDLLModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateNativeDLLModuleTarget ( module );\r
+       GenerateNativeDLLModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& module )\r
+MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
        \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        if ( module.files.size () > 0 )\r
        {\r
-               GenerateMacrosAndTargetsTarget ( module );\r
+               GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 \r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         importLibraryDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib -mdll",\r
                                                     module.entrypoint.c_str (),\r
@@ -1610,7 +1781,9 @@ MingwNativeDLLModuleHandler::GenerateNativeDLLModuleTarget ( const Module& modul
                GenerateLinkerCommand ( module,\r
                                        "${gcc}",\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1630,36 +1803,37 @@ MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler ()
 }\r
 \r
 void\r
-MingwNativeCUIModuleHandler::Process ( const Module& module )\r
+MingwNativeCUIModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateNativeCUIModuleTarget ( module );\r
+       GenerateNativeCUIModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ( const Module& module )\r
+MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
        \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        if ( module.files.size () > 0 )\r
        {\r
-               string* cflags = new string ( "-D__NTAPP__" );\r
+               string cflags ( "-D__NTAPP__" );\r
                GenerateMacrosAndTargetsTarget ( module,\r
-                                                cflags,\r
-                                                NULL );\r
-               delete cflags;\r
+                                                &cflags,\r
+                                                NULL,\r
+                                                clean_files );\r
 \r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         importLibraryDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linkerParameters = ssprintf ( "-Wl,--subsystem,native -Wl,--entry,%s -Wl,--image-base,%s -Wl,--file-alignment,0x1000 -Wl,--section-alignment,0x1000 -nostartfiles -nostdlib",\r
                                                     module.entrypoint.c_str (),\r
@@ -1667,7 +1841,9 @@ MingwNativeCUIModuleHandler::GenerateNativeCUIModuleTarget ( const Module& modul
                GenerateLinkerCommand ( module,\r
                                        "${gcc}",\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1687,16 +1863,16 @@ MingwWin32DLLModuleHandler::MingwWin32DLLModuleHandler ()
 }\r
 \r
 void\r
-MingwWin32DLLModuleHandler::Process ( const Module& module )\r
+MingwWin32DLLModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
-       GenerateExtractWineDLLResourcesTarget ( module );\r
+       GenerateExtractWineDLLResourcesTarget ( module, clean_files );\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateWin32DLLModuleTarget ( module );\r
+       GenerateWin32DLLModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ( const Module& module )\r
+MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ( const Module& module, string_list& clean_files )\r
 {\r
        fprintf ( fMakefile, ".PHONY: %s_extractresources\n\n",\r
                  module.name.c_str () );\r
@@ -1709,7 +1885,8 @@ MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ( const Module
                if ( extension == ".rc" || extension == ".RC" )\r
                {\r
                        string resource = FixupTargetFilename ( file.name );\r
-                       fprintf ( fMakefile, "\t@echo ${bin2res} -f -x %s\n",\r
+                       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [BIN2RES] $<\n" );\r
+                       fprintf ( fMakefile, "\t@:echo ${bin2res} -f -x %s\n",\r
                                  resource.c_str () );\r
                }\r
        }\r
@@ -1717,23 +1894,25 @@ MingwWin32DLLModuleHandler::GenerateExtractWineDLLResourcesTarget ( const Module
 }\r
 \r
 void\r
-MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module )\r
+MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string linkingDependencies = GetLinkingDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
+\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
        if ( module.files.size () > 0 )\r
        {\r
-               GenerateMacrosAndTargetsTarget ( module );\r
-       \r
+               GenerateMacrosAndTargetsTarget ( module, clean_files );\r
+\r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         linkingDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linker;\r
                if ( IsCPlusPlusModule ( module ) )\r
@@ -1747,7 +1926,9 @@ MingwWin32DLLModuleHandler::GenerateWin32DLLModuleTarget ( const Module& module
                GenerateLinkerCommand ( module,\r
                                        linker,\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1767,32 +1948,33 @@ MingwWin32CUIModuleHandler::MingwWin32CUIModuleHandler ()
 }\r
 \r
 void\r
-MingwWin32CUIModuleHandler::Process ( const Module& module )\r
+MingwWin32CUIModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateWin32CUIModuleTarget ( module );\r
+       GenerateWin32CUIModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ( const Module& module )\r
+MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
 \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        if ( module.files.size () > 0 )\r
        {\r
-               GenerateMacrosAndTargetsTarget ( module );\r
+               GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 \r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         importLibraryDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linker;\r
                if ( IsCPlusPlusModule ( module ) )\r
@@ -1806,7 +1988,9 @@ MingwWin32CUIModuleHandler::GenerateWin32CUIModuleTarget ( const Module& module
                GenerateLinkerCommand ( module,\r
                                        linker,\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1826,32 +2010,33 @@ MingwWin32GUIModuleHandler::MingwWin32GUIModuleHandler ()
 }\r
 \r
 void\r
-MingwWin32GUIModuleHandler::Process ( const Module& module )\r
+MingwWin32GUIModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateWin32GUIModuleTarget ( module );\r
+       GenerateWin32GUIModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ( const Module& module )\r
+MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ( );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
 \r
-       GenerateImportLibraryTargetIfNeeded ( module );\r
+       GenerateImportLibraryTargetIfNeeded ( module, clean_files );\r
 \r
        if ( module.files.size () > 0 )\r
        {\r
-               GenerateMacrosAndTargetsTarget ( module );\r
+               GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 \r
                fprintf ( fMakefile, "%s: %s %s\n",\r
                          target.c_str (),\r
                          objectsMacro.c_str (),\r
-                         importLibraryDependencies.c_str () );\r
+                         linkDepsMacro.c_str () );\r
 \r
                string linker;\r
                if ( IsCPlusPlusModule ( module ) )\r
@@ -1865,7 +2050,9 @@ MingwWin32GUIModuleHandler::GenerateWin32GUIModuleTarget ( const Module& module
                GenerateLinkerCommand ( module,\r
                                        linker,\r
                                        linkerParameters,\r
-                                       objectsMacro );\r
+                                       objectsMacro,\r
+                                       libsMacro,\r
+                                       clean_files );\r
        }\r
        else\r
        {\r
@@ -1885,43 +2072,49 @@ MingwBootLoaderModuleHandler::MingwBootLoaderModuleHandler ()
 }\r
 \r
 void\r
-MingwBootLoaderModuleHandler::Process ( const Module& module )\r
+MingwBootLoaderModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateBootLoaderModuleTarget ( module );\r
+       GenerateBootLoaderModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget ( const Module& module )\r
+MingwBootLoaderModuleHandler::GenerateBootLoaderModuleTarget (\r
+       const Module& module,\r
+       string_list& clean_files )\r
 {\r
        static string ros_junk ( "$(ROS_TEMPORARY)" );\r
        string targetName ( module.GetTargetName () );\r
        string target ( FixupTargetFilename ( module.GetPath () ) );\r
        string workingDirectory = GetWorkingDirectory ();\r
        string junk_tmp = ros_junk + module.name + ".junk.tmp";\r
+       CLEAN_FILE ( junk_tmp );\r
        string objectsMacro = GetObjectsMacro ( module );\r
-       string importLibraryDependencies = GetImportLibraryDependencies ( module );\r
+       string linkDepsMacro = GetLinkingDependenciesMacro ( module );\r
+       string libsMacro = GetLibsMacro ( module );\r
 \r
-       GenerateMacrosAndTargetsTarget ( module );\r
+       GenerateMacrosAndTargetsTarget ( module, clean_files );\r
 \r
        fprintf ( fMakefile, "%s: %s %s\n",\r
                  target.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 linkDepsMacro.c_str () );\r
+\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [LD]      $@\n" );\r
 \r
        fprintf ( fMakefile,\r
                  "\t${ld} %s -N -Ttext=0x8000 -o %s %s %s\n",\r
                  GetLinkerMacro ( module ).c_str (),\r
                  junk_tmp.c_str (),\r
                  objectsMacro.c_str (),\r
-                 importLibraryDependencies.c_str () );\r
+                 linkDepsMacro.c_str () );\r
        fprintf ( fMakefile,\r
                  "\t${objcopy} -O binary %s %s\n",\r
                  junk_tmp.c_str (),\r
                  target.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t${rm} %s\n",\r
+                 "\t-@${rm} %s\n",\r
                  junk_tmp.c_str () );\r
 }\r
 \r
@@ -1934,22 +2127,23 @@ MingwBootSectorModuleHandler::MingwBootSectorModuleHandler ()
 }\r
 \r
 void\r
-MingwBootSectorModuleHandler::Process ( const Module& module )\r
+MingwBootSectorModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateBootSectorModuleTarget ( module );\r
+       GenerateBootSectorModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
 void\r
-MingwBootSectorModuleHandler::GenerateBootSectorModuleTarget ( const Module& module )\r
+MingwBootSectorModuleHandler::GenerateBootSectorModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        string objectsMacro = GetObjectsMacro ( module );\r
 \r
        string* nasmflags = new string ( "-f bin" );\r
        GenerateMacrosAndTargetsTarget ( module,\r
                                         NULL,\r
-                                        nasmflags);\r
+                                        nasmflags,\r
+                                        clean_files );\r
 \r
        fprintf ( fMakefile, ".PHONY: %s\n\n",\r
                      module.name.c_str ());\r
@@ -1968,10 +2162,10 @@ MingwIsoModuleHandler::MingwIsoModuleHandler ()
 }\r
 \r
 void\r
-MingwIsoModuleHandler::Process ( const Module& module )\r
+MingwIsoModuleHandler::Process ( const Module& module, string_list& clean_files )\r
 {\r
        GeneratePreconditionDependencies ( module );\r
-       GenerateIsoModuleTarget ( module );\r
+       GenerateIsoModuleTarget ( module, clean_files );\r
        GenerateInvocations ( module );\r
 }\r
 \r
@@ -2101,7 +2295,7 @@ MingwIsoModuleHandler::GetCdFiles ( const string bootcdDirectory,
 }\r
 \r
 void\r
-MingwIsoModuleHandler::GenerateIsoModuleTarget ( const Module& module )\r
+MingwIsoModuleHandler::GenerateIsoModuleTarget ( const Module& module, string_list& clean_files )\r
 {\r
        string bootcdDirectory = "cd";\r
        string isoboot = FixupTargetFilename ( "boot/freeldr/bootsect/isoboot.o" );\r
@@ -2123,6 +2317,7 @@ MingwIsoModuleHandler::GenerateIsoModuleTarget ( const Module& module )
                  isoboot.c_str (),\r
                  cdDirectories.c_str (),\r
                  cdFiles.c_str () );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [CABMAN]  $<\n" );\r
        fprintf ( fMakefile,\r
                  "\t${cabman} -C %s -L %s -I\n",\r
                  reactosDff.c_str (),\r
@@ -2133,12 +2328,13 @@ MingwIsoModuleHandler::GenerateIsoModuleTarget ( const Module& module )
                  reactosInf.c_str (),\r
                  bootcdReactos.c_str () );\r
        fprintf ( fMakefile,\r
-                 "\t- ${rm} %s\n",\r
+                 "\t-@${rm} %s\n",\r
                  reactosInf.c_str () );\r
        OutputBootstrapfileCopyCommands ( bootcdDirectory,\r
                                          module );\r
        OutputCdfileCopyCommands ( bootcdDirectory,\r
                                   module );\r
+       fprintf ( fMakefile, "\t$(HALFVERBOSEECHO) [CDMAKE]  $@\n" );\r
        fprintf ( fMakefile,\r
                  "\t${cdmake} -v -m -b %s %s REACTOS ReactOS.iso\n",\r
                  isoboot.c_str (),\r
index c1eb8e5..3bdb2e9 100644 (file)
@@ -11,6 +11,8 @@ ReplaceExtension ( const std::string& filename,
 class MingwModuleHandler\r
 {\r
 public:\r
+       typedef std::vector<std::string> string_list;\r
+\r
        static std::map<ModuleType,MingwModuleHandler*>* handler_map;\r
        static int ref;\r
 \r
@@ -20,10 +22,12 @@ public:
        static void SetMakefile ( FILE* f );\r
        static MingwModuleHandler* LookupHandler ( const std::string& location,\r
                                                   ModuleType moduletype_ );\r
-       virtual void Process ( const Module& module ) = 0;\r
+       virtual void Process ( const Module& module, string_list& clean_files ) = 0;\r
        bool IncludeDirectoryTarget ( const std::string& directory ) const;\r
        void GenerateDirectoryTargets () const;\r
        static std::string GetObjectFilename ( const std::string& sourceFilename );\r
+       void GenerateCleanTarget ( const Module& module,\r
+                                  const string_list& clean_files ) const;\r
 protected:\r
        const std::string &PassThruCacheDirectory ( const std::string &f ) const;\r
        std::string GetWorkingDirectory () const;\r
@@ -32,7 +36,6 @@ protected:
        std::string GetModuleArchiveFilename ( const Module& module ) const;\r
        bool IsGeneratedFile ( const File& file ) const;\r
        std::string GetImportLibraryDependency ( const Module& importedModule ) const;\r
-       std::string GetImportLibraryDependencies ( const Module& module ) const;\r
        std::string GetModuleDependencies ( const Module& module ) const;\r
        std::string GetAllDependencies ( const Module& module ) const;\r
        std::string GetSourceFilenames ( const Module& module,\r
@@ -41,11 +44,14 @@ protected:
        std::string GetSourceFilenamesWithoutGeneratedFiles ( const Module& module ) const;\r
 \r
        std::string GetObjectFilenames ( const Module& module ) const;\r
-       void GenerateMacrosAndTargetsHost ( const Module& module ) const;\r
-       void GenerateMacrosAndTargetsTarget ( const Module& module ) const;\r
+       void GenerateMacrosAndTargetsHost ( const Module& module,\r
+                                           string_list& clean_files ) const;\r
+       void GenerateMacrosAndTargetsTarget ( const Module& module,\r
+                                             string_list& clean_files ) const;\r
        void GenerateMacrosAndTargetsTarget ( const Module& module,\r
                                              const std::string* cflags,\r
-                                             const std::string* nasmflags ) const;\r
+                                             const std::string* nasmflags,\r
+                                             string_list& clean_files ) const;\r
        std::string GetInvocationDependencies ( const Module& module ) const;\r
        void GenerateInvocations ( const Module& module ) const;\r
        \r
@@ -53,12 +59,16 @@ protected:
        void GeneratePreconditionDependencies ( const Module& module ) const;\r
        std::string GetCFlagsMacro ( const Module& module ) const;\r
        std::string GetObjectsMacro ( const Module& module ) const;\r
+       std::string GetLinkingDependenciesMacro ( const Module& module ) const;\r
+       std::string GetLibsMacro ( const Module& module ) const;\r
        std::string GetLinkerMacro ( const Module& module ) const;\r
        void GenerateLinkerCommand ( const Module& module,\r
                                     const std::string& linker,\r
                                     const std::string& linkerParameters,\r
-                                    const std::string& objectFilenames ) const;\r
-       void GenerateImportLibraryTargetIfNeeded ( const Module& module ) const;\r
+                                    const std::string& objectsMacro,\r
+                                    const std::string& libsMacro,\r
+                                    string_list& clean_files ) const;\r
+       void GenerateImportLibraryTargetIfNeeded ( const Module& module, string_list& clean_files ) const;\r
        std::string GetDefinitionDependencies ( const Module& module ) const;\r
        std::string GetLinkingDependencies ( const Module& module ) const;\r
        bool IsCPlusPlusModule ( const Module& module ) const;\r
@@ -72,6 +82,7 @@ private:
        std::string GenerateGccIncludeParametersFromVector ( const std::vector<Include*>& includes ) const;\r
        std::string GenerateCompilerParametersFromVector ( const std::vector<CompilerFlag*>& compilerFlags ) const;\r
        std::string GenerateLinkerParametersFromVector ( const std::vector<LinkerFlag*>& linkerFlags ) const;\r
+       std::string GenerateImportLibraryDependenciesFromVector ( const std::vector<Library*>& libraries ) const;\r
        std::string GenerateLinkerParameters ( const Module& module ) const;\r
        void GenerateMacro ( const char* assignmentOperation,\r
                             const std::string& macro,\r
@@ -82,6 +93,7 @@ private:
                              const std::vector<File*>& files,\r
                              const std::vector<Include*>& includes,\r
                              const std::vector<Define*>& defines,\r
+                             const std::vector<Library*>& libraries,\r
                              const std::vector<CompilerFlag*>* compilerFlags,\r
                              const std::vector<LinkerFlag*>* linkerFlags,\r
                              const std::vector<If*>& ifs,\r
@@ -89,13 +101,17 @@ private:
                              const std::string& nasmflags_macro,\r
                              const std::string& windresflags_macro,\r
                              const std::string& linkerflags_macro,\r
-                             const std::string& objs_macro) const;\r
+                             const std::string& objs_macro,\r
+                             const std::string& libs_macro,\r
+                             const std::string& linkdeps_macro ) const;\r
        void GenerateMacros ( const Module& module,\r
                              const std::string& cflags_macro,\r
                              const std::string& nasmflags_macro,\r
                              const std::string& windresflags_macro,\r
                              const std::string& linkerflags_macro,\r
-                             const std::string& objs_macro) const;\r
+                             const std::string& objs_macro,\r
+                             const std::string& libs_macro,\r
+                             const std::string& linkDepsMacro ) const;\r
        std::string GenerateGccIncludeParameters ( const Module& module ) const;\r
        std::string GenerateGccParameters ( const Module& module ) const;\r
        std::string GenerateNasmParameters ( const Module& module ) const;\r
@@ -114,14 +130,16 @@ private:
                                      const std::string& sourceFilename,\r
                                      const std::string& windresflagsMacro ) const;\r
        void GenerateWinebuildCommands ( const Module& module,\r
-                                        const std::string& sourceFilename ) const;\r
+                                        const std::string& sourceFilename,\r
+                                        string_list& clean_files ) const;\r
        void GenerateCommands ( const Module& module,\r
                                const std::string& sourceFilename,\r
                                const std::string& cc,\r
                                const std::string& cppc,\r
                                const std::string& cflagsMacro,\r
                                const std::string& nasmflagsMacro,\r
-                               const std::string& windresflagsMacro ) const;\r
+                               const std::string& windresflagsMacro,\r
+                               string_list& clean_files ) const;\r
        void GenerateObjectFileTargets ( const Module& module,\r
                                         const std::vector<File*>& files,\r
                                         const std::vector<If*>& ifs,\r
@@ -129,14 +147,16 @@ private:
                                         const std::string& cppc,\r
                                         const std::string& cflagsMacro,\r
                                         const std::string& nasmflagsMacro,\r
-                                        const std::string& windresflagsMacro ) const;\r
+                                        const std::string& windresflagsMacro,\r
+                                        string_list& clean_files ) const;\r
        void GenerateObjectFileTargets ( const Module& module,\r
                                         const std::string& cc,\r
                                         const std::string& cppc,\r
                                         const std::string& cflagsMacro,\r
                                         const std::string& nasmflagsMacro,\r
-                                        const std::string& windresflagsMacro ) const;\r
-       void GetCleanTargets ( std::vector<std::string>& out,\r
+                                        const std::string& windresflagsMacro,\r
+                                        string_list& clean_files ) const;\r
+       void GetCleanTargets ( string_list& out,\r
                               const std::vector<File*>& files,\r
                               const std::vector<If*>& ifs ) const;\r
        std::string GenerateArchiveTarget ( const Module& module,\r
@@ -147,7 +167,8 @@ private:
                                        const std::string& cppc,\r
                                        const std::string& ar,\r
                                        const std::string* clags,\r
-                                       const std::string* nasmflags ) const;\r
+                                       const std::string* nasmflags,\r
+                                       string_list& clean_files ) const;\r
        std::string GetSpecObjectDependencies ( const std::string& filename ) const;\r
        std::string GetDefaultDependencies ( const Module& module ) const;\r
 };\r
@@ -157,9 +178,9 @@ class MingwBuildToolModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwBuildToolModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateBuildToolModuleTarget ( const Module& module );\r
+       void GenerateBuildToolModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -167,9 +188,9 @@ class MingwKernelModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwKernelModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateKernelModuleTarget ( const Module& module );\r
+       void GenerateKernelModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -177,9 +198,9 @@ class MingwStaticLibraryModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwStaticLibraryModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateStaticLibraryModuleTarget ( const Module& module );\r
+       void GenerateStaticLibraryModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -187,9 +208,9 @@ class MingwObjectLibraryModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwObjectLibraryModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateObjectLibraryModuleTarget ( const Module& module );\r
+       void GenerateObjectLibraryModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -197,9 +218,9 @@ class MingwKernelModeDLLModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwKernelModeDLLModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateKernelModeDLLModuleTarget ( const Module& module );\r
+       void GenerateKernelModeDLLModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -207,9 +228,9 @@ class MingwKernelModeDriverModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwKernelModeDriverModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateKernelModeDriverModuleTarget ( const Module& module );\r
+       void GenerateKernelModeDriverModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -217,9 +238,9 @@ class MingwNativeDLLModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwNativeDLLModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateNativeDLLModuleTarget ( const Module& module );\r
+       void GenerateNativeDLLModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -227,9 +248,9 @@ class MingwNativeCUIModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwNativeCUIModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateNativeCUIModuleTarget ( const Module& module );\r
+       void GenerateNativeCUIModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -237,10 +258,10 @@ class MingwWin32DLLModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwWin32DLLModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateExtractWineDLLResourcesTarget ( const Module& module );\r
-       void GenerateWin32DLLModuleTarget ( const Module& module );\r
+       void GenerateExtractWineDLLResourcesTarget ( const Module& module, string_list& clean_files );\r
+       void GenerateWin32DLLModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -248,9 +269,9 @@ class MingwWin32CUIModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwWin32CUIModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateWin32CUIModuleTarget ( const Module& module );\r
+       void GenerateWin32CUIModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -258,9 +279,9 @@ class MingwWin32GUIModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwWin32GUIModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateWin32GUIModuleTarget ( const Module& module );\r
+       void GenerateWin32GUIModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -268,9 +289,9 @@ class MingwBootLoaderModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwBootLoaderModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateBootLoaderModuleTarget ( const Module& module );\r
+       void GenerateBootLoaderModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -278,9 +299,9 @@ class MingwBootSectorModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwBootSectorModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateBootSectorModuleTarget ( const Module& module );\r
+       void GenerateBootSectorModuleTarget ( const Module& module, string_list& clean_files );\r
 };\r
 \r
 \r
@@ -288,9 +309,9 @@ class MingwIsoModuleHandler : public MingwModuleHandler
 {\r
 public:\r
        MingwIsoModuleHandler ();\r
-       virtual void Process ( const Module& module );\r
+       virtual void Process ( const Module& module, string_list& clean_files );\r
 private:\r
-       void GenerateIsoModuleTarget ( const Module& module );\r
+       void GenerateIsoModuleTarget ( const Module& module, string_list& clean_files );\r
        std::string GetBootstrapCdDirectories ( const std::string bootcdDirectory,\r
                                                const Module& module ) const;\r
        std::string GetNonModuleCdDirectories ( const std::string bootcdDirectory,\r
index 67f56e9..0dad9ca 100644 (file)
@@ -85,24 +85,30 @@ RBUILD_HOST_CXXFLAGS = -g -I$(RBUILD_BASE) -Werror -Wall
 RBUILD_HOST_LFLAGS = -g\r
 \r
 $(RBUILD_TARGET): $(RBUILD_OBJECTS)\r
+       $(HALFVERBOSEECHO) [LD]      $@\r
        ${host_gpp} $(RBUILD_OBJECTS) $(RBUILD_HOST_LFLAGS) -o $(RBUILD_TARGET)\r
 \r
 $(RBUILD_COMMON_OBJECTS): %.o: %.cpp\r
+       $(HALFVERBOSEECHO) [CC]      $<\r
        ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@\r
 \r
 $(RBUILD_SPECIAL_OBJECTS): %.o: %.cpp\r
+       $(HALFVERBOSEECHO) [CC]      $<\r
        ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@\r
 \r
 $(RBUILD_TEST_TARGET): $(RBUILD_TEST_OBJECTS)\r
+       $(HALFVERBOSEECHO) [LD]      $@\r
        ${host_gpp} $(RBUILD_TEST_OBJECTS) $(RBUILD_HOST_LFLAGS) -o $(RBUILD_TEST_TARGET)\r
 \r
 $(RBUILD_TEST_SPECIAL_OBJECTS): %.o: %.cpp\r
+       $(HALFVERBOSEECHO) [CC]      $<\r
        ${host_gpp} $(RBUILD_HOST_CXXFLAGS) -c $< -o $@\r
 \r
 .PHONY: rbuild_test\r
 \r
 rbuild_test: $(RBUILD_TEST_TARGET)\r
-       $(RBUILD_TEST_TARGET)\r
+       $(HALFVERBOSEECHO) [TEST]    $@\r
+       $(Q)$(RBUILD_TEST_TARGET)\r
 \r
 .PHONY: rbuild_clean\r
 rbuild_clean:\r
index 1ee50a5..c9e3504 100644 (file)
@@ -174,10 +174,10 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
        }\r
        else if ( e.name == "library" && e.value.size () )\r
        {\r
-               if ( pIf )\r
+               /*if ( pIf )\r
                        throw InvalidBuildFileException (\r
                                e.location,\r
-                               "<library> is not a valid sub-element of <if>" );\r
+                               "<library> is not a valid sub-element of <if>" );*/\r
                libraries.push_back ( new Library ( e, *this, e.value ) );\r
                subs_invalid = true;\r
        }\r
@@ -528,13 +528,20 @@ Library::Library ( const XMLElement& _node,
                    const string& _name )\r
        : node(_node),\r
          module(_module),\r
-         name(_name)\r
+         name(_name),\r
+         imported_module(_module.project.LocateModule(_name))\r
 {\r
        if ( module.name == name )\r
                throw InvalidBuildFileException (\r
                        node.location,\r
                        "module '%s' cannot link against itself",\r
                        name.c_str() );\r
+       if ( !imported_module )\r
+               throw InvalidBuildFileException (\r
+                       node.location,\r
+                       "module '%s' trying to import non-existant module '%s'",\r
+                       module.name.c_str(),\r
+                       name.c_str() );\r
 }\r
 \r
 void\r
index ee08699..0f9d8a2 100644 (file)
@@ -231,6 +231,7 @@ public:
        const XMLElement& node;\r
        const Module& module;\r
        std::string name;\r
+       const Module* imported_module;\r
 \r
        Library ( const XMLElement& _node,\r
                  const Module& _module,\r
@@ -317,6 +318,7 @@ public:
        std::vector<Define*> defines;\r
        std::vector<Property*> properties;\r
        std::vector<If*> ifs;\r
+       std::vector<Library*> libraries;\r
 \r
        If ( const XMLElement& node_,\r
             const Project& project_,\r
index af4b515..0d40bd7 100644 (file)
@@ -84,9 +84,11 @@ UNICODE_HOST_CFLAGS = \
        -I$(UNICODE_BASE) -Iinclude/wine -Iw32api/include
 
 $(UNICODE_TARGET): $(UNICODE_OBJECTS)
+       $(HALFVERBOSEECHO) [AR]      $@
        ${host_ar} -rc $(UNICODE_TARGET) $(UNICODE_OBJECTS)
 
 $(UNICODE_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(UNICODE_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: unicode_clean
index 9407229..e51f945 100644 (file)
@@ -21,9 +21,11 @@ WMC_HOST_CXXFLAGS = -I$(WMC_BASE) -g -Werror -Wall
 WMC_HOST_LFLAGS = -g
 
 $(WMC_TARGET): $(WMC_OBJECTS)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gcc} $(WMC_OBJECTS) $(WMC_HOST_LFLAGS) -o $(WMC_TARGET)
 
 $(WMC_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(WMC_HOST_CXXFLAGS) -c $< -o $@
 
 .PHONY: wmc_clean
index 60cdb59..dce245f 100644 (file)
@@ -15,9 +15,11 @@ WPP_OBJECTS = \
 WPP_HOST_CFLAGS = -D__USE_W32API -I$(WPP_BASE) -Iinclude -Iinclude/wine -g
 
 $(WPP_TARGET): $(WPP_OBJECTS)
+       $(HALFVERBOSEECHO) [AR]      $@
        ${host_ar} -rc $(WPP_TARGET) $(WPP_OBJECTS)
 
 $(WPP_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(WPP_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: wpp_clean
index 333bef9..204a940 100644 (file)
@@ -28,9 +28,11 @@ WRC_HOST_CFLAGS = -I$(WRC_BASE) -g -Werror -Wall \
 WRC_HOST_LFLAGS = -g
 
 $(WRC_TARGET): $(WRC_OBJECTS) $(UNICODE_TARGET) $(WPP_TARGET)
+       $(HALFVERBOSEECHO) [LD]      $@
        ${host_gcc} $(WRC_OBJECTS) $(UNICODE_TARGET) $(WPP_TARGET) $(WRC_HOST_LFLAGS) -o $(WRC_TARGET)
 
 $(WRC_OBJECTS): %.o : %.c
+       $(HALFVERBOSEECHO) [CC]      $<
        ${host_gcc} $(WRC_HOST_CFLAGS) -c $< -o $@
 
 .PHONY: wrc_clean