diff options
author | Oliver Schneider <oliver@assarbad.net> | 2020-11-13 21:27:45 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-11-16 16:34:53 (GMT) |
commit | 378c047ae30184bdcefdf767fb49538655ee2191 (patch) | |
tree | f0a8e8defe0496c6663306f586a93ef7adc3d947 /Source/cmGlobalUnixMakefileGenerator3.cxx | |
parent | 01b473b81098e95ac3e6cbf173c78bf02bdf036c (diff) | |
download | CMake-378c047ae30184bdcefdf767fb49538655ee2191.zip CMake-378c047ae30184bdcefdf767fb49538655ee2191.tar.gz CMake-378c047ae30184bdcefdf767fb49538655ee2191.tar.bz2 |
Makefiles: Explicitly tell 'make' tool what Makefile name to use
CMake did not specify the filename of the Makefile generated by it.
Due to GNU make precedence rules this means that the presence of a
GNUmakefile or makefile would take precedence over the generated
Makefile.
This is only relevant for in-source builds and only whenever an
alternative makefile by the above mentioned names exists.
This patch adds the (seemingly universal) `-f` switch and the
(hardcoded) filename (it is now hardcoded separately in these two
files):
- cmLocalUnixMakefileGenerator3.cxx
- cmGlobalUnixMakefileGenerator3.cxx
Fixes: #21418
Diffstat (limited to 'Source/cmGlobalUnixMakefileGenerator3.cxx')
-rw-r--r-- | Source/cmGlobalUnixMakefileGenerator3.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index c6c540b..9c3a533 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -589,6 +589,11 @@ cmGlobalUnixMakefileGenerator3::GenerateBuildCommand( } makeCommand.Add(this->SelectMakeProgram(makeProgram)); + // Explicitly tell the make tool to use the Makefile written by + // cmLocalUnixMakefileGenerator3::WriteLocalMakefile + makeCommand.Add("-f"); + makeCommand.Add("Makefile"); + if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) { if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) { makeCommand.Add("-j"); |