0

背景:

我最近作为实习生加入了一家软件开发公司,并且正在适应一个新的构建系统。该软件适用于嵌入式系统,可以说所有构建和编译都是在构建盒上完成的。该构建使用使用 xml 文件的代码生成,然后还使用 make 文件、规范文件和版本文件。

我们在自己的 comps 上开发(linux - mandriva 发行版)并使用以下方法构建:

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

问题:

我是 Code::Blocks 和 linux 的新手,想知道如何设置项目文件,以便它可以简单地运行脚本文件来执行这些命令,而不是在我的实际计算机上实际调用构建过程。有点像预构建脚本。我想将此脚本的执行简单地与 Ctrl-F9(构建)配对,并在构建日志窗口中捕获上述命令的任何输出。

换句话说,项目不需要担心构建配置或目标。我什至不需要在我的计算机上安装编译器!我希望设置它,以便我可以拥有 IDE 的全部功能。

感谢任何建议!

4

1 回答 1

1

把你的脚本放在一个 shell 脚本文件中。例如,

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

假设您将其命名为/path/to/my_build_script,然后chmod 755 /path/to/my_build_script从您的 ssh 客户端计算机调用以下命令:

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

完成后,检查typescript当前目录下的文件。

高温高压

于 2013-03-11T02:29:16.493 回答