My comment was meant to be practical advice considering make's popularity. A while back I wanted to replace a legacy script that generated Makefiles for a project at work, and I started out by making something very similar to Piper in python so it was easy for coworkers, etc, but ended up finding the guide I mentioned in my above comment while doing gcc dependency generation. Since I was targeting make underneath anyways, and my needs were less complex than I thought, I ended up scrapping my redundant python build tool.
It's not going in the same direction you are exactly but building a mental model of it in my head was salutary in terms of thinking through the purpose and implementation of build tools and hopefully it'll be similarly useful to you.
If piper is clearer for you, it can "compile" down into make, and then let gmake do the heavy lift, at least for some of the early prototyping.
There are so many build systems that honestly... it is crazy to me.
(grabbing geezer stick) When I grew up we only had make... and we liked it! /s
> Yep! But what if we add mappings and collections?
These are called pattern rules in make:
https://www.gnu.org/software/make/manual/html_node/Pattern-R...
This is the best resource I've found on make to get a low friction build system up and running. Some parts are a bit dense if you're relatively new to make or used to someone else setting it up for you, but if you have the gnu make manual side-by-side for reference you should be good to go:
https://make.mad-scientist.net/papers/advanced-auto-dependen...
If you've ever been frustrated with how time consuming it is to manually write make rules then the above method will probably be a night-and-day difference from what you're used to.
I'd also strongly suggest either disabling builtin implicit rules with -r or reading up on all of them here:
https://www.gnu.org/software/make/manual/html_node/Catalogue...