1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 22:52:11 +02:00

Fix for PR 68908

This commit is contained in:
Alain Magloire 2004-07-26 18:56:51 +00:00
parent 403548698f
commit 75b012b2ec

View file

@ -46,6 +46,7 @@ import org.eclipse.cdt.make.internal.core.makefile.SuffixesRule;
import org.eclipse.cdt.make.internal.core.makefile.Target; import org.eclipse.cdt.make.internal.core.makefile.Target;
import org.eclipse.cdt.make.internal.core.makefile.TargetRule; import org.eclipse.cdt.make.internal.core.makefile.TargetRule;
import org.eclipse.cdt.make.internal.core.makefile.Util; import org.eclipse.cdt.make.internal.core.makefile.Util;
import org.eclipse.cdt.make.internal.core.makefile.posix.PosixMakefileUtil;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
/** /**
@ -145,7 +146,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
} }
// 1- Try command first, since we can not strip '#' in command line // 1- Try command first, since we can not strip '#' in command line
if (GNUMakefileUtil.isCommand(line)) { if (PosixMakefileUtil.isCommand(line)) {
Command cmd = new Command(this, line); Command cmd = new Command(this, line);
cmd.setLines(startLine, endLine); cmd.setLines(startLine, endLine);
if (!conditions.empty()) { if (!conditions.empty()) {
@ -257,7 +258,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
} }
// - Check for inference rule. // - Check for inference rule.
if (GNUMakefileUtil.isInferenceRule(line)) { if (PosixMakefileUtil.isInferenceRule(line)) {
InferenceRule irule = parseInferenceRule(line); InferenceRule irule = parseInferenceRule(line);
irule.setLines(startLine, endLine); irule.setLines(startLine, endLine);
addDirective(conditions, irule); addDirective(conditions, irule);
@ -267,10 +268,12 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
// - Variable Definiton ? // - Variable Definiton ?
if (GNUMakefileUtil.isVariableDefinition(line)) { if (GNUMakefileUtil.isVariableDefinition(line)) {
Directive stmt = parseVariableDefinition(line); VariableDefinition vd = parseVariableDefinition(line);
stmt.setLines(startLine, endLine); vd.setLines(startLine, endLine);
addDirective(conditions, stmt); addDirective(conditions, vd);
continue; if (!vd.isTargetSpecific()) {
continue;
}
} }
// - GNU Static Target rule ? // - GNU Static Target rule ?
@ -345,19 +348,19 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
protected SpecialRule processSpecialRules(String line) { protected SpecialRule processSpecialRules(String line) {
SpecialRule stmt = null; SpecialRule stmt = null;
if (GNUMakefileUtil.isIgnoreRule(line)) { if (PosixMakefileUtil.isIgnoreRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isPosixRule(line)) { } else if (PosixMakefileUtil.isPosixRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isPreciousRule(line)) { } else if (PosixMakefileUtil.isPreciousRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isSilentRule(line)) { } else if (PosixMakefileUtil.isSilentRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isSuffixesRule(line)) { } else if (PosixMakefileUtil.isSuffixesRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isDefaultRule(line)) { } else if (PosixMakefileUtil.isDefaultRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isSccsGetRule(line)) { } else if (PosixMakefileUtil.isSccsGetRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
} else if (GNUMakefileUtil.isPhonyRule(line)) { } else if (GNUMakefileUtil.isPhonyRule(line)) {
stmt = parseSpecialRule(line); stmt = parseSpecialRule(line);
@ -390,7 +393,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
if (index != -1) { if (index != -1) {
keyword = line.substring(0, index).trim(); keyword = line.substring(0, index).trim();
String req = line.substring(index + 1); String req = line.substring(index + 1);
reqs = GNUMakefileUtil.findPrerequisites(req); reqs = PosixMakefileUtil.findPrerequisites(req);
} else { } else {
keyword = line; keyword = line;
reqs = new String[0]; reqs = new String[0];
@ -558,7 +561,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
if (index != -1) { if (index != -1) {
// Break the targets // Break the targets
String target = line.substring(0, index); String target = line.substring(0, index);
targetNames = GNUMakefileUtil.findTargets(target.trim()); targetNames = PosixMakefileUtil.findTargets(target.trim());
// Some TargetRule have "::" for separator // Some TargetRule have "::" for separator
String req = line.substring(index + 1); String req = line.substring(index + 1);
@ -587,10 +590,10 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
orderReq = ""; //$NON-NLS-1$ orderReq = ""; //$NON-NLS-1$
} }
normalReqs = GNUMakefileUtil.findPrerequisites(normalReq.trim()); normalReqs = PosixMakefileUtil.findPrerequisites(normalReq.trim());
orderReqs = GNUMakefileUtil.findPrerequisites(orderReq.trim()); orderReqs = PosixMakefileUtil.findPrerequisites(orderReq.trim());
} else { } else {
targetNames = GNUMakefileUtil.findTargets(line); targetNames = PosixMakefileUtil.findTargets(line);
normalReqs = new String[0]; normalReqs = new String[0];
orderReqs = new String[0]; orderReqs = new String[0];
} }
@ -621,7 +624,8 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
StringBuffer value = new StringBuffer(); StringBuffer value = new StringBuffer();
// Check for Target: Variable-assignment // Check for Target: Variable-assignment
if (GNUMakefileUtil.isTargetVariable(line)) { isTargetVariable = GNUMakefileUtil.isTargetVariable(line);
if (isTargetVariable) {
// move to the first ':' // move to the first ':'
int colon = Util.indexOf(line, ':'); int colon = Util.indexOf(line, ':');
if (colon != -1) { if (colon != -1) {
@ -692,8 +696,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
if (isTargetVariable) { if (isTargetVariable) {
vd = new TargetVariable(this, targetName, name, value, isOverride, type); vd = new TargetVariable(this, targetName, name, value, isOverride, type);
} } else if (isOverride && isDefine) {
if (isOverride && isDefine) {
vd = new OverrideDefine(this, name, value); vd = new OverrideDefine(this, name, value);
} else if (isDefine) { } else if (isDefine) {
vd = new DefineVariable(this, name, value); vd = new DefineVariable(this, name, value);
@ -715,7 +718,7 @@ public class GNUMakefile extends AbstractMakefile implements IGNUMakefile {
int colon = Util.indexOf(line, ':'); int colon = Util.indexOf(line, ':');
if (colon > 1) { if (colon > 1) {
String targetLine = line.substring(0, colon).trim(); String targetLine = line.substring(0, colon).trim();
targets = GNUMakefileUtil.findTargets(targetLine); targets = PosixMakefileUtil.findTargets(targetLine);
// second colon: Target-Pattern // second colon: Target-Pattern
line = line.substring(colon + 1); line = line.substring(colon + 1);
colon = Util.indexOf(line, ':'); colon = Util.indexOf(line, ':');