| 161 | } |
| 162 | |
| 163 | void cmMakefileTargetGenerator::CreateRuleFile() |
| 164 | { |
| 165 | // Create a directory for this target. |
| 166 | this->TargetBuildDirectoryFull = |
| 167 | this->GeneratorTarget->GetSupportDirectory(); |
| 168 | this->TargetBuildDirectory = this->LocalGenerator->MaybeRelativeToCurBinDir( |
| 169 | this->TargetBuildDirectoryFull); |
| 170 | cmSystemTools::MakeDirectory(this->TargetBuildDirectoryFull); |
| 171 | |
| 172 | // Construct the rule file name. |
| 173 | this->BuildFileName = cmStrCat(this->TargetBuildDirectory, "/build.make"); |
| 174 | this->BuildFileNameFull = |
| 175 | cmStrCat(this->TargetBuildDirectoryFull, "/build.make"); |
| 176 | |
| 177 | // Construct the rule file name. |
| 178 | this->ProgressFileNameFull = |
| 179 | cmStrCat(this->TargetBuildDirectoryFull, "/progress.make"); |
| 180 | |
| 181 | // reset the progress count |
| 182 | this->NumberOfProgressActions = 0; |
| 183 | |
| 184 | // Open the rule file. This should be copy-if-different because the |
| 185 | // rules may depend on this file itself. |
| 186 | this->BuildFileStream = cm::make_unique<cmGeneratedFileStream>( |
| 187 | this->BuildFileNameFull, false, |
| 188 | this->GlobalGenerator->GetMakefileEncoding()); |
| 189 | if (!this->BuildFileStream) { |
| 190 | return; |
| 191 | } |
| 192 | this->BuildFileStream->SetCopyIfDifferent(true); |
| 193 | this->LocalGenerator->WriteDisclaimer(*this->BuildFileStream); |
| 194 | if (this->GlobalGenerator->AllowDeleteOnError()) { |
| 195 | std::vector<std::string> no_depends; |
| 196 | std::vector<std::string> no_commands; |
| 197 | this->LocalGenerator->WriteMakeRule( |
| 198 | *this->BuildFileStream, "Delete rule output on recipe failure.", |
| 199 | ".DELETE_ON_ERROR", no_depends, no_commands, false); |
| 200 | } |
| 201 | this->LocalGenerator->WriteSpecialTargetsTop(*this->BuildFileStream); |
| 202 | } |
| 203 | |
| 204 | void cmMakefileTargetGenerator::WriteTargetBuildRules() |
| 205 | { |
no test coverage detected