Macro cake::build [] [src]

macro_rules! build {
    { $($name:ident($($dep:ident),*) => $cont:expr,)* } => { ... };
}

Define a build.

This macro takes a block, which resembles the match syntax. Left to each of the arms are the recipe's (compilation unit) name, which is followed by the names of the recipes it depends on, delimited by (). Right to the arm is the recipe's instructions are placed. This is simply normal Rust code, defining the recipe.

Additionally, this expands to the main function, which handles arguments as well.

Examples

#[macro_use]
extern crate cake;

build! {
    start(sodium, libstd) => cmd!("ls"),
    sodium(libstd, libextra) => println!("yay"),
    libstd() => println!("libstd"),
    libextra() => println!("libextra"),
}