by seanstrom · 4y ago · 0 comments
```
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/...
No comments yet.