Hi
I was originally going to post this as a reply to
http://forums.codeblocks.org/index.php/topic,6289.0.html which came up in my search for a way to use remote compiling with C::B, but that thread is very old.
I didn't want to use Uniwin because it seemed like a bad/slow idea to have two copies of the source. I couldn't find a better solution on the forum, so here is mine. Note that it assumes a custom makefile, and is for remote compiling where C::B is on a windows system, and the remote compilation is on a linux system.
Step 1: Download and install Xming (windows X server) from
http://sourceforge.net/projects/xming/ . It will sit in the systray.
Step 2: Open or create your project, and choose any compiler you have installed that actually works (i.e. doesn't give you an 'invalid compiler [YOUR ANSWER IS ALREADY THERE. SEARCH THE FORUMS!]' message when you try to build). The easiest way to achieve this is to use the C::B installer that includes MinGW. It doesn't matter if your remote compiler is completely different to the one you choose here.
Step 3: In the project properties, "Project Settings", select "This is a custom Makefile", <OK>. Now in the project build options, "'Make' Commands", enter: [
$make -X -ssh RemoteUser@RemoteIP -pw RemotePassword make all -C /path/to/remote/makefile/ ]*. The '
make all' is specific to my Makefile. You can obviously modify this for the different build types implemented in your Makefile. I set all the make commands to be the same, with the exception of "Clean project/target", where I used '
make clean', which is implemented in my Makefile. Do this for all the build profiles (in my case, "Debug" and "Release"). <OK>.
Step 4 (nightly builds only): If you are using a C::B build newer than January 2009, you may need to fill in the "Ask if rebuild is needed" make command in the "'Make' Commands" tab. This is the same command as in step 3, but with
make -q in place of
make all. For the 11/11/09 nightly build, I had to use
make-q (i.e. without the space) for this to work. You must also change "Settings", "Compiler and debugger", "Global compiler settings", "Other settings", "Compiler logging" to "Full command line", or else you will receive a "Nothing to be done." message when you try to build.
Step 5: In "Settings", "Compiler and debugger", "Global compiler settings", "Toolchain executables", change the "Make program" to "plink.exe", and add the path to it in the "Additional paths" tab (in my case "C:\Program Files\Xming").
Step 6: Build the project. The first time you do this, you will be prompted with a "PuTTY Security Alert". Click "Yes" and the remote server will be added to your list of trusted hosts**.
* Your remote password is stored in plaintext, not everyone will like this! Also, the path to the remote makefile is relative to the root of the remote machine, for example /home/jeff/myproject.
** If you have used PuTTY before, this can go wrong. If you are being prompted for a username and password, delete the registry key "HKEY_CURRENT_USER/Software/Simon Tatham/PuTTY". Note that this could mess up your PuTTY configurations (it might not; I didn't check).
I hope this is useful to someone!