From 085d1335d16210467cbd29f44e046a0f5fe8970f Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 28 May 2019 13:22:39 +0200 Subject: Warn about invalid SUBDIRS content Invalid SUBDIRS values like SUBDIRS += foo \ bar \ \ baz would produce a Makefile with a sub-- target that will call the make on the same Makefile again recursively, letting make run forever. Ignore values like this and print a warning message. Fixes: QTBUG-76068 Change-Id: I6ca0f8c8238249f1be02d8c311b4c148fd80e707 Reviewed-by: Oliver Wolff --- qmake/generators/makefile.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'qmake/generators/makefile.cpp') diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index d53dbf9fa5..bfef31f17e 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2400,8 +2400,15 @@ MakefileGenerator::findSubDirsSubTargets() const st->profile = file; } } else { - if(!file.isEmpty() && !project->isActiveConfig("subdir_first_pro")) - st->profile = file.section(Option::dir_sep, -1) + Option::pro_ext; + if (!file.isEmpty() && !project->isActiveConfig("subdir_first_pro")) { + const QString baseName = file.section(Option::dir_sep, -1); + if (baseName.isEmpty()) { + warn_msg(WarnLogic, "Ignoring invalid SUBDIRS entry %s", + subdirs[subdir].toLatin1().constData()); + continue; + } + st->profile = baseName + Option::pro_ext; + } st->in_directory = file; } while(st->in_directory.endsWith(Option::dir_sep)) -- cgit v1.2.3