Plus it’s worth considering that you can potentially use Fennel to configure the builds (since Fennel compiles to Lua).
Tup: https://github.com/gittup/tup
Fennel: https://fennel-lang.org/
Plus it’s worth considering that you can potentially use Fennel to configure the builds (since Fennel compiles to Lua).
Tup: https://github.com/gittup/tup
Fennel: https://fennel-lang.org/
Edit: Generator is a term typically used in CMake and Meson for this, in Make I'd use a pattern rule mostly.
Does this fail to address your problem?
The use-case at that time was to convert a LaTeX file containing a TIKZ image (therefore having a .tikz file extension) to an SVG which required compiling the LaTeX code to PDF, cropping the PDF and converting it to SVG. Since there were multiple occurrences of this across the project, I wanted to have that as a reusable "function" in the build system. I did not want to write a dedicated script for this because of portability issues (Shell vs. Batch).
```
inputs = { 'file1.c', 'file2.c' }
outputs = { '%B.o' }
commandA = 'gcc %f -c -o %o'
commandB = 'gcc %f -o %o'
objects = tup.foreach_rule(inputs, commandA, outputs) tup.rule(objects, commandB, {'app'})
```
Which apparently is a shortcut for saying:
```
tup.definerule{
inputs = {'file1.c'},
command = 'gcc file1.c -c -o file1.o',
outputs = {'file1.o'}
}tup.definerule{
inputs = {'file2.c'},
command = 'gcc file2.c -c -o file2.o',
outputs = {'file2.o'}
}tup.definerule{
inputs = {'file1.o', 'file2.o'},
command = 'gcc file1.o file2.o -c -o app',
outputs = {'app'}
}```
Reference: http://web.archive.org/web/20201026140926/http://gittup.org/...