Skip to content
Snippets Groups Projects
Commit 378c047a authored by Oliver Schneider's avatar Oliver Schneider Committed by Brad King
Browse files

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
parent 01b473b8
No related branches found
No related tags found
No related merge requests found
......@@ -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");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment