Make has been traditionally been used for building embedded applications written in C. However Make has its issues. For example, it suffers from heavy reliance upon the host environment, arcane syntax and mysterious bugs due to whitespace issues.
Rake is a powerful and capable alternative, and I recommend you consider it for future projects. It's standardized, available on many platforms and backed by the full power of a real programming language.
Rake is used as the build system for the Ruby programming language. As part of the Ruby on Rails framework, Ruby is used by a large community of developers. With such a large development community, support and reference materials are easy to come by.
Rake uses Ruby syntax. Coming from C, the syntax takes a little bit to get used to, but it's well worth it in my opinion.
Although Rake is heavily linked to Ruby, it's language-agnostic as far as the target build is concerned. You can use it to build essentially any type of application, provided you point it to the correct tools. This includes cross-compiling toolchains for embedded targets as well.
Rake is available with Ruby on most major platforms, including Linux, OSX and Windows. Since it runs under Ruby, it does not rely on the host environment for simple operations like file or directory manipulation. These operations are built directly in Ruby and make Rakefiles platform independent.
Rake is included in Ruby installations 1.9 and later. To install Ruby, follow the directions for your platform here:
Generally, use a package manager for Linux or OS X and use RubyInstaller for Windows.
After installation you'll want to make sure that the Ruby binaries are in your path.
Rake works on Rakefiles, which consists of tasks (like Make targets) with specifed dependencies.
Here's a simple Rakefile:
task :default do puts "Hello World" end
This file defines a single task -- the "default" task -- which simply prints some text using
puts. The default task is the task run when no task argument is provided to Rake at the command line.
$ rake Hello World
We can add another task, and make the default task depend on this new task:
task :newtask do puts "Hi" end task :default => :newtask do puts "Hello World" end
When we run the
newtask is run first.
$ rake Hi Hello World
We can also run the new task individually.
$ rake newtask Hi
For more information, check out the official Rake documentation. Also there are several really good Rake tutorials online: