shake

minimal build system that generates Ninja build files

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

commit 637572fc6624bab80ab2a6bdbb714fa230144e3f
parent 1a3315ffeff541663ead15e76439902a471b783f
Author: Jul <jul@9o.is>
Date:   Mon,  9 Mar 2026 21:27:31 +0800

add header file to nested example

Diffstat:
Mexample/nested/Shakefile | 1+
Mexample/nested/bin/Shakefile | 4+++-
Mexample/nested/bin/main.c | 3+--
Aexample/nested/lib/lib.h | 2++
4 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/example/nested/Shakefile b/example/nested/Shakefile @@ -4,6 +4,7 @@ var CC ${CC:-cc} var CFLAGS ${CFLAGS:--Wall -Wextra -g} var PREFIX ${PREFIX:-/usr/local} var DESTDIR ${DESTDIR:-} +var LIBDIR $dir/lib rule cc '$CC $CFLAGS -c $in -o $out' bind description 'CC $in' diff --git a/example/nested/bin/Shakefile b/example/nested/bin/Shakefile @@ -1,6 +1,8 @@ #!/usr/bin/env sh +var CFLAGS $CFLAGS -I $LIBDIR + cc main.o main.c -link hello main.o $outdir/../lib/lib.a +link hello main.o $LIBDIR/lib.a default hello diff --git a/example/nested/bin/main.c b/example/nested/bin/main.c @@ -1,6 +1,5 @@ #include <stdio.h> - -int add(int a, int b); +#include <lib.h> int main() { int result = add(2, 3); diff --git a/example/nested/lib/lib.h b/example/nested/lib/lib.h @@ -0,0 +1 @@ +int add(int a, int b); +\ No newline at end of file