From 5cafc1413ab4ef1eb29648d8c2ca993a2c4a2685 Mon Sep 17 00:00:00 2001 From: jantje Date: Fri, 21 Oct 2016 02:02:23 +0200 Subject: [PATCH] Bug 422378: allow case of getOutputNames() returning null Allow GnuMakefileGenerator to completely ignore an input file Change-Id: If4b45db8482b273f4729211d55cfa4f201760b29 Signed-off-by: jantje --- .../makegen/gnu/GnuMakefileGenerator.java | 92 ++++++++++--------- 1 file changed, 47 insertions(+), 45 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java index e42719f82b1..67fbf4825a0 100644 --- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java +++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/makegen/gnu/GnuMakefileGenerator.java @@ -3256,58 +3256,60 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator2 { IPath[] inPaths = new IPath[1]; inPaths[0] = sourceLocation; IPath[] outPaths = nameProvider.getOutputNames(tool, inPaths); - for (int j=0; j 0) + outputName = resolved; + } catch (BuildMacroException e) { } - else { - resolved = ManagedBuildManager - .getBuildMacroProvider() - .resolveValueToMakefileFormat( - outputName, - "", //$NON-NLS-1$ - " ", //$NON-NLS-1$ - IBuildMacroProvider.CONTEXT_FILE, - new FileContextData( - sourceLocation, null, - option, tool)); + // If only a file name is specified, add the relative path of this output directory + if (outPath.segmentCount() == 1) { + outPath = Path.fromOSString(relativePath + outPath.toString()); + } + if (primaryOutput) { + ruleOutputs.add(j, outPath); + enumeratedPrimaryOutputs.add(j, resolvePercent(outPath, sourceLocation)); + } else { + ruleOutputs.add(outPath); + enumeratedSecondaryOutputs.add(resolvePercent(outPath, sourceLocation)); } - - if ((resolved = resolved.trim()).length() > 0) - outputName = resolved; - } catch (BuildMacroException e) { - } - - // If only a file name is specified, add the relative path of this output directory - if (outPath.segmentCount() == 1) { - outPath = Path.fromOSString(relativePath + outPath.toString()); - } - if (primaryOutput) { - ruleOutputs.add(j, outPath); - enumeratedPrimaryOutputs.add(j, resolvePercent(outPath, sourceLocation)); - } else { - ruleOutputs.add(outPath); - enumeratedSecondaryOutputs.add(resolvePercent(outPath, sourceLocation)); } } } else