After quite a while I figured out that this problem seems to be caused by some code in _parse_project_command that has been commented out in V18 (compared with V16) and prevents the %oe option from working properly for gnu c make file generation. I think slickedit will probably be able to fix this with a hotfix fairly easily, if you report it to them.
<some time earlier>
If I create a gnu c project with auto generated make file I get this in the make file
COMPILE=g++ -c -g -o "$(OUTDIR)/$(*F).exee" $(CFG_INC) $<
i.e. I get .exee where you just get e - probably because I left a checkbox enabled for something to do with .exe
My make file has this
COMMON_OBJ=$(OUTDIR)/testgcc1.o
OBJ=$(COMMON_OBJ) $(CFG_OBJ)
ALL_OBJ=$(OUTDIR)/testgcc1.o
COMPILE=g++ -c -g -o "$(OUTDIR)/$(*F).exee" $(CFG_INC) $<
LINK=g++ -g -o "$(OUTFILE)" $(ALL_OBJ)
and searching slick macro files for COMMON_OBJ you find this in projmake.e
splitAndInsertValueList("COMMON_OBJ", makeCommandCLSafe(commonObjs));
insert_line("OBJ=$(COMMON_OBJ) $(CFG_OBJ)");
splitAndInsertValueList("ALL_OBJ", makeCommandCLSafe(fullObjectList));
// only add these if there are non-linkable objects
if(hasNLObjects) {
splitAndInsertValueList("CFG_OBJ_NL", makeCommandCLSafe(nlCfgObjs));
splitAndInsertValueList("COMMON_OBJ_NL", makeCommandCLSafe(nlCommonObjs));
insert_line("OBJ_NL=$(COMMON_OBJ_NL) $(CFG_OBJ_NL)");
}
// get the commands and modify them for use in the makefile
insert_line("");
// add compile target from <Menu> container (this was parsed earlier)
insert_line(compileToolLine);
So compileToolLine is the string we're having a problem with. It is generated with this code
_str cmdLine = _ProjectGet_TargetCmdLine(projectHandle, compileTargetNode);
say(cmdLine);
_str otherOpts = _ProjectGet_TargetOtherOptions(projectHandle, compileTargetNode);
// build and save the compile command for insertion into the makefile later
cmdLine = prepareCommand(projectName, makefileFormat, cmdLine, "compile", "", otherOpts, replaceEnvVars);
compileToolLine = "COMPILE=" makeCommandCLSafe(cmdLine);
I added the "say" command to capture the output - I got this
g++ -c %xup %defd -g -o "%bd%n%oe" %i %f
g++ -c %xup %defd -o "%bd%n%oe" %i %f
The first line is for the compiler, the second for linking (I think).
In the help file it says %oe is for "Output extension with dot" - but it's obviously not working because %o is getting translated to .exe (in my case) and the "e" is just getting left there
prepareCommand does this
case "compile":
//preparedCmd = stranslate(preparedCmd, "$*", "%bd%n", "I");
preparedCmd = stranslate(preparedCmd, "$(OUTDIR)" getFileSep(makefileFormat), "%bd", "I");
preparedCmd = stranslate(preparedCmd, "$(CFG_INC)", "%ir", "I");
preparedCmd = stranslate(preparedCmd, "$(CFG_INC)", "%i", "I");
preparedCmd = stranslate(preparedCmd, "$(CFG_LIB)", "%libs", "I");
preparedCmd = stranslate(preparedCmd, "$(ALL_OBJ)", "%objs", "I");
preparedCmd = stranslate(preparedCmd, "$<", "%f", "I");
preparedCmd = stranslate(preparedCmd, "$(*F)", "%n", "I");
preparedCmd = stranslate(preparedCmd, "$(*D)", "%p", "I");
preparedCmd = stranslate(preparedCmd, otherOpts, "%~other", "I");
// special cases
preparedCmd = stranslate(preparedCmd, "$<", "@?\"?%[Ll][Ff]\"?", "U"); // [@]["]%lf["]
preparedCmd = stranslate(preparedCmd, '$(OUTFILE)\\1', "%[Oo]([^npe])", "U"); // %o but not %on, %op, or %oe
break;
So you can see that %bd gets translated to $(OUTDIR)
%n gets translated to $(*F)
%oe becomes .exee
Quotes around the above three are left in
%i becomes $(CFG_INC)
%f becomes $<
So %oe isn't getting translated properly, it's getting left alone.
After the above translation, _parse_project_command is called to translate remaining % sequences and %oe becomes .exee (for me). The help file says %oe should become "output extension with dot" - _parse_project_command does this
info=_ProjectGet_OutputFile(handle,config);
// ...
s = _strip_filename(absOutputFile, 'N');
Slickedit v16.0.3 does this
_str outputExtension = "";
getExtSpecificCompileInfo(buf_name, _ProjectHandle(project_name), GetCurrentConfigName(),
"", outputExtension, auto compileRuleTargetNode=0, auto linkObject=false, true);
len = 3;
// remove the wildcard
if (first_char(outputExtension) == '*') {
outputExtension = substr(outputExtension, 2);
}
s = outputExtension;
but the above code has been commented out in V18. I don't really know how %oe becomes .exee in my case though.