Improve 1996/august/try.sh
Get CC defaulting to cc.
This commit is contained in:
1 parent
7182f1a9f4
commit
48e9ffea8f
1 file changed
+20
-1
+20
-1
@@ -1,6 +1,20 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# try.sh - show IOCCC winner 1996/august
|
||||||
|
#
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
make clobber all
|
|
||||||
set -x
|
set -x
|
||||||
cat august.c test.oc | ./august > test.oo
|
cat august.c test.oc | ./august > test.oo
|
||||||
./august < test.oo
|
./august < test.oo
|
||||||
@@ -14,7 +28,12 @@ cat parse.oo fac.oc | ./august | ./august
|
|||||||
|
|
||||||
rm august.oc
|
rm august.oc
|
||||||
make august.oc
|
make august.oc
|
||||||
|
|
||||||
|
# this next step is vital for some compilers! Not having it will make the
|
||||||
|
# compiler create code that enters an infinite loop. This is known to happen in
|
||||||
|
# macOS as one example.
|
||||||
sed -i'' '/^#/d' august.oc
|
sed -i'' '/^#/d' august.oc
|
||||||
|
|
||||||
cat august.c august.oc | ./august > august.oo
|
cat august.c august.oc | ./august > august.oo
|
||||||
cat august.oo test.oo | ./august
|
cat august.oo test.oo | ./august
|
||||||
cat august.oo august.oo fac.oo | ./august
|
cat august.oo august.oo fac.oo | ./august
|
||||||
|
|||||||
Reference in new issue
Block a user