Commit c86205d1 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Small tweaks and cleanup

parent 81955ca5
...@@ -183,8 +183,7 @@ let compile_c memsize program = ...@@ -183,8 +183,7 @@ let compile_c memsize program =
"#include <stdio.h>\n" ^ "#include <stdio.h>\n" ^
"#include <stdlib.h>\n" ^ "#include <stdlib.h>\n" ^
"void _start() {\n" ^ "void _start() {\n" ^
" unsigned char mem[" ^ string_of_int memsize ^ "] = {};\n" ^ " unsigned char mem[" ^ string_of_int memsize ^ "] = {}, *p = mem;\n" ^
" unsigned char *p = mem;\n" ^
indent (compile_commands "" program) ^ indent (compile_commands "" program) ^
" exit(0);\n" ^ " exit(0);\n" ^
"}\n" "}\n"
......
...@@ -10,19 +10,18 @@ fi ...@@ -10,19 +10,18 @@ fi
mytime () { mytime () {
(`which time` -f %e $1 > /dev/null) 2>&1 (`which time` -f %e $1 > /dev/null) 2>&1
} }
set -e
echo -n "compiling opt..." compile () {
make -s $basename-opt echo -n "compiling $1... "
echo done t=`mytime "make -s $basename-$1"`
echo "took $t seconds"
}
echo -n "compiling c..." set -e
make -s $basename-c
echo done
echo -n "compiling nayuki..." compile opt
make -s $basename-nayuki compile c
echo done compile nayuki
echo "opt: `mytime ./$basename-opt`" echo "opt: `mytime ./$basename-opt`"
echo "c: `mytime ./$basename-c`" echo "c: `mytime ./$basename-c`"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment