From e27906cbad42c931d803f23619b51bcbf3b48fd5 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 03:50:05 -0800 Subject: [PATCH] Improve 1996/gandalf/try.sh Get CC defaulting at cc. BTW: it's absolutely perilous to 'try' the patience of Gandalf. Go ahead, 'try' it! :-) --- 1996/gandalf/try.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/1996/gandalf/try.sh b/1996/gandalf/try.sh index 03128d772..b7dd5acbb 100755 --- a/1996/gandalf/try.sh +++ b/1996/gandalf/try.sh @@ -1,6 +1,22 @@ #!/usr/bin/env bash +# +# try.sh - show IOCCC winner 1996/gandalf +# +# BTW: it is absolutely perilous to 'try' the patience of Gandalf: go ahead, +# 'try it'! :-) +# -make all 1>/dev/null || 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 + +make CC="$CC" all >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear # remove temporary files to show later rm -f hatcat.txt cathat.txt hatcat2.txt cathat2.txt hatcat3.txt cathat3.txt