rem45acp
rem45acp

Reputation: 469

Run build script in Code::Blocks instead of building a target

Background:

I recently joined a software development company as an intern and am getting used to a new build system. The software is for an embedded system, and lets just say that all building and compiling is done on a buildbox. The building makes use of code generation using xml files, and then makes use of make files, spec files, and version files as well.

We develop on our own comps, (linux - mandriva distro) and build using the following methods:

ssh buildserver
use mount to mount drive on personal computer to the buildserver
set the environment using . ./set_env (may not be exactly that)
cd app_dir/obj (where makefile is)
make spec_clean
make spec_all
make clean
make

The Question:

I am a newbie to Code::Blocks and linux and was wondering how to set up a project file so that it can simply run a script file to execute these commands, instead of actually invoking the build process on my actual computer. Sort of like a pre-build script. I want to pair the execution of this script simply to Ctrl-F9 (build) and capture any output from the above commands in the build log window.

In other words, there is no build configuration or target that the project needs to worry about. I don't even need a compiler installed on my computer! I wish to set this up so that I can have the full features of an IDE.

Appreciate any suggestions!

Upvotes: 0

Views: 1818

Answers (1)

xpt
xpt

Reputation: 22994

put your script in a shell script file. E.g.,

#!/bin/sh
mount ... /mnt/path/buildserver
. ./set_env
cd app_dir/obj
make spec_clean
make spec_all
make clean
make

Say you name it as /path/to/my_build_script, then chmod 755 /path/to/my_build_script and invoke the following from your ssh client machine:

script -c ssh buildserver "path/to/my_build_script"

When finish, then check for the file typescript under current directory.

HTH

Upvotes: 1

Related Questions