diff options
Diffstat (limited to 'Source/cmLocalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmLocalUnixMakefileGenerator3.cxx | 71 |
1 files changed, 42 insertions, 29 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 93722d1..935da57 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -80,7 +80,6 @@ static std::string cmSplitExtension(std::string const& in, std::string& base) //---------------------------------------------------------------------------- cmLocalUnixMakefileGenerator3::cmLocalUnixMakefileGenerator3() { - this->SilentNoColon = false; this->WindowsShell = false; this->IncludeDirective = "include"; this->MakefileVariableSize = 0; @@ -190,7 +189,7 @@ void cmLocalUnixMakefileGenerator3::AddLocalObjectFile( void cmLocalUnixMakefileGenerator3::GetIndividualFileTargets (std::vector<std::string>& targets) { - for (std::map<cmStdString, LocalObjectInfo>::iterator lo = + for (std::map<std::string, LocalObjectInfo>::iterator lo = this->LocalObjectFiles.begin(); lo != this->LocalObjectFiles.end(); ++lo) { @@ -235,7 +234,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() // only write local targets unless at the top Keep track of targets already // listed. - std::set<cmStdString> emittedTargets; + std::set<std::string> emittedTargets; if (this->Parent) { // write our targets, and while doing it collect up the object @@ -256,7 +255,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalMakefile() // now write out the object rules // for each object file name - for (std::map<cmStdString, LocalObjectInfo>::iterator lo = + for (std::map<std::string, LocalObjectInfo>::iterator lo = this->LocalObjectFiles.begin(); lo != this->LocalObjectFiles.end(); ++lo) { @@ -371,7 +370,7 @@ cmLocalUnixMakefileGenerator3 //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3 ::WriteLocalMakefileTargets(std::ostream& ruleFileStream, - std::set<cmStdString> &emitted) + std::set<std::string> &emitted) { std::vector<std::string> depends; std::vector<std::string> commands; @@ -550,14 +549,14 @@ void cmLocalUnixMakefileGenerator3 ::WriteMakeRule(std::ostream& os, const char* comment, - const char* target, + const std::string& target, const std::vector<std::string>& depends, const std::vector<std::string>& commands, bool symbolic, bool in_help) { // Make sure there is a target. - if(!target || !*target) + if(target.empty()) { cmSystemTools::Error("No target for WriteMakeRule! called with comment: ", comment); @@ -758,15 +757,17 @@ cmLocalUnixMakefileGenerator3 depends.push_back(".hpux_make_needs_suffix_list"); this->WriteMakeRule(makefileStream, 0, ".SUFFIXES", depends, no_commands, false); - - cmGlobalUnixMakefileGenerator3* gg = - static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); - // Write special target to silence make output. This must be after - // the default target in case VERBOSE is set (which changes the - // name). The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a - // "VERBOSE=1" to be added as a make variable which will change the - // name of this special target. This gives a make-time choice to - // the user. + if(this->WatcomWMake) + { + // Switch on WMake feature, if an error or interrupt occurs during + // makefile processing, the current target being made may be deleted + // without prompting (the same as command line -e option). + makefileStream << + "\n" + ".ERASE\n" + "\n" + ; + } if(this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE")) { makefileStream @@ -774,12 +775,22 @@ cmLocalUnixMakefileGenerator3 << "VERBOSE = 1\n" << "\n"; } - if(this->SilentNoColon) + if(this->WatcomWMake) { - makefileStream << "$(VERBOSE).SILENT\n"; + makefileStream << + "!ifndef VERBOSE\n" + ".SILENT\n" + "!endif\n" + ; } else { + // Write special target to silence make output. This must be after + // the default target in case VERBOSE is set (which changes the + // name). The setting of CMAKE_VERBOSE_MAKEFILE to ON will cause a + // "VERBOSE=1" to be added as a make variable which will change the + // name of this special target. This gives a make-time choice to + // the user. this->WriteMakeRule(makefileStream, "Suppress display of executed commands.", "$(VERBOSE).SILENT", @@ -789,6 +800,8 @@ cmLocalUnixMakefileGenerator3 // Work-around for makes that drop rules that have no dependencies // or commands. + cmGlobalUnixMakefileGenerator3* gg = + static_cast<cmGlobalUnixMakefileGenerator3*>(this->GlobalGenerator); std::string hack = gg->GetEmptyRuleHackDepends(); if(!hack.empty()) { @@ -859,11 +872,11 @@ void cmLocalUnixMakefileGenerator3 void cmLocalUnixMakefileGenerator3 ::WriteConvenienceRule(std::ostream& ruleFileStream, - const char* realTarget, - const char* helpTarget) + const std::string& realTarget, + const std::string& helpTarget) { // A rule is only needed if the names are different. - if(strcmp(realTarget, helpTarget) != 0) + if(realTarget != helpTarget) { // The helper target depends on the real target. std::vector<std::string> depends; @@ -1196,12 +1209,12 @@ cmLocalUnixMakefileGenerator3 if(!filename) { // Get the set of source languages in the target. - std::set<cmStdString> languages; + std::set<std::string> languages; target.GetLanguages(languages); fout << "\n" << "# Per-language clean rules from dependency scanning.\n" << "foreach(lang"; - for(std::set<cmStdString>::const_iterator l = languages.begin(); + for(std::set<std::string>::const_iterator l = languages.begin(); l != languages.end(); ++l) { fout << " " << *l; @@ -1299,7 +1312,7 @@ cmLocalUnixMakefileGenerator3::AppendEcho(std::vector<std::string>& commands, //---------------------------------------------------------------------------- std::string cmLocalUnixMakefileGenerator3 -::CreateMakeVariable(const char* sin, const char* s2in) +::CreateMakeVariable(const std::string& sin, const std::string& s2in) { std::string s = sin; std::string s2 = s2in; @@ -1317,7 +1330,7 @@ cmLocalUnixMakefileGenerator3 // see if the variable has been defined before and return // the modified version of the variable - std::map<cmStdString, cmStdString>::iterator i = + std::map<std::string, std::string>::iterator i = this->MakeVariableMap.find(unmodified); if(i != this->MakeVariableMap.end()) { @@ -1721,7 +1734,7 @@ void cmLocalUnixMakefileGenerator3 { text = "Running external command ..."; } - std::set<cmStdString>::const_iterator dit; + std::set<std::string>::const_iterator dit; for ( dit = glIt->second.GetUtilities().begin(); dit != glIt->second.GetUtilities().end(); ++ dit ) @@ -2034,7 +2047,7 @@ void cmLocalUnixMakefileGenerator3::WriteDisclaimer(std::ostream& os) //---------------------------------------------------------------------------- std::string cmLocalUnixMakefileGenerator3 -::GetRecursiveMakeCall(const char *makefile, const char* tgt) +::GetRecursiveMakeCall(const char *makefile, const std::string& tgt) { // Call make on the given file. std::string cmd; @@ -2059,7 +2072,7 @@ cmLocalUnixMakefileGenerator3 } // Add the target. - if (tgt && tgt[0] != '\0') + if (!tgt.empty()) { // The make target is always relative to the top of the build tree. std::string tgt2 = this->Convert(tgt, HOME_OUTPUT); @@ -2198,7 +2211,7 @@ cmLocalUnixMakefileGenerator3::GetImplicitDepends(cmTarget const& tgt) //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3::AddImplicitDepends(cmTarget const& tgt, - const char* lang, + const std::string& lang, const char* obj, const char* src) { |