Question

What are some alternatives to make for linux/freebsd?

Was it helpful?

Solution

I like SCons. It is constructed in such a way that every build script (a SConstruct file) is also a syntactically valid Python program. So, you can build arbitrary Python logic into your build script if you need to.

It's also much faster than make and calculates many kinds of dependencies automatically.

OTHER TIPS

My first question would be, what is the audience. Is this for building in-house software that only your team will build? If so, explore some of the options already presented. If this is something that others will be building, either stick with make, or use a tool that creates makefile and ship those. We use autoconf and automake for Linux and other unix platforms. In my opinion, you need a very good reason to do something other than configure; make; make install. Boost has their own tool (a modified version of Jam), and it annoys me everytime I need to try and get it to compile on an unusual machine.

cmake and imake are both build utilities, although Imake is no longer maintained. Cmake is also cross-platform and can be used on Windows as well.

If you're into java, ANT is a build tool geared to Java (which doesn't really play nicely with Make).

Troll tech make a tool called qmake, which they use to build QT. It works by generating makefiles - Troll needed a tool to support a cross-platform build - so you still need another make utility.

Automake :p which is commonly used in most linux app distributions but it gives a bit more work than a Makefile but better results http://www.gnu.org/software/automake/

http://www.openismus.com/documents/linux/automake/automake.shtml <-- nice explanation on how to use automake and autoconf

If you're looking for something completely different, there's Ant. I'm not that interested in it myself, but it does offer some portability advantages (no reliance on the unix shell, etc.)

I've heard good things about Jam.

OMake is a build tool for C/C++, OCaml, and LaTeX with automatic dependency analysis. It easily can build projects over multiple directories, and it finds changes based on MD5 sum rather than timestamp. It also has a mode where it can be run in the background, building your project whenever a file is modified. Generally, it takes less code to build common kinds of projects (C/C++ or OCaml programs and libraries) than make does. I haven't tried it for bigger projects.

Note that if you want to program in OCaml, this tool is really useful since the OCaml linker requires compiled modules to appear on the command line in dependency order, and figuring out this order every time something changes is non-trivial.

I've used CMake for more of my projects, including porting some autotools based ones and I can say that it does its job very well. It's mostly suitable for C/C++ cross platform projects.

The project I'm working on inherited some code that uses Cons instead of Make (not to confused with SCons in Greg Hewgill's answer).

Cons is written in Perl, much like SCons is written in Python. It manages dependencies automatically, and you can use any Perl code inside the build script to handle complex build sequences.

The main disadvantage (and the main reason I'm sorry my project uses it) is that Cons doesn't do parallel builds in the style of make -j. If you're compiling a number of files that don't depend on each other Cons will compile them one at a time, while make -j will compile them in parallel, which is great if you have multiple cores and threads on your machine.

Another make for cross-platform builds is kmake (a part of kbuild, in its own words: kBuild is a makefile framework for writing simple makefiles for complex tasks.). It is an enhanced version of GNU make. It is developed by the VirtualBox folks. They use it to build their VirtualBox Product for Windows, Linux, MacOS and Solaris. Pretty portable!

See http://svn.netlabs.org/kbuild for details.

WAF is an interesting alternative. Written in python it allows you to write your build logic in plain Python. Parallel builds + semi-auto-magic signature-based dependency tracking work reasonably well. It's supposedly cross-platform (i.e. knows how to do builds on Windows), but I haven't tried that.

It's got a fairly steep learning curve, but it also comes with "The WAF book" to aid with the process.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top