github.com/zyedidia/knit@v1.1.2-0.20230901152954-f7d4e39a0e24/test/full_build/Knitfile (about) 1 knit = require("knit") 2 3 cc = cli.cc or "gcc" 4 debug = tobool(cli.debug) or false 5 6 cflags := -Wall 7 8 if debug then 9 cflags := $cflags -Og -g 10 else 11 cflags := $cflags -O2 12 end 13 14 src = knit.glob("*.c") 15 obj = knit.extrepl(src, ".c", ".o") 16 prog := hello 17 18 return b{ 19 $ $prog: $obj 20 $cc $cflags $input -o $output 21 22 $ %.o: %.c 23 $cc $cflags -c $input -o $output 24 25 $ clean:VB: 26 rm -f $obj $prog 27 }