Announcing FBuild 0.1
posted on June 27, 2009 - 11:57 PM PDT
by Erick Tryzelaar
filed under:
FBuild,
Release
I'm pleased to announce the first release 0.1 of FBuild, which you can download here. FBuild is a new way to build software. It's designed around the concept of caching functions, instead of declarative tree building. For instance, this is a simple C fbuildroot.py:
import fbuild
import fbuild.builders.c
def build():
# Create a C builder
static = fbuild.builders.c.guess_static()
# Build some libraries
lib1 = static.build_lib('static1', ['lib1.c'])
lib2 = static.build_lib('static2', ['lib2.c'], libs=[lib1])
# ... an executable that uses those libraries
exe = static.build_exe('static', ['exe.c'], libs=[lib2])
# ... finally run it
fbuild.logger.log(' * running %s:' % exe)
fbuild.execute([exe])
When you run it, you'll get:
determining platform : {'bsd', 'darwin', 'macosx', 'posix'}
looking for program gcc : ok /usr/bin/gcc
checking gcc : ok
checking gcc with -g : ok
checking gcc with -O2 : ok
looking for program ar : ok /usr/bin/ar
looking for program ranlib : ok /usr/bin/ranlib
checking if gcc can make objects : ok
checking if gcc can make libraries : ok
checking if gcc can make exes : ok
checking if gcc can link lib to exe : ok
* gcc : lib1.c -> build/lib1.o
* ar -rc : build/lib1.o -> build/libstatic1.a
* ranlib : build/libstatic1.a
* gcc : lib2.c -> build/lib2.o
* ar -rc : build/lib2.o -> build/libstatic2.a
* ranlib : build/libstatic2.a
* gcc : exe.c -> build/exe.o
* gcc : build/exe.o build/libstatic2.a build/libstatic1.a -> build/static
* running build/static:
5 6
This is a pretty simple example, but FBuild really shines when you need to do something more complex. Here's some of the details of the current release:
- Linux, Apple and Windows support
- C, C++, OCaml, Java, Scala, Bison, and Felix builders
- Multilevel namespaces for builders
- Simple creation of new builders
- Extensive configuration system for c90, c99, most of posix, and other libraries
- On-demand configuration
- Simultaneous building
- Detects file changes via file digests
- Pretty output
- Very speedy
For examples on how to use it, you can read the documentation here.
You'll need either Python 3.0 or Python 3.1, though I'd recommend Python 3.1 since FBuild is much faster with it.
If you need more help, you can ask on our mailing list, or in our irc channel.