gp seems to recompile subunit.p in this situation anyway, independent of the --compile-and-link switch. I tried it with an unpatched gp-0.60. Can you confirm that this happens when you test it yourself ?
Actually, you're right, there is something a bit funky going on for the explicitly specified file in the gp command line.
Ahh, I see, at least for me,
gp -c lowunit.p results in the gpd including the line:
g /Users/peter/Interarchy/Project/Build/IAObjects/.gpi
when it should have the line
g /Users/peter/Interarchy/Project/Build/IAObjects/lowunit.gpi
Ok, the problem is that there is no interface name determined for the "MainSrc" unit. This patch:
--- gp.pas (revision 373) +++ gp.pas (working copy) @@ -1330,7 +1330,7 @@ DoApplyAutoUses := True; pp := @Deps; while pp^ <> nil do pp := @pp^^.Next; - pp^ := NewDep (MainSrc, '', fk_Program, True); + pp^ := NewDep (MainSrc, LoCaseStr (NameFromPath (MainSrc)), fk_Program, True); DepToDo := pp^ end else
Should resolve it. It just uses the interface name as the lowercase of the basename of the MainSrc. The InterfaceName is not needed for compiling the main program, which is why this has gone unnoticed. I'm not sure if this InterfaceName determination is correct for modules.
Enjoy, Peter.