diff --git a/2000/tomx/try.alt.sh b/2000/tomx/try.alt.sh index 1d8f730d8..0ffb04090 100755 --- a/2000/tomx/try.alt.sh +++ b/2000/tomx/try.alt.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash -# -# try.sh - script to show 2000/tomx +# +# try.alt.sh - demonstrate IOCCC winner 2000/tomx alt code +# + +# 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" alt >/dev/null || exit 1 + +# clear screen after compilation so that only the entry is shown +clear echo "Using tomx.alt.c to compile mkentry.c directly:" 1>&2 echo "$ chmod +x tomx.alt.c" 1>&2 diff --git a/2000/tomx/try.sh b/2000/tomx/try.sh index db719b5b8..e3bb764dc 100755 --- a/2000/tomx/try.sh +++ b/2000/tomx/try.sh @@ -1,6 +1,19 @@ #!/usr/bin/env bash -# -# try.sh - script to show 2000/tomx +# +# try.sh - demonstrate IOCCC winner 2000/tomx +# + +# 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 if [[ ! -f "tomx" || ! -e "tomx" ]]; then echo "Compiling tomx.c:" 1>&2