Improve 2000/tomx/try.sh and try.alt.sh
Get CC, defaulting to cc.
This commit is contained in:
1 parent
a2d34d6fcf
commit
d73b80bd96
2 files changed
+30
-4
No files matched your search
+15
-2
@@ -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
|
||||
|
||||
+15
-2
@@ -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
|
||||
|
||||
Reference in new issue
Block a user