From 44580dc3d464ecd5ba44ef4b83c10f9aa0ea53dd Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:15:24 -0800 Subject: [PATCH] Improve 2011/akari/try.sh Remove additional programs prior to running commands as otherwise if the programs are built it'll show 'up to date' message when running 'make'. Get CC, defaulting to cc. --- 2011/akari/try.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/2011/akari/try.sh b/2011/akari/try.sh index 08cc310ef..8c5846d1e 100755 --- a/2011/akari/try.sh +++ b/2011/akari/try.sh @@ -1,6 +1,24 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 2011/akari +# -make clobber akari || exit 1 +# make sure CC is set so that when we do make CC="$CC" it isn't empty. Doing it +# this way allows us to have the user specify a different compiler in an easy +# way. +if [[ -z "$CC" ]]; then + CC="cc" +fi + +# in this case we won't fail if we can't compile the code because we can still +# run the supplementary program. +make CC="$CC" all >/dev/null + +# clean out old binaries except the entry itself +rm -f akari2 akari3 akari4 + +# clear screen after compilation so that only the entry is shown +clear ./akari < example.ppm > odd_output.ppm ./akari - - even < example.ppm > even_output.ppm