2 # Compile mu from scratch.
5 set -e # stop immediately on error
7 cd ..
/..
/linux
/bootstrap
/tools
8 # auto-generate various lists (ending in '_list' by convention) {
9 # list of function declarations, so I can define them in any order
10 grep -h "^[^ #].*) {" tangle.cc |
sed 's/ {.*/;/' > tangle.function_list
11 # list of tests to run
12 grep -h "^[[:space:]]*void test_" tangle.cc |
sed 's/^\s*void \(.*\)() {$/\1,/' > tangle.test_list
13 grep -h "^\s*void test_" tangle.cc |
sed 's/^\s*void \(.*\)() {.*/"\1",/' > tangle.test_name_list
15 g
++ -std=c
++98 -g -O3 tangle.cc
-o tangle
17 cd ..
/..
/..
/archive
/1.vm
20 gcc
-g -O2 -c termbox.c
22 ar rcs libtermbox.a
*.o
25 ..
/..
/linux
/bootstrap
/tools
/tangle
[0-9]*.cc
> mu.cc
26 # auto-generate function declarations, so I can define them in any order
27 # functions start out unindented, have all args on the same line, and end in ') {'
29 # \/ ignore struct/class methods
30 grep -h "^[^[:space:]#].*) {$" mu.cc |
grep -v ":.*(" |
sed 's/ {.*/;/' > function_list
31 # auto-generate list of tests to run
32 grep -h "^\s*void test_" mu.cc |
sed 's/^\s*void \(.*\)() {.*/\1,/' > test_list
33 grep -h "^\s*void test_" mu.cc |
sed 's/^\s*void \(.*\)() {.*/"\1",/' > test_name_list
34 g
++ -std=c
++98 -g -O2 mu.cc termbox
/libtermbox.a
-o mu_bin
36 cat [0-9]*.mu
> core.mu