A KBuild like configure/build system in Ruby DSL
What is the RBuild ?
RBuild is a Linux kernel kbuild like software configure/build system written by Ruby language. It's small, simple, easy to use and even powerful !
Project host:
http://www.sourceforge.net/projects/rbuild/
How does RBuild work ?
RBuild take the 'RConfig' files as it's input, exports C/C++ header files, Makefiles or others by plug-ins.
RConfig files ===> RBuild ===> C/C++ header, Makefiles ....
How to use RBuild ?
Step 1: create your RConfig file. RConfig file's syntax is inherited from Linux kernel's KConfig.
example:
#
# RConfig file for ubase 4 kernel
#
gen_c_header 'config.h' # generate c header file
title "Welcom to uBase 4 kernel configuration system !"
menu "Kernel schedule configuration" do
group "Kernel context switch hooks" do
config :SWITCH_CONTEXT_HOOK_IN do
bool "context switch in hook"
end
config :SWITCH_CONTEXT_HOOK_OUT do
bool "context switch out hook"
end
end
end
menu "ARCH and CPU configuration" do
choice :ARCH, "Choice CPU core" do
# default :ARCH_ARM
config :ARCH_ARM do
bool "ARM core"
end
config :ARCH_MIPS do
bool "MIPS core"
end
end
choice :CPU, "Choice CPU" do
depends :ARCH # need to select 'ARCH' before select 'CPU'
config :CPU_EP7XXX do
bool "Cirrus Logic EP7xxx CPU"
depends :ARCH_ARM
end
config :CPU_PXA27X do
bool "Intel XScale PXA27x CPU"
depends :ARCH_ARM
end
end
end
choice :BSP, "Platform" do
depends :CPU # need to select 'CPU' before select 'BSP'
config :PT8XX do
bool "PT8XX"
depends :CPU_EP7XXX
end
config :PT98X do
bool "PT98X"
depends :CPU_PXA27X
end
end
Step 2: create your rake file :
require 'path_to_rbuild/rbuild'
task :menuconfig do
rconf = RBuild::RConfig.new('RConfig')
rconf.menuconfig()
end
Step 3: start to configure your project !
# rake menuconfig
... do your configuration ....
Press 'X' to export to C/C++ header file, press 'Q' to quit.
now check your config header file:
# cat config.h
Wow, Done !
Requirement:
Platform: Windows, Linux.
Ruby: ruby 1.8.x
Ruby ext: win32util ( for Win32), YAML
External applications: stty (for Linux)
Licence:
Copy right (C) 2008, Ricky Zheng <ricky_gz_zheng@yahoo.co.nz>
GNU GPLv2