mirror of
https://github.com/reactos/CMake.git
synced 2025-01-23 12:15:20 +00:00
66a9c90c4b
In commit v3.2.0-rc1~272^2~2 (Makefile: Fix rebuild with multiple custom command outputs, 2014-12-05) we changed the generated makefile pattern for multiple outputs from out1: depends... commands... out2: out1 to out1 out2: depends... commands... This was based on the incorrect assumption that make tools would treat this as a combined output rule and run the command(s) exactly once for them. It turns out that instead this new pattern is equivalent to out1: depends... commands... out2: depends... commands... so the commands may be run more than once. Some documents suggest using a "dedicated witness" stamp file: stamp: depends... rm -f stamp touch stamp.tmp commands... mv stamp.tmp stamp out1 out2: stamp However, if the commands fail the error message will refer to the stamp instead of any of the real outputs, which may be confusing to readers. Also, this approach seems to have the same behavior of the original approach that motiviated the above commit: multiple invocations are needed to bring consumers of the outputs up to date. Instead we can return to the original approach but add an explicit touch to each extra output rule: out1: depends... commands... out2: out1 touch -c out2 This causes make tools to recognize that all outputs have changed and therefore to execute any commands that consume them.
63 lines
2.2 KiB
C++
63 lines
2.2 KiB
C++
/*============================================================================
|
|
CMake - Cross Platform Makefile Generator
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
see accompanying file Copyright.txt for details.
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
See the License for more information.
|
|
============================================================================*/
|
|
#include "cmGlobalBorlandMakefileGenerator.h"
|
|
#include "cmLocalUnixMakefileGenerator3.h"
|
|
#include "cmMakefile.h"
|
|
#include "cmake.h"
|
|
|
|
cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
|
|
{
|
|
this->EmptyRuleHackDepends = "NUL";
|
|
this->FindMakeProgramFile = "CMakeBorlandFindMake.cmake";
|
|
this->ForceUnixPaths = false;
|
|
this->ToolSupportsColor = true;
|
|
this->UseLinkScript = false;
|
|
}
|
|
|
|
|
|
void cmGlobalBorlandMakefileGenerator
|
|
::EnableLanguage(std::vector<std::string>const& l,
|
|
cmMakefile *mf,
|
|
bool optional)
|
|
{
|
|
std::string outdir = this->CMakeInstance->GetStartOutputDirectory();
|
|
mf->AddDefinition("BORLAND", "1");
|
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
|
|
mf->AddDefinition("CMAKE_GENERATOR_CXX", "bcc32");
|
|
this->cmGlobalUnixMakefileGenerator3::EnableLanguage(l, mf, optional);
|
|
}
|
|
|
|
///! Create a local generator appropriate to this Global Generator
|
|
cmLocalGenerator *cmGlobalBorlandMakefileGenerator::CreateLocalGenerator()
|
|
{
|
|
cmLocalUnixMakefileGenerator3* lg = new cmLocalUnixMakefileGenerator3;
|
|
lg->SetIncludeDirective("!include");
|
|
lg->SetWindowsShell(true);
|
|
lg->SetDefineWindowsNULL(true);
|
|
lg->SetMakefileVariableSize(32);
|
|
lg->SetPassMakeflags(true);
|
|
lg->SetGlobalGenerator(this);
|
|
lg->SetUnixCD(false);
|
|
lg->SetMakeCommandEscapeTargetTwice(true);
|
|
lg->SetBorlandMakeCurlyHack(true);
|
|
return lg;
|
|
}
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
void cmGlobalBorlandMakefileGenerator
|
|
::GetDocumentation(cmDocumentationEntry& entry)
|
|
{
|
|
entry.Name = cmGlobalBorlandMakefileGenerator::GetActualName();
|
|
entry.Brief = "Generates Borland makefiles.";
|
|
}
|