1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Make 2 makefile generation changes dealing with quotes and Echo:

1.  Use double quotes rather than single quotes around paths that may contain special characters
2.  We used to Echo a command and then issue the command prefixed with "@".  Now we just issue the command and let make echo it.
This commit is contained in:
Leo Treggiari 2006-04-28 13:28:39 +00:00
parent c44541e741
commit 76e3e03781
2 changed files with 13 additions and 10 deletions

View file

@ -98,7 +98,7 @@ public class ManagedCommandLineGenerator implements
{
// if the output name isn't a variable then quote it
if(outputName.indexOf("$(") != 0) //$NON-NLS-1$
tempBuffer.append( SINGLE_QUOTE + outputName + SINGLE_QUOTE);
tempBuffer.append( DOUBLE_QUOTE + outputName + DOUBLE_QUOTE);
else
tempBuffer.append(outputName);
}
@ -113,7 +113,7 @@ public class ManagedCommandLineGenerator implements
{
// if the input resource isn't a variable then quote it
if(inputResources[k].indexOf("$(") != 0) //$NON-NLS-1$
tempBuffer.append(SINGLE_QUOTE + inputResources[k] + SINGLE_QUOTE + WHITESPACE); //$NON-NLS-1$ //$NON-NLS-2$
tempBuffer.append(DOUBLE_QUOTE + inputResources[k] + DOUBLE_QUOTE + WHITESPACE); //$NON-NLS-1$ //$NON-NLS-2$
else
tempBuffer.append(inputResources[k] + WHITESPACE);
}

View file

@ -1572,8 +1572,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
}
buffer.append(TAB + AT + escapedEcho(buildCmd));
buffer.append(TAB + AT + buildCmd);
//buffer.append(TAB + AT + escapedEcho(buildCmd));
//buffer.append(TAB + AT + buildCmd);
buffer.append(TAB + buildCmd);
// TODO
// NOTE WELL: Dependency file generation is not handled for this type of Tool
@ -2455,8 +2456,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
} catch (BuildMacroException e) {
}
buffer.append(TAB + AT + escapedEcho(buildCmd));
buffer.append(TAB + AT + buildCmd);
//buffer.append(TAB + AT + escapedEcho(buildCmd));
//buffer.append(TAB + AT + buildCmd);
buffer.append(TAB + buildCmd);
// Determine if there are any dependencies to calculate
if (doDepGen) {
@ -2632,8 +2634,9 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
} catch (BuildMacroException e) {
}
buffer.append(TAB + AT + escapedEcho(depLine));
buffer.append(TAB + AT + depLine + NEWLINE);
//buffer.append(TAB + AT + escapedEcho(depLine));
//buffer.append(TAB + AT + depLine + NEWLINE);
buffer.append(TAB + depLine + NEWLINE);
}
}
if (addedDepLines) {
@ -3471,8 +3474,8 @@ public class GnuMakefileGenerator implements IManagedBuilderMakefileGenerator {
* @return
*/
static public String escapedEcho(String string) {
String escapedString = string.replaceAll("(['\"\\\\])", "\\\\$1");
return ECHO + WHITESPACE + escapedString + NEWLINE;
String escapedString = string.replaceAll("'", "'\"'\"'");
return ECHO + WHITESPACE + SINGLE_QUOTE + escapedString + SINGLE_QUOTE + NEWLINE;
}
static public String ECHO_BLANK_LINE = ECHO + WHITESPACE + SINGLE_QUOTE + WHITESPACE + SINGLE_QUOTE + NEWLINE;