maker

Crates.iomaker
lib.rsmaker
version0.0.2
created_at2025-06-25 13:30:18.448215+00
updated_at2025-07-08 12:57:23.034608+00
descriptionGeneric Rusty declarative build system like GNU Make
homepage
repositoryhttps://github.com/e792a8/maker
max_upload_size
id1725827
size9,625
tsanz (e792a8)

documentation

README

maker

Generic Rusty declarative build system, like GNU Make.

Allows writing some Makefile-like rules, e.g.

let obj = Target::new_file("main.o")
    .depends_on_file("main.c")
    .recipe(|target, deps| {
        Command::new("gcc")
            .arg("-o")
            .arg(target)
            .args(deps)
            .status()
            .unwrap();
    });
let bin = Target::new_file("main")
    .depends_on_target(obj)
    .recipe(|target, deps| {
        Command::new("ld")
            .arg("-o")
            .arg(target)
            .args(deps)
            .status()
            .unwrap();
    });
bin.make();

... which is equivalent to the Makefile:

main.o: main.c
    gcc -o $@ $^
main: main.0
    ld -o $@ $^

... but see that .recipe() function? We can not only write shell scripts there, but also do more things fun and cross-platform (meanings of generic) -- in Rust!

In the hope that it will be useful in build.rs and xtask.

Commit count: 0

cargo fmt