3 ms·
No mention of tup? You can do something like the make variant with: : foreach *.c |> gcc -c %f -o %o |> %B.o Edit: Note that this example is different from
by anon4 13y ago
No mention of tup?
You can do something like the make variant with:
: foreach *.c |> gcc -c %f -o %o |> %B.o
Edit: Note that this example is different from what Make will do. With Make you're saying "whenever you need to satisfy a * .o dependency go compile a .c". With Tup, it is "find all * .c and make .os from each of them". In fact, a complete Tupfile that just compiles all .c files it finds and links the resulting .o files is simply (copied straight from the examples):
: foreach *.c |> gcc -Wall -c %f -o %o |> %B.o
: *.o |> gcc %f -o %o |> hello
Or if you want to output files named in some other way and not as basename.o, you can write a script that generates those rules and include it inline:
run ./myscript.py
Or you can write a Lua script that uses the Tup Lua API to define rules.
- andrewflnr 13y agoI'm using tup right now (lightly) and rather enjoying it.