Skip to content

Commit fb74f5a

Browse files
committed
Improve makefile subdir handling.
1 parent 2eeb401 commit fb74f5a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/projectGenerator_pass.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -647,9 +647,9 @@ bool ProjectGenerator::passMake()
647647
} else if (m_inLine.substr(0, 5) == "endif") {
648648
// Reset the current condition
649649
condition.clear();
650-
} else if (m_inLine.substr(0, 7) == "include") {
650+
} else if (m_inLine.substr(0, 7) == "include" || m_inLine.substr(0, 8) == "-include") {
651651
// Need to append the included file to makefile list
652-
uint startPos = m_inLine.find_first_not_of(" \t", 7);
652+
uint startPos = m_inLine.find_first_not_of(" \t", 7 + (m_inLine[0] == '-' ? 1 : 0));
653653
uint endPos = m_inLine.find_first_of(" \t\n\r", startPos + 1);
654654
endPos = (endPos == string::npos) ? endPos : endPos - startPos;
655655
string newMake = m_inLine.substr(startPos, endPos);
@@ -658,15 +658,17 @@ bool ProjectGenerator::passMake()
658658
while (startPos != string::npos) {
659659
endPos = newMake.find(')', startPos + 1);
660660
if (endPos == string::npos) {
661-
outputInfo("Invalid token (" + newMake + ")");
661+
outputError("Invalid token in include (" + newMake + ")");
662662
return false;
663663
}
664664
++endPos;
665665
string token = newMake.substr(startPos, endPos - startPos);
666666
if (token == "$(SRC_PATH)") {
667667
newMake.replace(startPos, endPos - startPos, m_configHelper.m_rootDirectory);
668+
} else if (token == "$(ARCH)") {
669+
newMake.replace(startPos, endPos - startPos, "x86");
668670
} else {
669-
outputInfo("Unknown token (" + token + ")");
671+
outputError("Unknown token in include (" + token + ")");
670672
return false;
671673
}
672674
startPos = newMake.find('$', startPos);

0 commit comments

Comments
 (0)