User forums > Using Code::Blocks

Compling on a remote machine

<< < (2/3) > >>

erezz:
I moved it to a script and put the full path to the script in "Build project/target". I get the same error:


--- Code: ---Using makefile: Makefile
make: Makefile: No such file or directory
make: *** No rule to make target `Makefile'.  Stop.
Process terminated with status 2 (0 minutes, 0 seconds)
0 errors, 0 warnings

--- End code ---

It looks like it's looking for a Makefile. One more (probably important) thing - when I checked "This is a custom Makefile" in the project properties, I saw a warning that "the file must exist, no Makefile will be auto-generated". Do I need to create a Makefile and call my ssh command from it?

Thanks,
Erez

oBFusCATed:
If you don't have a Makefile you can't get it to work this way.
You have to write a Makefile or use a makefile generator software.
Then you should call make in the same directory as the Makefile.

Jenna:
Maybe a little hacky, but this should work:


* Place your script in the "Execution directory" of your makefile
* use ./[your_script] as makefile
* change the "Make" commands in the projects "Build options" to just $makefile
* do this for all targets, or just for the projects and empty the commands for the targets
* for compiling a single file or for cleaning you can use commandline parameters, similar to the makefile-targets

I tested it with a simple project on my debian machine.
Not tested with ssh, but this should not make a difference (at least if you do not need passwords).

With build script this might also be possible to do.

erezz:
I probably did something wrong...

I created a Makefile and placed it in the path that I found in the project properties under "Execution directory". The Makefile contains a single line:

--- Code: ---ssh some_remote_machine "cd some_dir && make -j8"

--- End code ---

Now, I selected "Build options" for the project and set "Build project/target" for the project to "$makefile". I hit ctrl+f9 and got this:


--- Code: ----------------- Build: Debug in my_proj_name ---------------

Using makefile: Makefile
Nothing to be done (all items are up-to-date).

--- End code ---

Jenna:
Make sure your makefile is executable and
--- Quote from: jens on December 29, 2011, 06:43:28 pm ---
Maybe a little hacky, but this should work:


* Place your script in the "Execution directory" of your makefile
* use ./[your_script] as makefile
* change the "Make" commands in the projects "Build options" to just $makefile
* do this for all targets, or just for the projects and empty the commands for the targets
* for compiling a single file or for cleaning you can use commandline parameters, similar to the makefile-targets

I tested it with a simple project on my debian machine.
Not tested with ssh, but this should not make a difference (at least if you do not need passwords).

With build script this might also be possible to do.

--- End quote ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version