> 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...