Looking at the generated makefile I saw some inconsistencies that are easily addressable.
The rule for "all" uses the file name instead of $(BIN). This can be addressed at line 286 of compiler.pas (as of 5.3.0.2 RC1)
Writeln(F, 'all: all-before ' + GenMakePath1(ExtractRelativePath(Makefile, fProject.Executable)) + ' all-after');
becoming
Writeln(F, 'all: all-before $(BIN) all-after');
The same should be done for the rule to build the binary.
currently it looks like
$(BIN): $(OBJ) $(CPP) $(LINKOBJ) -o "bin\Executor.exe" $(LIBS)
when it should look like
$(BIN): $(OBJ) $(CPP) $(LINKOBJ) -o "$(BIN)" $(LIBS)
Simple fix to compiler.pas 453-456
if fProject.Options.useGPP then writeln(F, #9 + '$(CPP) $(LINKOBJ) -o "' + ExtractRelativePath(Makefile, fProject.Executable) + '" $(LIBS)') else writeln(F, #9 + '$(CC) $(LINKOBJ) -o "' + ExtractRelativePath(Makefile, fProject.Executable) + '" $(LIBS)');
becoming
if fProject.Options.useGPP then writeln(F, #9 + '$(CPP) $(LINKOBJ) -o "$(BIN)" $(LIBS)') else writeln(F, #9 + '$(CC) $(LINKOBJ) -o "$(BIN)" $(LIBS)');
That surely looks interesting.
The only minor thing I'm worried about is that $BIN might not always be defined properly, but I can't yet see why it shouldn't. But if BIN is always set properly, this will be quite a nice fix (mainly because it nicely simplifies the source code).
This update will find its way into 5.3.0.2 if all goes well. Expect that version in the coming few days.
Fix added to 5.3.0.2. Expect a release after a few days testing.
I've got one objection though: the fixes proposed in lines 453 to 456 should not contain quotes around $(BIN). Quotes are added to the BIN variable itself when needed, and GCC does not like double double quotes, so it is not needed provide an extra level of quotes:
Last edit: orwelldevcpp 2012-10-21