makemake
makemake is a rust library for building Makefiles programmatically.
Usage
Run this command in your rust project root:
cargo add makemake
You can find the crate on crates.io.
Example
Let's build a Makefile for a C project.
let mut makefile = new;
We'll want variables for the source files, object files, compiler, and flags.
let src = makefile.assign;
let obj = makefile.assign;
let cc = makefile.assign_without_overwrite;
let cflags = makefile.append;
let target = makefile.assign;
Next, we'll define the rule to create the target.
makefile.rule.dep.dep.cmd;
Finally, we can print the resultant Makefile.
print!;
Indeed, we can use our Makefile to build an example project.
cargo run --example c_project > examples/Makefile
cd examples
make && ./main
The actual example also comes with a make clean!
Setting Up Git Hooks
After cloning the repository, run the following script to set up the hooks:
/bin/sh setup_hooks.sh
License
This project is licensed under the MIT License, a copy of which is available in this directory.