User forums > Using Code::Blocks
How to run bash script, in Linux?
PaulPaul:
I've just switched from Eclipse to C::B. In Eclipse I setup a toolbar button that would run a bash script that would shutdown a Linux service, compile the application (manual make) and then restart the service. Eclipse would also save all pending files which was nice so I could be certain that the compile incorporated all the changes.
How can I do the same in C::B?
Jenna:
To manually start any tools you want you can add them to the "Tools"-menu, but that will not save any open files.
The easiest way to do this would be to use a custm-makefile project (in your case) and pre- and/or post-build steps.
Just create an empty project, add all the files that belong to it via the context-menu in the management pane, open the projects properties via the context-menu, and chose this is a custom makefile (and the makefile name) at the first tab.
You most likely have to fix the make commands in the "Make commands" tab of the projects build options.
In the build options you can also add post and pre-build steps.
If you click the build, or rebuild-button the project-manager will save all files automatically.
At the moment, the makefile has to be in the projects base-directory, but I have a patch on my computer, that will make it possible to change the makefiles execution directory.
The patch is not (yet) tested on windows, but this might happen this evening and so I might be able to commit it today.
PaulPaul:
I find it odd that there isn't a Save-All-and-Build, all-in-one button feature.
Jenna:
--- Quote from: PaulPaul on April 07, 2009, 11:53:30 pm ---I find it odd that there isn't a Save-All-and-Build, all-in-one button feature.
--- End quote ---
--- Quote from: jens on April 02, 2009, 08:05:04 pm ---If you click the build, or rebuild-button the project-manager will save all files automatically.
--- End quote ---
What's wrong with this ?
PaulPaul:
Oh, it's just because of the way I'm doing things. I have multiple projects that are all a part of my workspace, which are all part of one large application. Build will save the files for the selected project but not in any projects. I have one manual make file in a 'fake' project that I use to compile every individual project but again, I have to remember to save all my files first. Not a big deal unless you forget. I'm trying to figure out how to make a script to do the SaveAll (I have that much working) but I can't figure out how to execute the build.
Navigation
[0] Message Index
[#] Next page
Go to full version