summaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rwxr-xr-xci26
1 files changed, 13 insertions, 13 deletions
diff --git a/ci b/ci
index 3870b3c..e1e1709 100755
--- a/ci
+++ b/ci
@@ -1,32 +1,32 @@
#!/usr/bin/env sh
# Convenient frontend for quickly evaluating C code
-LIBR="stdlib stdio math ieee754 limits stdint"
+LIBR="stdlib stdio math ieee754 limits stdint stdstring"
FLAG="-Wall -lm"
-NAME=/tmp/$RANDOM-$RANDOM
+gen_rand() {
+ od -A n -t d -N 1 /dev/urandom | tr -d ' '
+}
+
+NAME=/tmp/$(gen_rand)-$(gen_rand)
SRC=$NAME.c
BIN=$NAME-B
-for k in $LIBR; do
- echo "#include<$k.h>" >> $SRC
+for k in $LIBR; do
+ echo "#include<$k.h>" >> $SRC
done
-#echo -e "int main(int argc, char ** argv) {\n\n return 0;\n}" >> $SRC
-#zile +8 $SRC
-
echo "int main(int argc, char ** argv) {" >> $SRC
rlwrap -o cat >> $SRC
echo "return 0;}" >> $SRC
-
-echo -e "\n\n\t!!! Compiling ..."
-gcc $FLAG $SRC -o $BIN
+printf "\n\n\t!!! Compiling ..."
+cc $FLAG $SRC -o $BIN
if [ "$?" = "0" ]; then
- echo -e "\t!!! Executing ...\n\n"
- exec $BIN
- rm $BIN
+ printf "\n\n\t!!! Executing ...\n\n"
+ exec $BIN
+ rm $BIN
fi;
rm $SRC