I have not found a way to compile a single file in LinuxCNC (which is not to say that there isn't a way that I haven't found)
It's probably easiest to recompile a run-in-place version of LinuxCNC, test with that, and then move the object file over when it is working.