CVS commit by geiseri: Generic make files now seem to identify most targets. This allows me to build the SuperWaba templates now... ps i HATE regexps and the ONLY reason i lived through this was kregexpeditor M +32 -24 customprojectpart.cpp 1.25 --- kdevelop/parts/customproject/customprojectpart.cpp #1.24:1.25 @@ -459,4 +460,5 @@ void CustomProjectPart::updateTargetMenu } } else { + kdDebug(9025) << "Trying to load a makefile... " << endl; QFile f(buildDirectory() + "/Makefile"); if (!f.exists()) @@ -467,14 +469,20 @@ void CustomProjectPart::updateTargetMenu } QTextStream stream(&f); - QRegExp re(".PHONY\\s*:(.*)"); + //QRegExp re(".PHONY\\s*:(.*)"); + QRegExp re("^[^($%.#].*[^)\s][:].*$"); + QString str = ""; while (!stream.atEnd()) { QString str = stream.readLine(); // Read all continuation lines - while (str.right(1) == "\\" && !stream.atEnd()) { - str.remove(str.length()-1, 1); - str += stream.readLine(); + // kdDebug(9025) << "Trying: " << str.simplifyWhiteSpace() << endl; + //while (str.right(1) == "\\" && !stream.atEnd()) { + // str.remove(str.length()-1, 1); + // str += stream.readLine(); + //} + if (str.contains(re) == 1) + { + kdDebug(9025) << "Adding target: " << str.simplifyWhiteSpace() << endl; + m_targets += QStringList::split(" ", str.simplifyWhiteSpace())[0].replace(':', ""); } - if (re.search(str) == 0) - m_targets += QStringList::split(" ", re.cap(1).simplifyWhiteSpace()); } f.close();