From fce793776cccadc2131780ec2ac0e9aae4641143 Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sun, 5 Aug 2018 22:36:37 +1000 Subject: [PATCH] Have build-example run 'out of the box' --- build-example.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build-example.sh b/build-example.sh index 1fa1d599..02905e89 100755 --- a/build-example.sh +++ b/build-example.sh @@ -24,9 +24,13 @@ for f in example/*; do g++ -O3 $f/*.cc -o $f/a.out elif [ "$f" = "example/library" ]; then # example/library is unusual in that it uses separately compiled libraries - # (built by "wuffs genlib" above) instead of directly #include'ing Wuffs' - # .c files. - gcc -O3 -static -I.. $f/*.c gen/lib/c/gcc-static/libwuffs.a -o $f/a.out + # (built by "wuffs genlib", e.g. by running build-all.sh) instead of + # directly #include'ing Wuffs' .c files. + if [ -e gen/lib/c/gcc-static/libwuffs.a ]; then + gcc -O3 -static -I.. $f/*.c gen/lib/c/gcc-static/libwuffs.a -o $f/a.out + else + echo " Skipping example/library; run \"wuffs genlib\" first" + fi elif [ -e $f/*.c ]; then gcc -O3 $f/*.c -o $f/a.out fi