shake
minimal build system that generates Ninja build files
git clone https://9o.is/git/shake.git
commit 2d40cab9156ad481aee2633c77c1a3701048cae6 parent 9307c3bb35aaf7bbc2a8270c9bf380b0d1a026e5 Author: Jul <jul@9o.is> Date: Thu, 19 Mar 2026 22:37:01 +0800 add genfile function Diffstat:
| M | shake | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/shake b/shake @@ -379,11 +379,20 @@ has() { return 1 } +genfile() { + _f="$1" + case "$_f" in + $dir/*) _f="$DIR/${_f#*/}";; + $outdir/*) _f="$OUTDIR/${_f#*/}";; + esac + GEN_FILES="$GEN_FILES $_f" +} + foreach() { while read -r line; do $2 $line done <$DIR/$1 - GEN_FILES="$GEN_FILES $DIR/$1" + genfile "$DIR/$1" } if [ "$TARGET" ] && [ ! -f "$TARGET/Shakefile" ]; then