| Not sure how to exactly to build a "generator" either, but it seems that it would be a build rule that generates multiple outputs from multiple inputs right? If that's the case there's a `foreach` function for convenience, but it doesn't seem to have something for multiple commands. Though there's this Lua example on their website that leaves me wondering if what you want is possible, here's the code (since the documentation seems offline atm): ``` 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/... |