From dbeda86c104ba013025ade28f28eff6e5f81e848 Mon Sep 17 00:00:00 2001 From: Cody Boone Ferguson <53008573+xexyl@users.noreply.github.com> Date: Tue, 14 Nov 2023 04:00:17 -0800 Subject: [PATCH] Improve 1996/westley/try.sh and try.alt.sh Get CC, defaulting to cc. --- 1996/westley/try.alt.sh | 15 ++++++++++++++- 1996/westley/try.sh | 15 ++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/1996/westley/try.alt.sh b/1996/westley/try.alt.sh index 0adf8e87c..6c9e4c480 100755 --- a/1996/westley/try.alt.sh +++ b/1996/westley/try.alt.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.alt.sh - demonstrate IOCCC winner 1996/westley alt code +# -make everything 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "Showing alt grandfather clock:" 1>&2 WESTLEY=./westley.alt ./clock1.sh diff --git a/1996/westley/try.sh b/1996/westley/try.sh index 8dea325ff..56cd8abe7 100755 --- a/1996/westley/try.sh +++ b/1996/westley/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash +# +# try.sh - demonstrate IOCCC winner 1996/westley +# -make everything 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" everything >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "Showing grandfather clock:" 1>&2 WESTLEY=./westley ./clock1.sh