shake

minimal build system that generates Ninja build files

git clone https://9o.is/git/shake.git

commit 448f3f5533a81f3c82ff586bd8b3db9e6bcb2e4e
parent ac7d84d00b0845ef3c9b7833d7c8527540a42904
Author: Jul <jul@9o.is>
Date:   Wed, 18 Mar 2026 14:27:34 +0800

improve build input handling

Diffstat:
Mshake | 22++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/shake b/shake @@ -219,28 +219,38 @@ build() { for _v in ${*:2}; do case "$_v" in '-') - if [ "$_mode" != bdep ]; then - printf ' |' >&3 - fi + case "$_mode" in + bout) printf ': %s |' $_brule >&3;; + bin) printf ' |' >&3;; + bord) error 'invalid rule';; + esac _mode=bdep ;; '--') - if [ "$_mode" != bord ]; then - printf ' ||' >&3 - fi + case "$_mode" in + bout) printf ': %s ||' $_brule >&3;; + bin|bdep) printf ' ||' >&3;; + esac _mode=bord ;; ':') + if [ "$_mode" != bout ]; then + error 'invalid rule' + fi printf ': %s' $_brule >&3 _mode=bin _pre=$dir ;; *:*) + if [ "$_mode" != bout ]; then + error 'invalid rule' + fi if [ "${_v%%:*}" ]; then _shake_prefix $_pre "${_v%%:*}" fi printf ': %s' $_brule >&3 + _mode=bin _pre=$dir if [ "${_v##*:}" ]; then